]>

# The KHexEdit Handbook

Espen
Sand

    espensa@online.no

19/09/1999
0.08.04

This handbook describes KHexEdit version 0.8.4 - It is not yet complete

KDE
KHexEdit

## Introduction

The KDE binary file editor is a versatile editor. The goal is to make it the best and most usable editor of this kind available. Target audience is mostly (but not limited to) developers that occasionally need to examine and perhaps modify files which are unreadable by common editors.

### Features

Here are a few.

- Highly configurable document view.

- Displays documents in four modes. Hexadecimal, octal, binary and text only.

- Search and replace dialogs.

- Character table with insert capability.x

- Goto dialog and bookmark functionality.

- Pretty printing with headers and footers (in postscript).

- HTML export.

- Undo/Redo operation is supported.

- Insert and overwrite mode operation. A document can be resized.

- Copy and paste of both ASCII and binary data.

- Multiple documents can be open simultaneously.

- All functions are accessible trough keyboard and mouse.

- Support for non ASCII encoded files, eg. EBCDIC encoded files.

- Supports drag and drop of documents from kfm.

- Supports drag and drop of an open file from one editor to another.

- Session management. Remembers state from one session to the next.

### Changes

#### 0.8.4

- New feature: Statistics dialog. At the moment it displays character count and percent.

- New feature: A small selection size dialog. Displays the selection size in bytes (decimal and hexadecimal)

- New feature: Step to next or previous open file in document list with Alt-RightArrow or Alt-LeftArrow

- New feature: "index.html" will point to the generated toc page in HTML export directory (optional - selected from the export dialog box)

- New feature: A grid can be drawn in the editor.

- New feature: More colors in the editor. Even and odd lines can have different colors.

- New feature: The Stringlist dialog will show a message when the data int the editor has been changed.

- Change: HTML navigator shows "Generated by khexedit" instead of Made by khexedit"

- Change: "General preferences" dialog box renamed to "Customize"

- Change: "New layout in the "Colors" page of the "Customize" dialog box.

- Bugfix (Qt-2 version): Search/replace wrap confirmation is now disabled as chosen in the preference dialog box.

- Bugfix (Qt-2 version): Redrawing error that appeared if horizontal scrollbar was visible and scrollbar was moved to right.

#### 0.8.3

- New feature: Hex/Oct/Bin/Dec/ASCII chart with insert capability

- New feature: Export as HTML (tables, colors, toc page.) WYSIWYG with a few exceptions.

- New feature: Export dialog improved.

- No more use of getopt&lowbar;long() because this function does not exist in all (supported) OS.

- Backported from Qt 2.x to Qt 1.4x version

  - Extended "Preference dialog box".

  - Remember cursor position from one session to the next.

  - Clear "Recent" list on demand or on exit.

- Qt 2.x version only

  - New feature: DnD (XDND) of selected editor data (binary or text)

  - String Extractor uses fixed font again.

  - Bugfix: Quite a number of compiler warnings (with --pedantic) removed by Dirk A. Mueller

  - Bugfix: Used the name "export" various places. Not clever since it is a C++ keyword. Stephan Kulow told me this.

  - Bugfix: Correct redrawing (and faster) when marked text is unmarked.

  - Bugfix: Avoiding keypress error sounds when Alt/Control/Enter etc is pressed in editor area.

#### 0.8.2

- Qt 2.x based version ready and available in KDE cvs

  - Improved (faster) redrawing.

  - Borders in hex editor window (as in QMultiLineEdit)

  - DND the active file to other Qt 2 based programs (eg kwrite)

  - Remembers cursor position from one session to the next.

  - Clear "Recent" list on demand or on exit.

  - New page in "Preference dialog box"

- Bugfix: Segmentation fault when dropping a drag FROM khexedit or kruiser (using XDND protocol) on a remote application solved.

- Bugfix: Some missing keyboard accelerators fixed.

