The Hex Editor Window (shown above) is the main method of viewing and editing binary files in 010 Editor (to edit text files see Using the Text Editor). A Hex Editor Window is displayed for each binary file that is loaded in the editor. Each file is displayed in a File Tab that displays a shortened form of the file name but the full file name can be viewed in the application title bar or in a hint popup displayed by placing the mouse cursor over the File Tab. The Hex Editor Window is divided into a left and a right area. By default, the left area displays the bytes of the file as a series of hexadecimal bytes and the right area displays the bytes as a series of characters (if a byte cannot be shown as a character a '.' will be displayed). To the left of the Hex Editor Window is a list of addresses. Each address indicates the file position of the first byte on the line. At the top of the window a Ruler indicates the byte offsets from the address on that line. The editor can be changed to display data in a number of different formats and to modify how the Hex Editor Window displays data see Working with File Interfaces.
A cursor is displayed in the Hex Editor Window as a vertical, flashing line. The cursor indicates the current position for inserting, deleting, or editing data. Move the cursor with the mouse by clicking anywhere in the main display with the left mouse button. Alternately, the cursor keys can be used to move the cursor (see Editor Keys below). When the cursor is in the left or right areas, the byte the cursor is currently over will be highlighted gray in the other area. Switch between areas by pressing the Tab key. When the Hex Editor Window is not focused, a vertical gray line, called the shadow cursor, will indicate where the cursor was located. When the editor is in Overwrite mode (see Editing Data below) the cursor will be displayed as a thick vertical line and when the editor is in Insert mode the cursor will be displayed as a thin vertical line.
To edit data in the editor, position the cursor over the byte to edit. When the cursor is in the left area (hexadecimal data) enter a valid hexadecimal digit (0 to 9 or A to F) to edit the data. When the cursor is in the right area (character data) enter any character to edit the data.
The result of editing depends on whether the editor is in Insert or Overwrite mode. In Overwrite mode (OVR appears in the Status Bar) the characters typed will replace any existing characters. In Insert mode (INS appears in the Status Bar) a new byte will be inserted in the file (NOTE: when editing hexadecimal data, a byte is inserted only when the cursor is over the first digit in the hexadecimal byte). The current Insert/Overwrite mode is stored separately for text and hex files and the current mode can be changing using the Insert Key (see Editor Keys below) or by clicking INS/OVR in the status bar. Pressing the Delete key will delete the current byte from the file.
When any edits are made to the file, a '*' character will appear in the title bar to indicate that the file has been modified. If bytes have been inserted, a '*' character will appear by the file size in the Status Bar. The 'Edit > Undo' and 'Edit > Redo' menu options can be used to undo or redo any changes made to the file. The file can also be edited using the clipboard (see Using the Clipboard for more information).
The following keys are available when editing the file:
- Left, Right, Up, Down - move the cursor in any direction.
- Ctrl+Left, Ctrl+Right - move the cursor to the next or last group of bytes.
- Ctrl+Up, Ctrl+Down - scroll the editor up or down without moving the cursor.
- Home - move the cursor to the first byte on a line.
- End - move the cursor to the last byte on a line.
- Ctrl+Home - move the cursor to the first byte in the file.
- Ctrl+End - move the cursor to the end of the file.
- Insert - toggle Insert and Overwrite mode.
- Delete - deletes the current byte from the file.
- Tab - switches between the left and right editing areas.
- Alt+Up - moves to the previous sector in a hard drive.
- Alt+Down - moves to the next sector in a hard drive.
A menu of editing options can be accessed by right-clicking on the Hex Editor Window. This menu is sub-set of the Edit Menu (see the Edit Menu for an explanation of each menu option). The Right-Click menu can also be used to set the current selection and see Selecting Bytes for more information.
010 Editor has the ability to visually swap bytes of data in the Hex Editor without modifying the underlying data (for example, compare the image above with the image at the top of this page). Data can be swapped in groups of 2 bytes, 4 bytes, 8 bytes, etc. and the number of bytes is controlled using the 'View > Group By' menu. To swap data, choose a byte grouping in the 'View > Group By' other than Byte and then enable the 'View > Group By > Swap Little-Endian Bytes by Group' option. Note that swapping is only performed when the current file is in Little Endian mode and when swapping is enabled 'LIT<>' will appear in the status bar. When bytes are swapped in the Hex Editor, the selection behaves differently because 010 Editor only supports selecting a contiguous range of bytes. Therefore, the selection may sometimes appear disjointed because of which bytes are selected. Hold down the Ctrl key when selecting using the keyboard to ensure that a full group is selected. To swap the bytes in the actual data file, see the Hex Operations dialog.
Splitting the Hex Editor Window
The Hex Editor Window can be split into two different regions by clicking the small button above the horizontal scroll bar (see the diagram above) and dragging the mouse down. After releasing the mouse, the window will be split into a top and a bottom area (see the diagram below). This feature is useful if you are editing two different areas of the file at the same time. Press the Tab or Shift-Tab keys to move the cursor between the different areas. Move the mouse over the line separating the areas and click and drag the line up or down to resize the areas (the mouse cursor should change to an up-down arrow). Double-click on the separating line to remove the separator and return to having just one area. The Hex Editor Window can also be split or un-split by clicking the 'Window > Split Window' menu option.
After a Binary Template has been run on the current file, the results will be displayed in the Template Results panel at the bottom of the Hex Editor Window. This panel is sometimes hidden and can be shown by clicking the small button below the horizontal scroll bar and dragging upwards. See Working with Template Results for more information on using the Template Results panel.
See the Editor Options and Hex Editor Options dialogs for a list of options that can be controlled for the Hex Editor Window.