User manual for GHex
- 1. Introduction
- 2. Getting Started
- 3. Usage
- 4. Preferences
1. Introduction
The GHex application enables you to perform the following actions:
- View a file in ASCII or hexadecimal format simultaneously.
- Edit a file in either ASCII or hexadecimal format.
2. Getting Started
- 2.1. To Start GHex
- 2.2. When You Start GHex
- 2.3. To Open a File
2.1. To Start GHex
You can start GHex in the following ways:
- menu
-
Choose .
- Command line
-
Execute the following command: ghex
2.3. To Open a File
To open a file, choose . Select the file that you want to open, then click . You can open multiple files in GHex. GHex displays each file in a new window.
When you open a file in GHex, the application displays the file in the following window.
The GHex window contains the following elements:
- Menubar
-
The menus on the menubar contain all the commands that you need to work with files in GHex.
- Cursor offsets column
-
The cursor offset is the distance between the beginning of the file and the first byte in each line. By default, GHex displays the cursor offsets column to the left of the hexadecimal view.
- Display pane on left side
-
The display pane on the left side of the display area displays a hexadecimal view of the file.
- Display pane on right side
-
The display pane on the right side of the display area displays an ASCII view of the file.
- Type conversion dialog
-
The type conversion dialog below the display area displays the value of the selected character in several different numeric types.
3. Usage
- 3.1. To Edit a File
- 3.2. To Save a File
- 3.3. To Revert to the Last Saved Version of a File
- 3.4. To Find Data in a File
- 3.5. To Perform an Advanced Find
- 3.6. To Add Search Criteria
- 3.7. To Remove Search Criteria
- 3.8. To Find and Replace Data in a File
- 3.9. To Add or Remove Additional Views of a File
- 3.10. To Change the Data Group Type
- 3.11. To Export the GHex Display to HTML
- 3.12. To View a Character Table
- 3.13. To View Data Conversions
- 3.14. To Show or Hide the Type Conversion Dialog
- 3.15. To Print a File
3.1. To Edit a File
To edit a file, perform the following steps:
-
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.
-
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 , type the cursor offset as a decimal or hexadecimal value, then click . The format of the hexadecimal value must be 0x followed by the offset, for example 0x3.
-
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 .
To cut, copy, and paste data, choose , , and .
To undo an edit, choose . To redo an edit, choose . 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 .
- To save the current file under a new filename, choose . Enter a name for the file in the Select a file to save buffer as dialog, then click .
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 , then click 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:
-
Choose .
-
In the Find Data dialog, choose one of the following options:
- Search for hex data
- Search for ASCII data
-
Type the string that you want to find.
-
Click to find the next occurrence of the string.
-
Click to find the previous occurrence of the string.
-
Click to close the Find Data dialog.
3.5. To Perform an Advanced Find
To perform an advanced find, perform the following steps:
- Choose .
- 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.
- Click to find the next occurrence of the string.
- Click to find the previous occurrence of the string.
- Click to close the Find Data dialog.
3.6. To Add Search Criteria
To add search criteria, perform the following steps:
-
Choose .
-
In the Find Data dialog, click .
-
In the Find Data: Add Search dialog, choose one of the following options:
- Search for hex data
- Search for ASCII data
-
Type the string that you want to find.
-
Use the color wheel or the spin boxes to select a color to highlight the search criteria.
-
Click .
-
Click to close the Find Data dialog.
3.7. To Remove Search Criteria
To remove search criteria, perform the following steps:
- Choose .
- In the Find Data dialog, select the search criteria that you want to remove.
- Click .
- Click 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:
-
Choose .
-
In the Find & Replace Data dialog, choose one of the following options:
- Replace hex data
- Replace ASCII data
-
In the first text box, type the string that you want to find.
-
In the second text box, type the string that you want to use to replace the string that you find.
-
Click .
-
Click to replace the current occurrence of the string or click to replace all occurrences of the string.
-
Click 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 .
To remove a view of the current file, choose . 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 , 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 . Choose a directory and specify a filename for the HTML file, then click . 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.
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 .
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:
-
Choose .
-
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 button.
GHex updates the values of the other fields to display the data conversions.
-
Click 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 .
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.
4. Preferences
To configure GHex, choose . The Preferences dialog contains the following tabbed sections:
4.1. Editing
- Maximum number of undo levels
-
Use this spin box to specify the maximum number of edits that you can undo.
- Show cursor offset in statusbar as
-
Use this drop-down list to select the format in which the cursor offset is displayed. The format can be decimal, hexadecimal, or a custom print style string that only contains the format specifiers x, o, and s.
- Show offsets column
-
Select this option to display the cursor offsets in a column to the left of the hexadecimal view of the GHex window.
4.2. Display
- Font
-
Use the font selector list boxes to edit the existing font information or type new font information. Specify a font type, style, and size to display the contents of files in GHex.
- Default Group Type
-
Select one of the following options to specify how GHex displays the hexadecimal content of a file in the GHex window:
- Bytes - single bytes
- Words - groups of two bytes
- Longwords - groups of four bytes
4.3. Printing
- Data font
-
Click on the button to specify the font type, style, and size to use to print the data contained in a file.
- Header font
-
Click on the button to specify the font type, style, and size to use to print the header information that is contained in the file.
- Print shaded box over
-
Use this spin box to specify the number of lines that GHex alternately prints with a surrounding shaded box. If the value of the spin box is 10, GHex prints the first 10 lines of the file without a shaded box, the next 10 lines with a shaded box, and so on. If the value of the spin box is 0, GHex does not print any shaded box.