- BugFix: Faulty (missing) session management in Print Dialog fixed.

- Bit swap widget will now ignore Escape to allow the key event to close the dialog when focus is on the bit swap widget.

- The Escape key will now abort the internal drag operation (WARNING: Bug in Qt 2.0 causes a seg. fault if you do this, but works in Qt 1.4x and Qt > 2.0 )

- Some small changes in layout management in various dialogs.

- String dialog now contains an improved list which makes it possible to sort strings either alphabetically or on increasing offsets. Idea and some code: Dima Rogozin dima@mercury.co.il

#### 0.8.1

- Bugfix: Command line file arguments was read but not used.

- Bugfix: Incorrect redrawing of cursor if horizontal scrollbar was visible and the scrollbar was moved to the right.

- The "Conversion Field" can now be displayed in its own window outside the editor window (floating display).

- The "Binary" entry in "Conversion Field" can now display a window of bit values (window size 1-16 bits). Eg, if the cursor is located on bit 2 and the window size is 8, 3 bits (LSB) of the first byte is displayed and 5 bits (MSB) of the next. Hence the bit view is not constrained to the byte boundary. Craig Graham, c&lowbar;graham@hinge.mistral.co.uk

- Binary Filter: (new methods)

  1. Bit swapping (eg, swap bit 0 and 5) Leon Lessing, leon@lrlabs.com

  2. Bit reversal (eg, 00000011 transforms to 11000000)

  3. Bit rotation (eg, 00001011 can be rotated to 01100001)

  4. Bit shift (eg, 00001011 can be shifted to 00000001)

- Command line option: "-offset <value>", moves the cursor in the displayed document on startup. <value> can be hexadecimal or decimal.

- Extended documentation.

#### 0.8.0

First public release so there are no changes.

## Installation

### How to obtain KHexEdit

Latest version of KHexEdit can always be downloaded from its home page http://home.sol.no/~espensa/khexedit or from the KDE main FTP server at ftp://ftp.kde.org/pub/kde or one of its mirrors. Until KDE 2.0 is ready this package will be compatible with KDE-1.1.x as well as the a KDE 2.0 based version.

KHexEdit is also a part of the KDE projects cvs distribution. This version is based on the Troll Tech's Qt-2.0 widget set.

### Requirements

The current version has been developed using Qt-1.44 and KDE 1.1.1. There should neither be a problem using it with Qt-1.42 and KDE 1.1 nor any other KDE 1.1.x version.

All required KDE libraries as well as KHexEdit itself can be found on ftp://ftp.kde.org/pub/kde

### Compilation and Installation

Compiling KHexEdit is very easy. The following should do it:

    &percnt; ./configure
    &percnt; make
    &percnt; make install

If you run into problems please report them to the the author Espen Sand or to the KDE mailing lists (Take a look at http://lists.kde.org/. Your question might already be answered).

Normally you must be root (have administrator privileges) to successfully do the `"make install"` step.

Note that you can specify a number of options to "configure". A common option is `"--prefix"`. Using this option you can specify where your KDE base directory is. Common arguments to this option is `"/opt/kde"` or `"/usr/local/kde"`. `"configure --help"` lists all available options.

## Onscreen Fundamentals

The figure below shows khexedit in a fairly default setup. As can be seen the editor area is divided into three components. The name of the area below the editor area and above the status bar is called the Conversion Field. This area displays, using various representation, the data value at the cursor position.

1. The offset area is placed in leftmost area of the editor. The offset values can be displayed as hexadecimal or decimal numbers. This area can be hidden if required.

2. The primary view is placed a the center of the editor. It can display data using hexadecimal, octal, binary or text representations. This area can never be hidden.

3. The secondary view or Text field is placed in the rightmost area of the editor. It can only display a text representation of the data.This area can be hidden if required.

4. The Conversion area shows the data value at the cursor position using a number of representations. The Show little endian decoding toggles the displayed data between big and little endian format. Little endian format is used on Intel CPU based computers.

### Data representation and screen layout

The primary view can display data using one out of four available mode: Hexadecimal, Octal, Binary and Text Only. If the latter is selected the secondary view is automatically hidden.

The secondary view will always display a "Text only" replica of what is displayed in the primary view. This field can be hidden if selected from the `View` menu ("Show text field"). Since not every character code can be displayed as a printable character, the text view takes care of transforming the code into a symbol that can be displayed. The non-printable character codes are shown as a red dot in the editor image). The character code can its color can be selected in the Customize dialog box.

