用法

3.1. 编辑文件

要编辑文件,请执行以下步骤:

  1. 单击文件的十六进制或 ASCII 视图。光标处于活动状态的视图会显示完整的光标。光标处于不活动状态的视图会显示光标的轮廓。

  2. 使用以下任意方法可以在文件中移动光标:

    • 使用窗口上的滚动条或键盘上的箭头键卷动浏览该文件。
    • 选择"编辑" ▸ "转到字节",以十进制或十六进制值的形式键入光标偏移量,然后单击"确定"。十六进制值的格式必须是 0x 后面跟着偏移量,例如 0x3。
  3. 按照与编辑普通文本文件相同的方式编辑 ASCII 格式。使用 0 到 9 和 a 到 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 ― 编辑 tabbed section of the Preferences dialog.

3.2. 保存文件

您可以通过以下方式保存文件:

  • 要保存对当前文件的更改,请选择"文件" ▸ "保存"
  • 要以新文件名保存当前文件,请选择"文件" ▸ "另存为"。在"选择将缓冲保存为的文件"对话框中输入该文件的名称,然后单击"确定"

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. 在文件中查找数据

要在文件中搜索十六进制或 ASCII 字符串,请执行以下步骤:

  1. 选择"编辑" ▸ "查找"

  2. "查找数据"对话框中,选择以下选项之一:

    • Search for hex data
    • Search for ASCII data
  3. 键入要查找的字符串。

  4. 单击"查找下一个"以查找下一个出现的该字符串。

  5. 单击"查找上一个"以查找前一个出现的该字符串。

  6. 点击 Cancel 按钮关闭 Find Data 对话框。

3.5. 要执行高级查找

要执行高级查找,请执行以下步骤:

  1. 选择编辑 ▸ 高级查找
  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. 单击"查找下一个"以查找下一个出现的该字符串。
  4. 单击"查找上一个"以查找前一个出现的该字符串。
  5. 点击 关闭 关闭 查找数据 对话框。

3.6. To Add Search Criteria

To add search criteria, perform the following steps:

  1. 选择编辑 ▸ 高级查找

  2. 查找数据对话框中,点击 添加新数据

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

    • Search for hex data
    • Search for ASCII data
  4. 键入要查找的字符串。

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

  6. 单击“添加”

  7. 点击 Cancel 按钮关闭 Find Data 对话框。

3.7. To Remove Search Criteria

To remove search criteria, perform the following steps:

  1. 选择编辑 ▸ 高级查找
  2. In the Find Data dialog, select the search criteria that you want to remove.
  3. 单击“移除选中项”
  4. 点击 Cancel 按钮关闭 Find Data 对话框。

3.8. 在文件中查找和替换数据

要在文件中搜索十六进制或 ASCII 字符串并替换该字符串,请执行以下步骤:

  1. 选择"编辑" ▸ "替换"

  2. "查找并替换数据"对话框中,选择以下选项之一:

    • Replace hex data
    • Replace ASCII data
  3. 在第一个文本框中,键入要查找的字符串。

  4. 在第二个文本框中,键入用于替换所查找字符串的字符串。

  5. 单击"查找下一个"

  6. 单击"替换"会替换当前找到的字符串,或单击"全部替换"来替换找到的所有字符串。

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

3.9. 添加或删除文件的附加视图

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

要删除当前文件的视图,请选择"视图" ▸ "删除视图"。 如果您删除了最后一个打开的视图,应用程序将会退出。

3.10. 要更改数据组类型

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:

  • 字节 - 单个字节
  • - 两个字节的组。
  • 长字 - 四个字节的组。

3.11. 将 GHex 显示导出为 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. 查看字符表

要查看包含值 0 到 255 的 ASCII、十六进制、十进制、八进制和二进制表示的表,请选择"窗口" ▸ "字符表"

3.13. 查看数据转换

要显示二进制、十进制、十六进制和 ASCII 转换(最多四个字节的数据),可执行以下步骤:

  1. 选择"窗口" ▸ "基本转换器"

  2. 执行以下一种操作:

    • "基本转换器"对话框的其中一个字段中键入要转换的数据,然后按下回车键。
    • 要在当前文件的光标位置处显示该数据的转换值,请单击"获取光标值"按钮。

    GHex 会更新其它字段的值,以显示数据转换的结果。

  3. 点击 关闭 关闭 进制转换 对话框。

3.14. 要显示或隐藏类型转换对话框

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

类型转换对话框包含如下选项:

Show little endian decoding

选择此选项显示小端解码。

Show unsigned and float as hexadecimal

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

3.15. 打印文件

要打印文件,请选择"文件" ▸ "打印"。在"打印"对话框中选择所需的打印选项,然后单击"确定"

要预览文件的打印副本,请选择"文件" ▸ "打印预览"