Clipboard

Ghidra includes clipboard support so that data and code can easily be transferred in and out of your project. The Ghidra clipboard supports copying and pasting in a variety of formats (achieved by executing the Copy Special... command). Each window defines its own behavior for how the clipboard will function and what types of data will be copied.

The Code Browser supports the following copy formats: 

The default copy operation in the Code Browser (achieved by executing the Copy command), however, will copy either selected text or the specific field under the cursor, depending upon the current selection and cursor location in the browser.

To do the default copy, make a selection in the Code Browser, right mouse click and choose the Copy option.

In order to copy labels and comments, right-click from within the Code Browser, Click Copy Special..., and choose the format you would like to copy. The last selected format is also available from the right-click popup menu.

The clipboard supports the following operations:

The clipboard allows for data to be both copied locally (within Ghidra) or onto the system clipboard. Data copied onto the system clipboard may be accepted by other applications.

Default Operations

  Copy

Copies the currently selected items. The behavior will be dependent on the specific window you copy from. Generally, copy means to place a copy of whatever is selected onto the clipboard so that it can be pasted in another location within Ghidra or to another application. The copy action can be triggered via the context menu that appears when you right-click.

  Paste

Pastes the clipboard contents to the current location. The behavior will be dependent on the specific window you paste to. Generally, paste means to insert a copy of whatever is on the clipboard to the location the cursor is currently at. Unlike the cut and copy actions, the paste action is always enabled because it cannot be notified of clipboard changes. If you attempt to paste and the data on the clipboard is not compatible with the window you pasted in, you will receive an error message. The paste action can be triggered via the context menu that appears when you right-click.

Custom Operations

Copy Special

The copy special dialog allows you to copy the selected information in a specific format. You can trigger the copy special dialog via the context menu that appears when you right-click. When the dialog appears, it will contain a list of the currently available formats. Choose the format you want and click OK to copy the selected information to the clipboard.

The last selected format from the copy special dialog will appear on the popup menu along with the standard copy and paste operations (it is only visible when the last selected format is applicable). This feature allows you to repeatedly copy the same format quickly from either the menu or by binding a key to it. To specify a key binding, select EditTool Options, click on Key Bindings, and choose the action for which you want to define a key. The action for repeat copying of the last format is called Copy Special Again. When available, the popup menu appears as follows:

Supported Windows

Listing

The Code Browser Listing window can copy the following formats:

The Code Browser Listing window can paste the following formats:

The paste is able to determine the type of data on the clipboard and will paste the appropriate type when it is triggered.

Bytes in Memory

The Byte Viewer Bytes In Memory window can copy the following formats:

The Byte Viewer Bytes In Memory window can paste the following formats:

The paste is able to determine the type of data on the clipboard and will paste the appropriate type when it is triggered.