### Progress indicator and management

The left section of the status bar contains a progress indicator. This indicator is used to inform the user what is taking place for certain operations. It displays the kind of operation by printing a text string in the bar (eg, `reading...`) and a progress value.

Any operation that uses the indicator can be interrupted by the user. This is done by one of the following operations:

- Pressing (any mouse button) on the progress bar.

- Clicking on the "`Cancel Operation`" toolbar button.

- Selecting the "`Cancel Operation`" entry in the `File` menu.

The user will then be prompted to confirm the cancellation.

### Drag and Drop

KHexEdit supports Drag and Drop. This means that you can drag and drop files from the Desktop or kfm or some remote site that you have open in one of kfm's windows on to KHexEdit.

If you have multiple KHexEdit windows open you can drag the active document from one window to the other. Start the drag by clicking on the leftmost icon in the toolbar with the left mouse button.

### Command line arguments

KHexEdit recognizes a few command line arguments. The arguments must be arranged as described below: as follows:

`khexedit <options> <files>`

-offset <value>

  Moves the cursor in the active document to `offset`. The offset value can be decimal or hexadecimal. A hexadecimal value is recognized by the `0x` sign in front (eg, `0x100`). The `0x` sign is not required if the string contains the hexadecimal characters a..f,A..F.

<files>

  This can be one or more files. You can use wildcards if that is supported the the shell interpreter you use. A file can be specified with the "`http://FQDN/path`", "`ftp://FQDN/path`" or "`file:/path`". The latter refers to a local file and one can simply use "`path`" instead. `FQDN` is shorthand for "Fully Qualified Domain Name".

### Editing files on the Internet

You can open and save files on the Internet. Try the the following at the command line prompt to see an example of this.

`&percnt; khexedit http://www.kde.org/logotp3.gif`

(note: this web page contents might change so the specification can be outdated)

### Document list

The `Documents` entry in the menubar stores a list of open documents. The displayed document is defined as the active document. A document becomes active when it has been picked from the document list. There is no limit on how many documents there can be in the list. The first 9 documents can be accessed with the keyboard shortcut `<Ctrl>+<Number>` making it easy to switch between active documents.

### Copy and paste

KHexEdit can copy data as pure binary data or as formatted text. The formatted text is stored as seen on screen. Binary data is sent to the clipboard as a MIME message using base64 encoding. KHexEdit can decode this kind of message making it possible to copy and paste data between KHexEdit editor windows or documents. Note that if you paste the MIME encoded clipboard data into an external editor (such as kwrite or Emacs) you will see the MIME message and not the binary data. It might be better to copy as text in this case.

A copy operation can take place either automatically each time a selection has been made or delayed until the user decides to do so (Ctrl-C from the keyboard or from the Edit pulldown menu). The latter mode has the advantage to avoid unnecessary copy operations which can take time on large selections. This behavior is an option and can be selected in the option dialog box.

### Key bindings

KHexEdit honors the following key bindings.

Control-Space

  Toggle the cursor between primary and secondary data area

Insert

  Toggle between Insert and Overwrite mode

Left Arrow

  Move the cursor one character leftwards

Right Arrow

  Move the cursor one character rightwards

Up Arrow

  Move the cursor one line upwards

Down Arrow

  Move the cursor one line downwards

Page Up

  Move the cursor one page upwards

