Usage

3.1. To Edit a File

To edit a file, perform the following steps:

  1. Click in the hexadecimal or ASCII view of the file. The view in which the cursor is active displays a full cursor. The view in which the cursor is not active displays an outline of the cursor.

  2. Use any of the following methods to move the cursor around the file:

    • Use the scrollbar on the window or the arrow keys on the keyboard to scroll through the file.
    • Choose Edit ▸ Goto Byte, type the cursor offset as a decimal or hexadecimal value, then click OK. The format of the hexadecimal value must be 0x followed by the offset, for example 0x3.
  3. Edit the ASCII format in the same way you edit a normal text file. To edit the hexadecimal format, use the values 0 to 9 and a to f.

To insert data and not overwrite existing data, choose Edit ▸ Insert Mode.

To cut, copy, and paste data, choose Edit ▸ Cut, Edit ▸ Copy, and Edit ▸ Paste.

To undo an edit, choose Edit ▸ Undo. To redo an edit, choose Edit ▸ Redo. The number of previous edits that you can undo is determined by the Maximum number of undo levels setting in the Section 4.1 ― Editing tabbed section of the Preferences dialog.

3.2. To Save a File

You can save a file in the following ways:

  • To save changes to the current file, choose File ▸ Save.
  • To save the current file under a new filename, choose File ▸ Save As. Enter a name for the file in the Select a file to save buffer as dialog, then click OK.

3.3. To Revert to the Last Saved Version of a File

To revert to the last version of the current file that you saved and undo all of the edits that you made to the file since you last saved the file, choose File ▸ Revert, then click Yes in the Question dialog.

3.4. To Find Data in a File

To search a file for a hexadecimal or ASCII string, perform the following steps:

  1. Choose Edit ▸ Find.

  2. In the Find Data dialog, choose one of the following options:

    • Search for hex data
    • Search for ASCII data
  3. Type the string that you want to find.

  4. Click Find Next to find the next occurrence of the string.

  5. Click Find Previous to find the previous occurrence of the string.

  6. Click Cancel to close the Find Data dialog.

3.5. To Perform an Advanced Find

To perform an advanced find, perform the following steps:

  1. Choose Edit ▸ Advanced Find.
  2. In the Find Data dialog, select the required search criteria. For information about how to add new search criteria, see Section 3.6 ― To Add Search Criteria.
  3. Click Find Next to find the next occurrence of the string.
  4. Click Find Previous to find the previous occurrence of the string.
  5. Click Close to close the Find Data dialog.

3.6. To Add Search Criteria

To add search criteria, perform the following steps:

  1. Choose Edit ▸ Advanced Find.

  2. In the Find Data dialog, click Add New.

  3. In the Find Data: Add Search dialog, choose one of the following options:

    • Search for hex data
    • Search for ASCII data
  4. Type the string that you want to find.

  5. Use the color wheel or the spin boxes to select a color to highlight the search criteria.

  6. Click Add.

  7. Click Cancel to close the Find Data dialog.

3.7. To Remove Search Criteria

To remove search criteria, perform the following steps:

  1. Choose Edit ▸ Advanced Find.
  2. In the Find Data dialog, select the search criteria that you want to remove.
  3. Click Remove Selected.
  4. Click Cancel to close the Find Data dialog.

3.8. To Find and Replace Data in a File

To search a file for a hexadecimal or ASCII string and then replace the string, perform the following steps:

  1. Choose Edit ▸ Replace.

  2. In the Find & Replace Data dialog, choose one of the following options:

    • Replace hex data
    • Replace ASCII data
  3. In the first text box, type the string that you want to find.

  4. In the second text box, type the string that you want to use to replace the string that you find.

  5. Click Find Next.

  6. Click Replace to replace the current occurrence of the string or click Replace All to replace all occurrences of the string.

  7. Click Cancel to close the Find & Replace Data dialog.

3.9. To Add or Remove Additional Views of a File

To add another view of the current file to your GHex window, choose View ▸ Add View.

To remove a view of the current file, choose View ▸ Remove View. If you remove the last view that is open, the application exits.

3.10. To Change the Data Group Type

To change how GHex displays the hexadecimal content of a file in the GHex window, choose View ▸ Group Data As, then select one of the following menu items:

  • Bytes - single bytes
  • Words - groups of two bytes
  • Longwords - groups of four bytes

3.11. To Export the GHex Display to HTML

To export the data contained in the GHex window to HTML, choose File ▸ Save As HTML. Choose a directory and specify a filename for the HTML file, then click OK. GHex implements the following actions:

  • Creates a separate HTML file for each page of data that is displayed in the GHex window.
  • Uses the HTML filename that you specify as the basis for the filename.
  • Appends a page number to the filename to differentiate the files.
For example, if you specify the filename log.html, GHex creates a series of HTML files named log00000000.html, log00000001.html, log00000002.html, and so on.

3.12. To View a Character Table

To view a table that contains the ASCII, hexadecimal, decimal, octal, and binary representations for the values 0 to 255, choose Windows ▸ Character Table.

3.13. To View Data Conversions

To display the binary, decimal, hexadecimal, and ASCII conversions for up to four bytes of data, perform the following steps:

  1. Choose Windows ▸ Base Converter.

  2. Perform one of the following actions:

    • Type the data that you want to convert in one of the fields in the Base Converter dialog, then press Return.
    • To display the conversions for the data at the cursor position in the current file, click on the Get cursor value button.

    GHex updates the values of the other fields to display the data conversions.

  3. Click Close to close the Base Converter dialog.

3.14. To Show or Hide the Type Conversion Dialog

To show or hide the type conversion dialog, choose Windows ▸ Type Conversion Dialog.

The type conversion dialog displays the value of the selected character in the following representations:

  • Signed 8 bit
  • Unsigned 8 bit
  • Signed 16 bit
  • Unsigned 16 bit
  • Signed 32 bit
  • Unsigned 32 bit
  • 32 bit float
  • 64 bit float
  • Hexadecimal
  • Octal
  • Binary
  • Stream Length

The type conversion dialog also contains the following options:

Show little endian decoding

Select this option to show little endian decoding.

Show unsigned and float as hexadecimal

Select this option to show unsigned and float numbers as hexadecimal numbers.

3.15. To Print a File

To print a file, choose File ▸ Print. Select the print options that you require in the Print dialog, then click OK.

To preview a printed copy of the file, choose File ▸ Print Preview.