Page Down

  Move the cursor one page downwards

Backspace

  Delete the character to the left of the cursor

Home

  Move the cursor to the beginning of the line

End

  Move the cursor to the end of the line

Control-End

  Move the cursor to the end of the document

Control-Home

  Move the cursor to the start of the document

Control-Left Arrow

  Move the cursor to the previous character (eg, previous bit)

Control-Right Arrow

  Move the cursor to the next character (eg, next bit)

Delete

  Delete the character to the right of the cursor

Shift-Left Arrow

  Mark text one character leftwards

Shift-Right Arrow

  Mark text one character rightwards

Shift-Up Arrow

  Mark text one line downwards

Shift-Down Arrow

  Mark text one line upwards

Shift-End

  Mark text to end of line

Shift-Home

  Mark text to start of line

Shift-Page Up

  Mark text one page up

Shift-Page Down

  Mark text one page down

Shift-Control-End

  Mark text to end of document

Shift-Control-Home

  Mark text to start start of document

Control-N

  Create a new empty unnamed document

Control-O

  Open the file manager

Control-I

  Open the file manager for inserting a file

Control-S

  Save active document

Control-A

  Rename active document

Control-W

  Close active document

Control-P

  Print active document

Control-Q

  Terminate KHexEdit

Control-Z

  Undo edit operation

Control-Y

  Redo edit operation

Control-C

  Copy selected data to clipboard

Control-V

  Paste clipboard contents to active document

Control-X

  Delete the marked text, copy to clipboard

Control-G

  Go to a given offset

Control-F

  Find

F3

  Find again

Control-R

  Find and replace

Control-Insert

  Insert data

Control-B

  Add a bookmark

Control-E

  Replace a bookmark

Control-U

  Remove a bookmark

Alternate-<0-9>

  Goto a bookmark

Control-<0-9>

  Raise document

Alternate-<Left Arrow>

  Raise previous document

Alternate-<Right Arrow>

  Raise next document

F1

  Activate help

## Tools

### Goto offset

### Find

### Find and replace

### Insert Pattern

### String extractor

### Binary filter

### Character table

### Select indicator

### Statistics

### Bookmarks

## Document encoding

## Printing

### Destination

### Options

### Page layout

## Export

The export dialog box enables KHexEdit to save the formatted data to disk. The formatted data is saved as it is shown on screen. If Octal mode is used in the Primary View when data is exported, then the saved data use Octal representation for that part of the view as well.

The export range can be chosen to be:

- The entire document.

- The current selection. The dialog is modeless, so the selection can be changed while the dialog is open.

- A range. The range is specified as a start and stop offset. A value can be specified as a decimal value (example: `100`) or hexadecimal (example: `0x100`).

### Formats

At the moment the export facility can create pure text or a HTML description of the exported data. Note that the print dialog can save Postscript to disk as well.

#### Text

The text format is quite simple. The output is grouped as the the data in the editor. Other than this no more formatting is done. The data is written to one large file.

#### HTML

The HTML export of a formatted document is very close to a WYSIWYG output The only exception to the model is the grid lines (if displayed) which is not exported. In addition, the HTML document is decorated by navigation information to simplify browsing. The latter can be removed (option) if required.

The HTML format is more complex than the text output. Data is fitted into a nested HTML tables. To reduce the loading time time in a browser, the number of rows in a table is an option. The default value is 80 lines.

There is one table per file. The exported data is arranged on disk as follows

    <DIR>/<TABLE>00000000.html
    <DIR>/<TABLE>00000001.html
    <DIR>/<TABLE>00000002.html
    .....
    <DIR>/<TABLE>NNNNNNNN.html
    <DIR>/index.html -> <TABLE>00000000.html

Where the `DIR` is the destination directory selected on the `Destination` page of the dialog, while `TABLE` is a prefix to the file numbers. By default the string is "`table`. The first file contains no table data but instead a list of links to the other files. It is a table of contents file. If selected, an "`index.html`" file is created as a symbolic to the first file.

A list of all available option is given below.

Lines per table

  The number of lines (rows) in each table.

Filename prefix

  Each table file as well as the table of contents file is start with this name. Can be empty.

Header above text

  Selects the kind of header text (if any) to show above the table. The choices are "None", "Filename", "Filename with path" or "page number".

Footer below text

  Selects the kind of footer text (if any) to show below the table. The choices are "None", "Filename", "Filename with path" or "page number".

Link "index.html" to table of contents file

  If selected, create a symbolic link named "`index.html`" to the table of contents file. This simplifies browsing later.

Include navigator bar

  Add links to the next and previous tables as well as the table of contents file above and below the table itself.

Use back and white only

  Save the document using black and white regardless of what colors are used in the editor.

## Customize

The "Customize" dialog box allows the user to tune the KHexEdit behavior. The most likely to be used customize controls have been placed in the `View` menu while the rest are located in the "Customize" dialog box. The options in the `View` menu are described in another section.

The dialog consist of six pages. A page is activated by selecting the corresponding entry in the list in the left area of the dialog box. Settings that have been chosen will only become valid after the "`OK`" or "`Apply`" buttons have been pressed. Only the settings managed by the active page are then changed. The factory default settings are restored by using "`Default`" button. Note: You must activate "`OK`" or "`Apply`" after "`Default`" to actually use the default values. Pressing "`Cancel`" will close the dialog box without updating the the settings.

### Layout

This page contains layout options for the editor window.

Default line size

  The number of bytes that are displayed in a horizontal line in the editor. Both the primary and secondary view (if visible) will display this number of bytes. The value is automatically used when a mode is selected from the `View` menu.

Column size

  The number of bytes that are grouped together in the primary view. Normal values are 1, 2 and 4. In "text only" mode, this value is always the same as the line size.

Both Default line size and Column size can use different values for all four view modes. The values are assigned to the mode displayed by the selector above the entries.

Line size is fixed

  When this option is disabled, the editor will automatically resize the displayed data so that no horizontal scrollbar is required (except for a very narrow editor). This combined with a maximized window (and possible a small font) enables KHexEdit to display large amounts of data.

Lock column at end of line

  When this option is enabled, a column of data will always be displayed as a whole. When disabled (this option will only have effect when the Column size is larger than 1 and Line size is fixed is disabled) a part of the column will be displayed at the end of the line once there is space to display it, while the rest of the column is moved to the next line.

Gridlines between text

  This options allows vertical or horizontal lines or both to be displayed between the text. The vertical lines will only be displayed in the Primary View. If the Primary View is set to "Text only" mode, the vertical lines will be hidden even there.

Left separator width

  Sets the width of the vertical separator between the offset area and the primary view.

Right separator width

  Sets the width of the vertical separator between the primary and secondary view.

Separator margin width

  Sets the width between the nearest character and the separator edge.

Edge margin width

  Sets the width between the nearest character and the edge of the editor window.

Column separation is equal to one character

  When selected each column is separated by the width a single character would have used. If not, the value in Column separation is used.

Column separation

  See above.

### Cursor

The cursor setting is only valid for the editor area. It does not control how the cursor behaves or looks like in dialogs etc.

Blinking

  If Do not blink is selected, then the cursor will not blink in the editor, otherwise it will blink with the rate assigned in the Blink interval field.

Shape

  The Always use block option will when selected, make the cursor always use a rectangular block shape, both in insert and overwrite modes. If the Use thick cursor in insert mode option is selected, then the insert shape cursor will be thicker (and more visible) than what is normally is. The option has no effect if the Always use block option is selected.

Cursor behavior when editor looses focus

  Controls how the cursor is displayed when the user moves the mouse to another window.

  Stop blinking. Stop blinking but remain visible.

  Hide. Make the cursor invisible.

  Do nothing. Ignore focus changes.

### Colors

The editor area of KHexEdit can be tuned to use almost any color combination available. It possible to select between to main color modes. Either a personal selection or a strict usage of the system colors as selected in the Control Center. There are one exception to this scheme. The standard selection color (foreground and background) will always be used. It can not be chosen individually.

Use system colors

  Sets the main color mode. If selected, the system colors will be used. Otherwise the colors as defined by the dialog selection.

First, third ... line background

  The background color of odd lines in the primary and secondary views of the editor.

Second, forth ... line background

  The background color of even lines in the primary and secondary views of the editor.

Offset background

  The background color of the offset area.

Inactive background

  The background (workspace) color used when there is no document active in the editor.

Even column text

  Text color for even numbered columns (0, 2, 4 etc.) in the primary view area.

Odd column text

  Text color for odd numbered columns (1, 3, 5 etc.) in the primary view area.

Non printable text

  Text color for text that can not be printed on screen. This color is only used on specific characters in the secondary view or in the primary view when the editor is in "Text only" state.

Offset text

  Text color for data (offset values) in the offset area.

Secondary text

  Text color for printable characters in the secondary view area. Note: If the editor is in "Text Only" mode, then the primary view will display text data. The secondary view is then hidden, thus the value of the Odd column text is used for printable text.

Marked background

  Background color for data that has been marked. You can not mark data directly (then it is selected data), but indirectly when searching for a pattern etc.

Marked text

  Text color for marked data.

Cursor background

  The cursor color itself.

Cursor text

  Color used to print the character when the cursor shape covers the actual character in the editor as is the case for a block shaped cursor.

Separator

  Color for the separators that form the borders between offset area, primary view and secondary view. Note: It is possible to hide the separators. See Layout options.

Grid lines

  Color for the vertical and horizontal lines that form the grid.

### Font

The editor area of KHexEdit uses a fixed font to display data. The font and its size face can be chosen to match personal preference.

Use system font

  If selected, the system fixed font, size and face will be used. Otherwise the personal font as defined by the dialog selection.

Font selector

  In this frame the personal font with its properties such as size is selected. Only fixed fonts are available from the `Typeface` selector.

Map non printable characters to

  This entry allows the user to select what character to be used to display non printable characters. Note that the color of this character can be selected as well. See Color options.

### Files

This page manages some options for file management.

Open documents on startup.

  This option allows one or more documents to be opened automatically when KHexEdit is started. One can choose between:

  - None. Do not open any file on startup.

  - Most recent file. Open the most recent file of the previous session.

  - All recent files. Open all recent files of the previous session.

  Note that files specified by command line arguments are not affected by this option.
Jump to previous cursor position on startup

  When selected, the cursor position is saved on exit and restored when a file is automatically opened (by the option above).

Open document with write protection enabled

  When this option is selected, every document that is opened will have the write protect property enabled by default.

Keep cursor position after reloading document

  When a document is reloaded the cursor will remain at the same offset if this option is selected. Otherwise the cursor will be reset to the beginning of the document.

Make a backup when saving document

  Every time a document is saved the original document is preserved if this option is selected. The original filename is appended by a "`˜`" (standard emacs behavior).

Don't save "Recent" document list on exit

  Each time KHexEdit is terminated, the list of the five most recent opened files is written to disk. If this option is selected, then an empty list is written to disk instead. Note that no file can be automatically opened on startup if this option is enabled.

Clear "Recent" document list now

  By activating this button, the list of recent files is removed. The "`Open Recent`" menu in the "`File`" menu will be emptied by this option. However, note that every open document will remain open. The document list (see Document list) is not altered.

### Miscellaneous

Various settings that does not belong to the previous pages.

Undo history

  The number of edit operation it is possible to revert in the editor. The potential memory usage increases with the selected value. Note that each open document have its own undo queue.

Make sound on data input failure

  When this option is selected, the computer will make a sound if a character input is refused. Example: Pressing '`A`' in the Primary View when in Binary mode, or when no input is allowed (read only document).

Make sound on fatal failure

  When this option is selected, the computer will make a sound if a fatal failure occurs. Example: Memory could not be allocated as a result of an edit operation.

Automatic copy to clipboard when selection is ready

  With this option enabled, selected data is automatically copied to the clipboard whenever a select operation is completed. Otherwise is must be done manually from the `Edit`Menu or by keyboard shortcuts.

Editor starts in "insert" mode

  If this option is selected, KHexEdit will start in insert mode by default. Once a document is opened, any new data will be inserted in to file enlarging the file size. Note that the Insert and Overwrite mode can easily toggled by the `Insert` key at any time while KHexEdit is running.

Confirm wrapping during search

  During a search or replace operation a notification will be displayed if the end (or beginning) of the document is reached. The user will have to confirm that the operation should continue at the other end of the document is this option is selected.

Cursor jumps to nearest byte when moved

  When this option is enabled, any cursor movement will result in that the cursor is moved (snapped) to the beginning of a byte, simplifying movement in the document. If disabled, the cursor will move to the closest character. Note: Control-Left Arrow and Control-Right Arrow will act as if the setting is disabled.

Confirm when number of printed pages will exceed limit

  When a document is printed, the number of pages is computed before anything is printed. If this option is selected and the number of pages exceeds the `Threshold` a confirmation dialog box is displayed to warn about a potential large number paper copies.

## Menu entries

### File

New Document

  Creates a new empty document named `"Untitled n"`, where `"n"` is a number used to identify this document in case there are more than one untitled documents open.

Open

  Opens the document the user has chosen from a file dialog box. If a document is already open, then this document gets hidden (but not closed) and the new is displayed.

Insert

  Opens the document the user has chosen from a file dialog box and inserts it into the current document (if any) starting from the cursor position.

Open Recent

  This submenu stores the five most recent used documents. This list is remembered from one session to the next.

Reload

  Reloads the current displayed document. A warning message becomes visible if the document contains unsaved changes.

Save

  Writes the document data to disk. If the document is untitled, then the user must specify a valid name. If backup creation has been enabled (see Customize) the original file on disk will be renamed first.

Save as

  Renames the current document name and writes data to disk. The original file on disk is left untouched.

Close Document

  Closes active document. If it contains unsaved changes, the user will be prompted to save data first.

Print Document

  Opens the print dialog box.

Export

  Opens the export dialog box. This dialog allows the user to export the data as shown in the editor. At the moment data can be exported as formatted text and as HTML tables.

Cancel Operation

  Stops a lengthy operation (eg., printing). The operation is not stopped immediately. The user has to confirm the action in a dialog box first.

Permissions

  This submenu contains options (Read only and Allow resize) that sets the read-write state of the document and the ability to resize a document.

New Window

  Opens a new editor window.

Close Window

  Closes this editor window. If there is only one window open, then KHexEdit is terminated.

Quit

  Closes KHexEdit. The user will be prompted to save unsaved documents first.

### Edit

Undo

  Undo an editor operation.

Redo

  Redo an editor operation.

Copy

  Copies a selection to the clipboard. The copied data is a MIME encapsulated message of the binary data.

Paste

  Pastes the contents of the clipboard into the document at the cursor location. If the contents is recognized as a MIME message made by KHexEdit itself, then this message will be decoded. Otherwise the data is written directly into the editor.

Cut

  Deletes a selected area. The selection is copied to the clipboard first as a MIME encapsulated message (see above).

Special

  This submenu contains copy and paste options. Copy as text (primary field) copies the current selection as formatted text to the clipboard. Only the data of the primary field is copied. Copy as text (all fields) copies the current selection, as well as the associated data in the offset column to the clipboard. Paste into new file pastes the clipboard contents to a new file while Paste into new window pastes the clipboard contents to a new file in a new window.

Select All

  Selects the entire document.

Unselect

  Removes a selection if present.

Goto Offset

  Opens the "Goto Offset" dialog box.

Find

  Opens the "Find" dialog box.

Find Again

  Locates the next match for the pattern defined in the "Find" dialog box. If no pattern has been defined, the user is prompted with a warning dialog box.

Find and Replace

  Opens the "Find and Replace" dialog box.

Insert Pattern

  Opens the "Insert Pattern" dialog box.

### View

Hexadecimal, Octal, Binary, Text only

  Sets the formatting for the displayed data in the primary field. If Text only is selected then text field (rightmost field) will be hidden.

Show offset column

  Toggles the offset column visibility on and off.

Show text field

  Toggles the text field (rightmost field) visibility on and off. The text field can not be made visible when Text only formatting (see above) is selected.

Offset as decimal

  Toggles the offset column representation between hexadecimal and decimal format.

Upper case (data)

  Toggles the hexadecimal data to be displayed with upper or lower case characters. This mode will only have effect when Hexadecimal formatting (see above) is selected.

Upper case (offset)

  Toggles the hexadecimal offset values to be displayed with upper or lower case characters. This mode will only have effect when the offset column displays offset data with hexadecimal values.

Document Encoding

  This submenu contains encoding options. Default use the standard encoding (no decoding at all), US-ASCII assumes document data uses 7-bit ASCII, while EBCDIC assumes EBCDIC encoded document. User Defined allows the user to define a encoding.

### Tools

Extract Strings

  Opens the "Extract Strings" dialog box.

Record Viewer

  Opens the "Record Viewer" dialog box.

Binary Filter

  Opens the "Binary Filter" dialog box.

Character Table

  Opens the "Character Table" dialog box.

Select Indicator

  Opens the "Select Indicator" dialog box.

Statistics

  Opens the "Statistics" dialog box.

### Bookmarks

Add Bookmark

  Adds a bookmark using the offset of the cursor.

Replace Bookmark

  Replaces a current bookmark with a new one.

Remove Bookmark

  Removes a bookmark.

Remove All

  Removes all bookmarks of the current document. The user must confirm the operation.

### Documents

This menu contains the list of all open documents in the editor. Once an entry is activated in the menu, the corresponding document will be displayed in the editor.

### Options

Customize

  Opens the Customize dialog box.

Favorites

  Opens the "Favorites" dialog box.

Show Toolbar

  Toggles the visibility of statusbar.

Conversion Field

  This submenu contains entries for displaying the Conversion Field. Hide hides the field, Show In Own Window moves the field into a free standing window, while Show In Editor Window displays the field at the bottom of the editor window. The latter is the default setting.

Show Statusbar

  Toggles the visibility of the statusbar.

Save configuration

  Saves the current configuration as selected in the Customize dialog box and the current layout to disk. This is also done automatically when the KHexEdit terminates.

### Help

Contents

  Opens the index of the help text you read now.

About khexedit

  Opens a dialog box which displays contact information, e-mail and home page addresses as well as contributors and the software license.

About KDE

  Some information about the KDE project.

## Questions, Answers, and Tips

### Will this program compile with Qt-2.0?

Yes, but you have to use the Qt-2 version of this program. Go to the homepage http://home.sol.no/~espensa/khexedit and follow the instructions.

### Printing to disk using postscript takes ages to complete!

This is especially true on systems where you print to a disk or directory that is mounted with NFS. It seems that the printing code of the Qt-library does many small file operations (queries) while printing. This is not good when disk access is slow which it can be with NFS. Try to print to a directory that is not mounted with NFS. `/tmp` can be a candidate.

### Exported HTML is sometimes hard to inspect in a browser.

It is difficult to make a format that every browser (new and old) on the planet accept. Generally, with the format that is produced now, make sure you adjust the browser width to match the table width.