HexWorks Manual
HexWorks Manual
General Information
............................................................................................................................................................................
Product Overview ............................................................................................................................................................................... 1 License Agreement ............................................................................................................................................................................ 6 How to Contact the BreakPoint Software ................................................................................................................................. 7 Comments and Suggestions .......................................................................................................................................................... 8 Technical Support and Questions ................................................................................................................................................ 9 Lost Registration Keys ................................................................................................................................................................... 10
.......................................................................................................................... How to Register ................................................................................................................................................................................ Upgrade and Maintenance Policy ............................................................................................................................................ Product Activation Wizard ........................................................................................................................................................... Layout and Editing ........................................................................................................................................................................... Hex Workshop Layout ................................................................................................................................................................... Editor Window ................................................................................................................................................................................... General Hex Editing ....................................................................................................................................................................... Toolbars ............................................................................................................................................................................................... Status Bar ........................................................................................................................................................................................... Output Results Window ................................................................................................................................................................ Drive (Sector) Editing .................................................................................................................................................................... Tools and Features .......................................................................................................................................................................... Bookmarks .......................................................................................................................................................................................... Bookmark Overview .................................................................................................................................................................. Adding a Bookmark ................................................................................................................................................................... Editing a Bookmark ................................................................................................................................................................... Opening and Saving Bookmarks ........................................................................................................................................... Bookmark Properties ................................................................................................................................................................ Color Highlighting Overview ....................................................................................................................................................... Character Distributions .................................................................................................................................................................. Checksum Generator ..................................................................................................................................................................... Color Mapping ...................................................................................................................................................................................
11 11 12 13 15 15 18 21 22 25 27 28 29 29 29 31 32 35 36 37 38 40 43 Color Mapping Overview .......................................................................................................................................................... 43 Adding a Color Map ................................................................................................................................................................... 44 Editing Color Maps .................................................................................................................................................................... 46 Opening and Saving Color Maps ........................................................................................................................................... 49 Compare .............................................................................................................................................................................................. 50 Compare Tool .............................................................................................................................................................................. 50 Compare Tool: Simple Compare ............................................................................................................................................ 51 Compare Tool: Resynchronizing Compare .......................................................................................................................... 52 Advanced Compare Options ................................................................................................................................................... 53 Data Inspector ................................................................................................................................................................................... 54 Data Visualizer .................................................................................................................................................................................. 55 Expression Calc ............................................................................................................................................................................... 58 Data Operations ............................................................................................................................................................................... 60 Export and Clipboard Formats ................................................................................................................................................... 64 Find ........................................................................................................................................................................................................ 67 Find Utility .................................................................................................................................................................................... 67 Find Results Window ................................................................................................................................................................ 69 Replace Utility ............................................................................................................................................................................. 71 Find Strings ................................................................................................................................................................................. 72 Goto Utility .......................................................................................................................................................................................... 73
75 77 79 80 81 Structure Definition Overview ................................................................................................................................................. 81 Data Types ............................................................................................................................................................................. 84 Enumerated Types ................................................................................................................................................................. 87 Arrays ..................................................................................................................................................................................... 89 Strings .................................................................................................................................................................................... 90 Bitfields .................................................................................................................................................................................. 91 Expressions ........................................................................................................................................................................... 92 Conditionals ........................................................................................................................................................................... 93 Functions ............................................................................................................................................................................... 95 Verification .............................................................................................................................................................................. 96 Library Settings ...................................................................................................................................................................... 98 Structure Settings ............................................................................................................................................................... 101 Reserved Words and Symbols ............................................................................................................................................ 103 User Tools ........................................................................................................................................................................................ 104 Expressions ........................................................................................................................................................................................ 105 Expressions Overview ................................................................................................................................................................ 105 Arithmetic Operations ................................................................................................................................................................. 106 Bitwise Operations ....................................................................................................................................................................... 107 Logical Operations ....................................................................................................................................................................... 108 Arithmetic Functions ................................................................................................................................................................... 109 Document Functions .................................................................................................................................................................... 110 Conditionals and Loops .............................................................................................................................................................. 112 Variables ........................................................................................................................................................................................... 114 Expression Data Types ............................................................................................................................................................... 116 Operator Precedence .................................................................................................................................................................. 117 Preferences ......................................................................................................................................................................................... 118 Display Options .............................................................................................................................................................................. 118 General Display Options Preferences ................................................................................................................................ 118 Font & Filter Display Options Preferences ....................................................................................................................... 120 Color Settings Display Options Preferences .................................................................................................................... 121 Color Priority Display Options Preferences ...................................................................................................................... 124 Precision Display Options Preferences ............................................................................................................................. 125 Theme Display Option Preferences ................................................................................................................................... 126 Character Filter Editor ........................................................................................................................................................... 128 Configuration .................................................................................................................................................................................. 130 General Configuration Preferences .................................................................................................................................... 130 Paths Configuration Preferences ........................................................................................................................................ 132 Advanced Configuration Preferences ................................................................................................................................ 134 Page Setup ............................................................................................................................................................................... 136 Keyboard Shortcuts ................................................................................................................................................................ 137 Tool Options .................................................................................................................................................................................... 140 Bookmarks Tool Options Preferences ............................................................................................................................... 140 Char Distributions Tool Options Preferences ................................................................................................................... 141 Color Maps Tool Options Preferences ............................................................................................................................... 142 Compare Tool Options Preferences ................................................................................................................................... 143 Find Tool Options Preferences ............................................................................................................................................ 145 Structure Viewer Tool Options Preferences ...................................................................................................................... 146
Structure Viewer Overview ...................................................................................................................................................... Adding a Structure ..................................................................................................................................................................... Removing a Structure ............................................................................................................................................................... Structure Libraries ..................................................................................................................................................................... Structure Definitions ..................................................................................................................................................................
147 148 149 150 151 152 153 Mini Applications ............................................................................................................................................................................. 154 Base Converter ............................................................................................................................................................................. 154 Hex Calculator ............................................................................................................................................................................... 155 Reference ............................................................................................................................................................................................. 156 Command Line Usage ................................................................................................................................................................ 156 Data Types ...................................................................................................................................................................................... 158 Understanding Byte Ordering .................................................................................................................................................. 159
C Source Import/Export Preferences ................................................................................................................................. HTML Import/Export Preferences ....................................................................................................................................... Intel Hex Code Import/Export Preferences ....................................................................................................................... Java Source Import/Export Preferences ........................................................................................................................... Motorola S-Records Import/Export Preferences ............................................................................................................. RTF Import/Export Preferences .......................................................................................................................................... Text Import/Export Preferences ...........................................................................................................................................
Product Overview
Product Overview
The Hex Workshop Hex Editor by BreakPoint Software is a complete set of hexadecimal development tools for Microsoft Windows 2000 and later. Hex Workshop integrates advanced binary editing and data interpretation and visualization with the ease and flexibility of a modern word processor. With the Hex Workshop, you can edit, cut, copy, paste, insert, fill and delete binary data. You can also work with data in its native structure and data types using our integrated structure viewer and smart bookmarks. Data editing is quick and easy with our extensive features that allow you to: jump to file or sector location, find or replace data, perform arithmetic, bitwise, and logical operations, binary compare files, generate checksums and digests, view character distributions and export data to RTF or HTML for publishing. Hex Workshop includes a Sector Editor with disk imaging tools, a Base Converter for converting between hex, decimal and binary data types, a Hex Calculator supporting arithmetic and bitwise operations, an expression calculator supporting variables, conditionals, iteration and arithmetic and bitwise operations, and a data visualizer designed to help you visually identify patterns and interesting data from rendered images. Also included is our Data Inspector that allows you to quickly edit and view data in decimal, floating point or time and date representations. The Hex Workshop Hex Editor v6.6 or lower is available at a retail price of $89.95 (with volume and academic discounts and site licenses available). For more information, visit the Hex Workshop web site at http://www.hexworkshop.com or send e-mail inquiries to [email protected].
Key Features:
Rich Feature Set Highly Customizable User Interface Data Interpretation, Visualization and Parsing Integrated Binary Comparison
Technical Specifications
Software Requirements:
Microsoft Windows 2000 or later
1 / 159
Product Overview
Hardware Requirements:
1 GHz x86 processor 512 MB of system memory 35 MB of available disk space
Find
Search using Hex Strings (including wildcards) Search using Text Strings (ASCII, Unicode or either; match or ignore case) Search using Bitmasks Search using 8 bit, 16 bit, 32 bit or 64 bit signed/unsigned values (Big Endian, Little Endian or either) Search using floating point values (Big Endian, Little Endian or either) Search using double precision floating point values (Big Endian, Little Endian or either) Find All instances or instance by instance Search from top down or bottom up Find all strings within a document (ASCII, Uncode or Either) Find next or previous matching selection Find next or previous not matching selection Find across entire document, selection, or manually entered range Apply bookmarks or structures based on Find Results
Replace
Find and replace by Hex Strings, Text, Strings or values Pad text strings with nulls if the replacement string is shorter than the original string
2 / 159
Product Overview
Goto
Jump to specified address Jump to address relative to start of document Jump to address relative from end of document Jump to selected address Jump to current offset + selected address Jump to current offset - selected address Jump to last goto + selected address Jump to last goto - selected address Repeat last jump (relative from current offset) Jump backwards (relative from current offset)
Printing
Print and Print Preview Header and footer are highly customizable Page Setup allows configuration of: font, header, footer, margins and bytes per line
Bookmarks
View and edit data rendered as natural data type (byte, word, half float, double, string, Unicode string, time_t, time64_t, structure reference, etc.) Integrated with Structure Viewer Array support (add multiple bookmarks with single definition) Calculations supported for address, length, and count (array) definitions: +, -, *, /, %, &, |, ^, <<, >> Functions supported for address, length, and count (array) definitions: UByteAt(), UShortAt(), ULongAt(), UQuadAt, byteflip16(), byteflip32(), and byteflip64() Constants supported for address, length, and count (array) definitions: last (bookmark), start (first bookmark), arrayindex, filelength
Structure Viewer
View and edit data in its natural structure and form File format resembles C/C++ style structure definition Embedded, nested and reference other structures in your definitions Many atomic data types supported: char, wchar, byte, ubyte, word, uword, long, ulong, longlong, half float, float, double, OLE Date/Time, DOSTIME, DOSDATE, FILETIME, time_t, and time64_t Conditional structure elements (if and switch) Big Endian or Little Endian rendering Add floating structures that re-renders on caret position changes Add locked structures which stick to a document and offset Verify expected byte sequences in a document against the structure definition's expected values Integrated Functions enable automatic file format parsing and data manipulation
Compare
Use either a Simple or Resynchronizing binary compare Resynchronizing Compare color codes the differences Ability to specify Resync Window (how far to look for insert/delete) and match bytes (how many bytes must match) for resynchronizing compares Set starting comparison offset independently for source and target files Set comparison length independently for source and target files
3 / 159
Product Overview
Data Visualizer
Includes 3 palettes and the ability to use user-defined palettes (Microsoft .PAL file format) Zoom visualizer width and height independently Automatic scaling to match editor view Displays editor selection Allows selection of data within the editor
Import/Export
Import and Export 8, 16 or 32 bit Intel Hex Code Import and Export Motorola S19, S28 or S37 records Export document data as HTML Export document data as RTF Export document data as C source Export document data as Java source Export document data as Text Export document data as a Hex string Export document data as UUEncoding Export document data as Base64 Export Structure Views, Compare Results, Find Results, Bookmark Views, Checksum Results, and Character Distributions as Tabbed Text, CSV, RTF, XML, and HTML.
Data Operations
Modify your data in-place using embedded operations Operations can be applied to a selection or an entire document Operations include: set floor value, set ceiling value, lower case, upper case, swap case, byte flip, block shift, ~, <<, >>, ~, |, &, +/-, +, -, *, /, %
Data Inspector
Interpret data at current caret position and edit that data as a more user-friendly sensible data type Big Endian or Little Endian byte ordering View and edit 8 bit signed/unsigned values View and edit 16 bit signed/unsigned values View and edit 32 bit signed/unsigned values View and edit 64 bit signed/unsigned values View and edit half float (16 bit), floats (32 bit) and double precision floats (64 bit) View and edit DATE, DOS Date, DOS Time, FILETIME, time_t, and time64_t values View and edit binary representations
Expression Calc
Arithmetic operations: +, -, *, /, %, () Logical operations: ==, !=, ||, &&, <, <=, >, >= Bitwise operations: &, |, ^, <<, >>, ~ Arithmetic functions: min, max, byteflip16, byteflip32, byteflip64 Document functions: get/set caret position and selection, add structure, get document size, getValueAt,
4 / 159
Product Overview
Plug-in API
C/C++ Plug-in API Allow data manipulation of active document Create new documents Generate checksums and digests Create and manipulate smart bookmarks Manipulate caret position and selection Progress and user-cancel support Integration with output window for logging Ability to auto-exec plug-ins on document open
Base Converter
Convert 8 bit, 16 bit, and 32 bit values between hex, decimal and binary
Hex Calculator
Hex/Decimal calculator supporting: +,-,*,/,|,&,^,<<,>>, ~ Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
5 / 159
License Agreement
License Agreement
Hex Workshop Copyright 1995-2011, BreakPoint Software, Inc. All Rights Reserved.
License Agreement
You should carefully read the following terms and conditions before using this software.
DISCLAIMER
Users of Hex Workshop must accept this disclaimer of warranty: "Hex Workshop is supplied as is. BreakPoint Software, Inc. disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The author assumes no liability for damages, direct or consequential, which may result from the use of Hex Workshop."
DISTRIBUTION
The registered version of Hex Workshop cannot be distributed without the expressed written permission of BreakPoint Software, Inc. You may copy and distribute the unmodified demonstration version of this software in electronic form. You are prohibited from charging for or distributing this software with other products (commercial or otherwise) without the expressed permission of BreakPoint Software, Inc.
INTELLECTUAL PROPERTY
This program is owned by BreakPoint Software, Inc. and is protected by U.S. and international copyright laws. Violation of this copyright is a serious offense VIOLATION OF COPYRIGHT IS A SERIOUS OFFENSE.
DEMONSTRATION VERSION
You have the non-exclusive right to use Hex Workshop for 30 days for the purpose of evaluation. After the 30 days trail period, you must purchase the registered version, or discontinue using the product by removing it completely from your computer.
NO DISASSEMBLY OR DECRYPTION
You may not disassemble, decompile or decrypt the Software without the expressed permission of BreakPoint Software, Inc.
USER LICENSE
You may either use this program on 1) a single computer with multiple users or 2) multiple computers with the same single user. This program is the property of BreakPoint Software, Inc., and is protected by U.S. and international copyright laws. VIOLATION OF THIS COPYRIGHT IS A SERIOUS OFFENSE, PUNISHABLE BY THE UNITED STATES GOVERNMENT. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
6 / 159
7 / 159
8 / 159
9 / 159
10 / 159
How to Register
How to Register
Hex Workshop can be purchased for $89.95* or upgraded for $34.95* and includes 12 months of maintenance. To order, please visit: http://www.hexworkshop.com/ordering/ After ordering, customers receive an registration key by e-mail. The registration key is used to unlock Hex Workshop and disable the evaluation period.
11 / 159
12 / 159
Select the first radio button, "Download your Hex Workshop License over the Internet", to automatically download a license file. Select the second radio button, "Select a Hex Workshop License from the File System", to select a predownloaded license file.
Customers must enter their name, e-mail address, and registration key to download their license file. If the customer purchased a single license, the e-mail address must match the e-mail address used when ordering. If the customer purchased multiple licenses, the e-mail address domain must match the e-mail address used when ordering. In this example, the domain is "example.com". By default, the Activation Wizard will use the http/https proxy settings configured for Internet Explorer. If you require a proxy server and Internet Explorer is not configured, please press the "Proxy Settings..." button to manually provision your http/https proxy server. Proxy Settings Dialog:
13 / 159
The manual download process allows customers to select a license file from their file system. This may be required due to firewalls and/or corporate IT policies. To obtain your license file from our web site, please visit: http://www.hexworkshop.com/support Please visit our web site for common problems or e-mail [email protected] for assistance. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
14 / 159
All window (except Editor Window) can be hidden/shown or moved around the editor. The tool component windows (Structure Viewer, Results Window, and Data Inspector) can be pinned to a Hex Workshop edge to the maximize viewing size of other windows. Pinned Window enlarge when the mouse cursor is placed over them. Right clicking on the Data Visualizer, Data Inspector, Expression Calc, Structure Viewer, or Results Window includes the ability to pin, hide/show, or dock the components within the Editor:
15 / 159
Tool Bar
The Tool bar includes buttons for commonly used features and operations. It is organized as 8 separate Tool bars that can be reordered, show/hidden, floated outside the editor or docked on the edges of Hex Workshop. See Toolbars for more information.
Data Visualizer
The Data Visualizer helps identify patterns with document data. See Data Visualizer for additional information.
Editor Window
The Editor allows users to edit files or sectors in Hex Workshop. See Editor Window for information on the Editor Window.
Data Inspector
The Data Inspector allows users to quickly view and edit editor data as an atomic data type. By default, the Keyboard Shortcut Ctrl+I will show and hide the Data Inspector. See the Data Inspector for more information.
Expression Calc
The Expression Calc allow users to perform C style operations and document manipulation. See Expression Calc for additional information.
Structure Viewer
The Structure Viewer allows users to apply C-Style structure definitions in the editor and view and edit data in its natural structured form. By default, the Keyboard Shortcut Ctrl+T will show and hide the Structure Viewer. See the Structure Viewer for more information.
Results Window
The Results Window includes tabs for various Hex Workshop tools and operations: By default, the Keyboard Shortcut Ctrl+W will show and hide the Results Window.
Compare Results
Displays the results of a Re-synchronizing compare operation. See Compare Tool: Resynchronizing Compare for more information.
Checksum Results
Displays the results of a checksum/digest operations. See Checksum Generator for more information.
16 / 159
Displays the results of a Find Strings operation or a Search with the "Find All Instances" option selected. See Find Strings or Find/Replace for more information.
Bookmarks
Display user-created smart bookmarks. See Bookmarks for more information.
Output
Display Hex Workshop diagnostic information, errors, and warnings. The output window is mostly commonly used when creating structure definitions to view errors. For more information, please see the Output Results Window.
Status Bar
The Status Bar displays context sensitive information for the current document and progress information. See Status Bar for more information. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
17 / 159
Editor Window
Editor Window
The Hex Workshop Editing Window includes 4 areas: 1. 2. 3. 4. Offset Header Offset Area Hex Area Text Area
Offset Header
The Offset Header shows the address offset of each of the columns for the Hex Area and Text Area. When combined with the address from the Offset Area, users can quickly identify the address of a specific byte of data.
18 / 159
Editor Window
NOTE: Settings are only applied for the current document. See General Display Options Preferences to set the default used when opening new files.
NOTE: Settings are only applied for the current document. See General Display Options Preferences to set the default used when opening new files.
NOTE: Settings are only applied for the current document. See General Display Options Preferences to set the default used when opening new files.
Offset Area
The Offset Area displays the offset for the current row in the editor. Right clicking on the offset area displays a popup context menu.
19 / 159
Editor Window
Users can adjust the offset/address width by dragging the separator between the Offset Area and Hex Area or by selecting "Address Width" from the Offset Area right-click context menu.
Hex Area
The Hex Area displays the users data in a tabular form where users can adjust the bytes per row and group byte by width. Users can switch between the Hex and Text areas by clicking on each area or by pressing the Tab key. For more information on editing files, please see General Hex Editing.
Text Area
The Text area displays the text associate with the user's data. The text may be displayed using a character filter, unfiltered, or in Unicode. Users can switch between the Hex and Text areas by clicking on each area or by pressing the Tab key. For more information on editing files, please see General Hex Editing.
Caret Forms
Hex Workshop displays carets in the Hex Area and the Text area simultaneously. The Vertical Caret in the form of an "I" is the Active Caret. The horizontal caret in the form of an "_" is the Inactive Caret. The Inactive Caret is shown to help correlate the editing position between the Hex Area and Text Area and does not impact editing. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
20 / 159
Hex/ASCII Editing:
A file can be edited from either the Hex Area or Text Area. The cursor can be toggled between hex and ASCII with the tab key or hex/ASCII can be chosen by clicking the mouse in the particular region. You can tell what area you are editing by looking at the caret shape. A vertical blinking caret (I) is displayed in the active area and a solid underline caret (_) is displayed in the inactive area. You can use the arrow keys to navigate around the document in either the hex or ASCII display. You will notice that the left and right arrow keys will move one byte (2 hex digits) at a time in the hex display. Pressing the Ctrl+Left or Ctrl+Right will allow you to navigate within bytes (1 hex digit at a time).
Clipboard Functionality:
Cut (Ctrl+X), Copy (Ctrl+C), and Paste (Ctrl+V) operate in a similar manner to other editors. Paste Special allows you choose from and paste any of the standard Windows Clipboard formats currently available into a file.
Inserting/Filling
Automated Inserting and Fill (Ctrl+Ins) allows a specified number of bytes to be inserted at the cursor position with any hex fill value. If data is selected in the editor, Hex Workshop will fill the selection region with the specified hex fill value.
Deleting Data
Deleting (Del) simply deletes the highlighted bytes.
Insert/Overwrite Mode
Normal editing can be done in either insert or overwrite (OVR) mode. Insert mode with automatically insert hex values entered at the cursor position, while overwrite mode will overwrite existing bytes at the cursor position with hex values entered. The current mode is shown in the status bar and is toggled with the Insert key or by double clicking the "OVR" in the status bar.
Insert File
The contents of a file can be inserted into the document at the caret location by selecting "Insert File" from the "File" menu.
File/Disk Properties:
File/Disk Properties (Alt+Enter or Right Mouse Button) displays information on the current file or disk being edited.
Window Operations:
Open windows can be tiled Horizontally (F2), Vertically (Alt+F2), or Cascaded (Ctrl+F2) from the Window Menu or using keycuts. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
21 / 159
Toolbars
Toolbars
Toolbar buttons
File Operations: Edit Operations:
From left to right: Open File Open Drive or Sector Save File or Sector Print current document Open Preferences Dialog
From left to right: Cut Copy Paste Paste Special Undo Redo
Find/Goto:
Environment Settings:
Find Find Previous Find Next Replace Goto Address Quick Goto Edit Bar Goto Previous Goto Next
Show addresses in decimal Show addresses in Hexadecimal Assume Big Endian byte ordering Assume Little Endian byte ordering
Tools:
Character Filter:
Switch the character filter used to filter characters in the text area of the editor
Data Operations drop-down Compare Files Jump to next comparison Jump to previous comparison Launch Checksum and Digest Calculator Add Bookmark Add Color map Add Structure View Character Distribution Launch Base Converter Launch Calculator
Drive Operations:
22 / 159
Toolbars
Data Operations:
Byte Flip Inverse Bits Shift Left Shfit Right Rotate Left Rotate Right Block Shift Left Block Shift Right XOR OR AND Change Sign Add Subtract Multiple Divide MOD Set Floor Value Set Ceiling Value Make upper case Make lower case Swap case See Data Operations for more information.
Showing/Hiding toolbars
Hex Workshop's toolbars can be shown and removed by selecting "Toolbars..." from the options menu or by rightclicking on any toolbar. Users can also drag toolbars to reorganize the toobar layout.
23 / 159
Toolbars
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
24 / 159
Status Bar
Status Bar
The Status Bar displays context sensitive information and status for the active document. It is divided into seven panes (from left to right): 1. 2. 3. 4. 5. 6. 7. Status Information Cursor Location Caret Location File Size or Selection Length Insert/Overwrite Mode (OVR) Document Modification Status (MOD) Read-Only/Write Status (READ)
Status Information
The first status bar pane displays information for the current operation (or menu item). This area also display feedback to the user during editing and in some cases displays a progress bar for length operations.
Cursor Location
The second status bar pane displays the current mouse location in either hex or decimal depending on the hex/decimal environment setting. The mouse location is where the user's mouse cursor is located and updated on mouse movement. The hex/decimal setting can be changed using the Environment Toolbar, by selecting "File Offset" from the "Options" menu, or by right-clicking on the address area within the editor. Double-clicking the cursor location places the address on the clipboard.
Caret Location
The third status bar pane displays the current caret location in either hex or decimal depending on the hex/decimal environment setting. The caret location is where the edit cursor is located within the active document and is updated when the user clicks within the hex or text areas within the editor, uses the keyboard arrow keys to move the caret, or performs and operation that changes the caret location. The hex/decimal setting can be changed using the Environment Toolbar, by selecting "File Offset" from the "Options" menu, or by right-clicking on the address area within the editor. Double-clicking the caret location places the address on the clipboard.
25 / 159
Status Bar
If a file is opened using Direct File Editing (See Advanced Configuration Preferences), a "DIR" is displayed to indicate Direct File Editing Mode. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
26 / 159
Ouput Level
The output level can be adjusted by selecting a new level in the drop-down box ("Info" is selected in the above example). Users must select a new output level prior to performing an operation to view more information. Output Levels include Debug, Info, Warn, and Error.
Clear Results
The Red "X" button clears the Output Results Window. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
27 / 159
In addition to editing files, Hex Workshop can also edit Drive (Disk) Sectors. By selecting "Open Drive" from under the Disk menu, clicking the open drive Toolbar button, or using the Ctrl+D keycut both Logical and Physical Drives can be edited under Windows 95, 98, NT, Windows 2000, XP, and Vista. NOTE: You must run Hex Workshop under Administrator Mode to sector edit under Vista. This can be accomplished by right-clicking on the launch shortcut and selecting "Run as administrator".
Sector Editing:
Disk Editing information is supplied to the user including sector number currently being edited and total number of sectors on the disk in the title bar, and sector size, cursor position (within the sector), and hex data interpretation in the status bar. The toolbar contains buttons to increment or decrement the current sector. Drive Editing is accomplished in the same manner as file editing, with a few exceptions. Since the sector size is fixed, data cannot be inserted or deleted, only overwritten. The Goto utility becomes a Goto Sector Utility allowing movement forward or backward in sectors from the beginning, end, or current sector of the drive/disk. The Find Utility now operates on a range of sectors specified in the Find dialog, and Replace is disabled for sector editing. Because of the slightly different nature of Drive Editing additional keycuts are available to help quickly move throughout the sectors of a disk. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
28 / 159
Bookmark Overview
Viewing Bookmarks
Bookmarks are displayed within the "Bookmarks" tab of the Results Window. The example below demonstrates a set test bookmarks. Whenever document focus changes, the bookmark results window will repopulate with the bookmarks for the active document.
Bookmark Selection
Selecting a bookmark does four things within the editor. 1. It applies any highlight coloring to the editor window. 2. Starts in-place editing if clicked on the description column or the value column. In-place editing is only enabled for values if the bookmark was defined with an editable value type (as opposed to a "blob"). 3. If the bookmark references a structure definition, that structure is added to the structure viewer. Likewise, when bookmark selection changes, the bookmark structure is removed from the structure viewer. 4. Last, the bookmark selection preference is applied. Scroll Data Into View Set Caret Position in Editor Select Data In Editor Scrolls the bookmark data into view, but does not move or adjust the caret position. Scrolls the bookmark data into view and moves the caret position to the start of the bookmark. Scrolls the bookmark data into view and sets the editor selection to match the bookmark data.
Bookmark Toolbar
Open a new bookmark collection
29 / 159
Bookmark Overview
For additional information, please view the following topics: Adding a Bookmark Editing a Bookmark Opening and Saving Bookmarks Bookmark Properties Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
30 / 159
Adding a Bookmark
Adding a Bookmark
Bookmarks are document specific. Therefore, when adding a bookmark, make sure that the destination document is active and in focus. If no documents are open, you will not be able to add a bookmark. Please see Editing a Bookmark for detailed instructions on the bookmark editor. As a convenience, the bookmark editor will initialize with the current caret offset position and selection. To take advantage of this feature, we recommended selecting the desired bookmark data within the editor before being the bookmark addition process. There are 4 methods for adding a new bookmark:
Keycut
The keyboard shortcut Ctrl+B is the default keystroke sequence that will add a new bookmark. These keystroke sequence can be remapped by selecting "Define Shortcuts" from the Options menu.
Tools Menu
Select "Bookmarks" from the "Tools" menu. This will display a popup menu in which you should select "Add Bookmark".
Document Window
Right click within the document view and select "Add Bookmark".
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
31 / 159
Editing a Bookmark
Editing a Bookmark
The Bookmark Editor show above is used to both add new and edit existing bookmarks. To edit a bookmark, select the bookmark in the bookmark results window and then either: 1. Select the Edit bookmark icon from the bookmark toolbar 2. Right click within the bookmark results window and select "Edit Bookmark" from the popup menu. 3. Select "Bookmarks" from the "Tools" menu and then select "Edit Bookmark" from the popup menu. Once the bookmark editor is displayed, specify your desired setting, and press the OK button. NOTE: If you edit a bookmark, you must Refresh the bookmark results window by pressing the Refresh button in the upper right corner of the bookmark results window.
Bookmark Attributes
Description Location Address Describes this bookmark. This is string identifies the bookmark entry in the bookmark results window. Identifies the starting address (offset) of the bookmark. The value can be entered in hex or decimal as designated by the Location Base drop down choice box. Additionally, there are a number of functions and operators available for use in this field. A list of functions and operators are listed in the section below. Identifies the length of the bookmark (in bytes). The value can be entered in hex or decimal as designated by the Location Base drop down choice box. Additionally, there are a number of functions and operators available for use in this field. A list of functions and operators are listed in the section below. Specifies the base for both the address and length fields. Data can be entered in either decimal or hexadecimal. Defines the count or repetition for this bookmark. The default value is 1, however, you can define a repetition (or array) of bookmarks. The location address and location length is used for the first bookmark, however, the Count Sequential Address and Count Fixed Length parameters define how addresses and lengths are calculated for subsequent bookmarks. Determines whether array bookmarks begin immediately after the end of the last array bookmark or if the location address is re-evaluated for each
Location Length
Location Base
Count
32 / 159
Editing a Bookmark
ULongAt(OFFSET)
UQuadAt(OFFSET)
33 / 159
Editing a Bookmark
arrayindex
filelength
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
34 / 159
Saving Bookmarks
1. Bring the document containing the bookmarks into focus 2. Press the Save Bookmark Collection toolbar button or Select "Bookmarks" from the "Tools" menu and choose "Save" or "Save As" from the popup menu. 3. Enter the bookmark filename if saving a new collection or using "Save As" to create a new bookmark file.
Autoloading Bookmarks
Hex Workshop will automatically load bookmarks if a file extension is defined in the bookmark properties or through the Bookmark preferences. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
35 / 159
Bookmark Properties
Bookmark Properties
The Bookmark Properties dialog is accessible by pressing the "Props" button while Adding/Editing Bookmarks or by selecting "Collection Properties" from the right-click context menu of the Bookmark Results Window.
File Extensions
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
36 / 159
Color Merging
Each color attributes is prioritized separately allowing users to view data with attributes from different highlights. For example, users can view data with the background color of one highlight, the foreground color of another highlight, and a border rectangle from a 3rd highlight. Priorities are defined by Color Priority Preferences in cases where multiple color highlights of the same attribute (e.g. two foreground colors) are available for data.
Popup Information
If the user hovers the mouse over a color highlighted area, Hex Workshop displays a popup window with information on the color highlighting. In the example below, the mouse cursor was placed just to the left of "Doc2.doc" in the Text area of the editor (4th line excluding header). The popup information tells the user that offset 0x00000001E is tagged by an applied structure and is the FileName attribute of that structure.
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
37 / 159
Character Distributions
Character Distributions
Users can generate Character Distributions by selecting "Character Distribution" from the "Tools" menu or by pressing the Character Distribution button from the Tools Toolbar.
Organization
The Character Distribution includes 3 windows or components: 1. Character Distribution Histogram 2. Character Distribution List 3. Character Distribution Bitmap The Histogram and Bitmap components can be disabled in Character Distribution Preferences.
Clicking on the graph selects that character in the Character Distribution List and populates the Character Distribution Bitmap for that character.
38 / 159
Character Distributions
Exporting Data
Users can export the character distribution table by selecting "Export" from the "File" menu. Character Distributions can be exported as Tabbed Text (.txt) or Comma Separated Values (.csv). Users can also export the Histogram by right clicking on the Histogram and selecting "Export Dialog..." Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
39 / 159
Checksum Generator
Users can select the desired algorithms and configure CRC parameters for Custom CRCs prior to pressing the "Generate" button to calculate the checksums and digests. All calculations are performed on the active document with Hex Workshop.
40 / 159
Checksum Generator
MD2 (128 bit) MD4 (128 bit) MD5 (128 bit) SHA-1 (160 bit) SHA-2 (224 bit) SHA-2 (256 bit) SHA-2 (384 bit) SHA-2 (512 bit) RIPEMD (128 bit) RIPEMD (160 bit) RIPEMD (256 bit) RIPEMD (320 bit) Tiger (192 bit) Whirlpool (512 bit)
16 16 16 20 28 32 48 64 16 20 32 40 24 64
Checksums are displayed in both decimal and hex while digests are only displayed in hex.
1s and 2s Complement
Users can display checksum values as calculated or in 1s or 2s complement. Select the complement drop down ("None" is selected in the above example) to switch between as calculated ("None"), 1s compliment or 2s complement. Digests are not displayed in 1s and 2s complement.
41 / 159
Checksum Generator
Users can copy a checksum or digest result by selecting the checksum/digest and pressing Ctrl+C or by right-clicking on the checksum/digest and selecting "Copy" from the popup context menu. The data is placed on the clipboard in both binary and text formats. This allows the user to paste the value into Hex Workshop or into another application as text. When pasting into a Hex Workshop document, position the editing caret in either the hex display (left side) or text display (right side) to paste the data as binary or text, respectively.
Clearing Results
The checksum results control is cleared by pressing the "X" button in the upper-right of the Checksum Tab. Alternatively, right click anywhere within the Checksum tab and select "Clear All Results" from the popup context menu. Remove a single checksum/digest by right-clicking on the checksum/digest and selecting "Remove selected checksum" from the popup context menu.
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
42 / 159
43 / 159
There are 4 methods to add a new Color Mapping: 1. Toolbar: Select the Add Colormap toolbar button from the "Tools" menu 2. Keyboard Shortcut: The keyboard shortcut Ctrl+M is the default keystroke sequence that will add a new color mapping. This keystroke sequence can be remapped by selecting "Define Shortcuts" from the Options menu. 3. Menu: Select "Color Mapping" from the "Tools" menu and then choose "Add Mapping" from the popup menu. 4. Content Menu: Right click within the document view and select "Add Color Mapping".
44 / 159
45 / 159
Comments (#)
Users can add comment lines to the color map file by starting the line with a pound symbol (#). All data on that line is ignored. Warning: If you edit the color map through the editor, comments are lost when the file is saved. This includes both adding color maps via the user interface and the "Tools\Color Mapping\Edit Mappings..." menu selection.
!author
The author attribute declares who created the color map definition file. This information is not used within Hex Workshop and is used for decoration purposes. Format: !author="<AUTHOR>" Example: !author="BreakPoint Software, Inc."
!description
The description attribute declares who created the color map definition file. This information is not used within Hex Workshop and is used for decoration purposes. Format: !description="<DESCRIPTION>" Example: !description="Color mappings to highlight non-ASCII data"
Hex Sequences
Hex Sequences or strings define a search string within the editor. Strings are limited to 32 bytes of data (64 characters) and must be quoted. Format: "<HEX SEQUENCE>" = <Color Definition> Examples: "0000" = <Color Definition> "FF0000" = <Color Definition>
Character Ranges
46 / 159
Character Ranges define a range of characters that should match a color mapping. This is useful if one wants to highlight or de-emphasis ASCII characters or control characters. The range is specified as decimal numbers between 0 and 255. Format: charrange(<start>, <end>) = <Color Definition> Examples: charrange(0, 32) = <Color Definition> charrange(65, 122) = <Color Definition>
Color Definitions
Color maps can define foreground, background, and border rectangle colors for both the hex display and ASCII display within Hex Workshop. Colors are defined using a standard RGB tuple where each value represents a Red, Green, and Blue color component. The color components range from 0 to 255. For example, <RGB>(255, 0, 0) represents Red and <RGB>(128, 128, 128) represents grey. The foreground, background, and border rectangle colors are defined using the following keywords:
ASCII Area
asciiFgRGB asciiBgRGB asciiRectRGB
A single RGB keyword can be used if setting the same foreground or background color for both the hex area and ASCII area. Mixing RGB with individual color keywords may result in an error or unpredictable results. Also, a comment keyword allows users to add a description for individual color maps. This comment is displayed in the editor if the mouse cursor hovers over color mapped data. Format: <Hex Sequence> | <Character Range> = <Foreground>,<Background>,<Border>,<Comment>
<Foreground> = [ RGB(...) | [ hexFgRGB(...) ] [, asciiFgRGB(...)] ] <Background> = [ RGB(...) | [ hexBgRGB(...) ] [, asciiBgRGB(...)] ] <Border> = [ hexRectRGB(...)] [, asciiRectRGB(...)] <Comment> = comment("<COMMENT>")
Examples: 1. Display all instances of "AAAA" with a red foreground "AAAA" = RGB(255, 0, 0), comment("Red Foreground") 2. Display all instances of "BBBB" with a yellow background "BBBB" = hexBgRGB(255, 255, 0), asciiBgRGB(255, 255, 0) 3. Display all instances of "CCCC" with a red foreground, grey ASCII background and yellow hex background "CCCC" = RGB(255, 0, 0), hexBgRGB(255, 255, 0), asciiBgRGB(128, 128, 128) 4. Display all instances of "DDDD" with a yellow foreground and grey border rectangle. "DDDD" = RGB(255, 0, 0), asciiRectRGB(128, 128, 128), hexRectRGB(128, 128, 128)
47 / 159
############################################################################## # Hex Workshop Color Map Definition File (cmap) ## !author="BreakPoint Software, Inc." !description="Hex Workshop Help Example Colormaps" "AAAA" "BBBB" "CCCC" "DDDD" = = = = RGB(255, 0, 0), asciiBgRGB(255, RGB(255, 0, 0), RGB(255, 0, 0), comment("Red Foreground") 255, 0), hexBgRGB(255, 255, 0) asciiBgRGB(128, 128, 128), hexBgRGB(255, 255, 0) asciiRectRGB(128, 128, 128), hexRectRGB(128, 128, 128)
For additional information, please see: Color Mapping Overview Adding a Color Map Opening and Saving Color Maps Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
48 / 159
Keycut
You may also select a color map by using shortcut Ctrl+Shift+M. For additional information, please see: Color Mapping Overview Adding a Color Map Editing Color Maps
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
49 / 159
Compare Tool
Compare Tool
The Compare Tool (Ctrl+K ), located under the Tools menu, allows the you to compare binary files. For your convenience, the drop lists are filled with files open within Hex Workshop. Comparison Settings can be changed in Compare Tool Options Preferences or by pressing the advanced button for Advanced Compare Options. Users may select the their desired method of comparison: Simple Compare Resynchronizing Compare Note: All documents opened within Hex Workshop must be saved before the compare tool can analyze them. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
50 / 159
51 / 159
Hex Workshop will select the inserted, deleted, replaced, or matched data when you select a row in the table. You can also select Next Difference from the Tools:Compare menu or press F6 to jump to the next difference. Shift+F6 or Previous Difference from the Tools:Compare menu will jump to the previous difference.
Filtering:
A drop down box is provided in the upper right hand corner of the compare results window. This can be used to filter the comparison results. Selecting Matches, Insertions, Deletions, or Replacements will show only differences of the selected type.
Recompare:
If editing a document, the compare results may become out of synch and require a re-compare. Users can press the refresh button located in the upper right hand corner of the compare results window, select Recompare from the Tools:Compare menu or press Ctrl+R Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
52 / 159
The Advanced Compare Options dialog is displayed when a user presses the "Advanced" button in the Compare Tool. Use this dialog to adjust compare sensitivity, starting file offsets, and hide/show matching compares. Settings are maintained for the current compare and are not saved for future compares. Please adjust the Compare Preferences for more permanent default settings. The Recompare Command (Ctrl+R) will retain these preferences and is discussed with the Compare Tool.
Starting Offsets:
Users can specify the starting offset used for each file in the comparison. All data before the starting offset is ignored.
Starting Lengths:
Users can specify the length of each file in the comparison. All data after the starting offset + length is ignored.
Resync Window:
This is option is used to limit how far (in bytes) the compare tool will search for an insertion or deletion. A higher number may yield more accurate results, however, will take an exponentially longer time to execute. Lowering the number will speed up the comparison, but may result in more replacements instead of insertions and deletions. The default value is 2048 bytes.
Match Bytes:
This option is used to tell the compare tool how many bytes must be identical before a match is reported. The default value is 32 bytes. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
53 / 159
Data Inspector
Data Inspector
Hex Workshop includes a Data Inspector, which displays the caret data as decimal and binaries values. The Data Inspector interprets the hexadecimal data at the cursor position as a byte, unsigned byte, short, unsigned short, long, unsigned long, quad, unsigned quad, half float, float, double, MSDOS date, MSDOS time, FILETIME, time_t, time64_t and binary.
Editing Data
Within the Data Inspector you can modify the data at the cursor position by highlighting the data type/value you wish to change. Hex Workshop highlights the data within the editor using the Data Inspector Selection Highlight.
54 / 159
Data Visualizer
Default Palettes
Each Data Visualizer palette maps each byte of a document to a specific color.
Segmented
The segmented palette displays bands of colors based on the byte value of the data. The palette is organized by color bands to help visually separate control, ASCII, and extended ASCII characters.
Range
[ 0 .. 31] [ 32 .. 127 ] [ 127 .. 254 ] [ 255 ]
Color / Description
Grey scale; ASCII Control characters Green; ASCII characters Blue; Extended ASCII characters Black
Grey Scale
The grey scale palette maps each character to its grey scale RGB value. For example, <byte> becomes RGB(<byte>, <byte>, <byte>). All 0x00 values are rendered as black and all 0xFF values are rendered as white.
55 / 159
Data Visualizer
All 0x00 values are rendered as white and all 0xFF values are rendered as black.
Custom Palettes
Hex Workshop processes the standard Microsoft(tm) .pal file format (RIFF format with PAL information in the palette information in the DATA chunk). The palettes must contain exactly 256 colors. Hex Workshop will output error information in the Output Results Window if unable to parse a palette file. Users can create custom palettes using a graphic software package or by hand. Hex Workshop provides a palette structure viewer library (pal.hsl) to aid in palette design. By default, palette files should be placed in <Install Directory>\Palettes (e.g. C:\Program Files\BreakPoint Software\Hex Workshop v6.5\Palettes). Alternatively, users can change the default palette directory through the Paths Configuration Preferences. Hex Workshop must be restarted to load new palette files.
Position Brackets
The Data Visualizer draws thin brackets around the visualization bitmap to indicate where the editor data resides in the bitmap.
Manipulation
Zoom to Editor View
The Zoom to Editor View feature synchronizes the Data Visualizer view to match the column width and page width of the editor. When synchronizing with the editor view all of the scrolling and column width adjustment features are disabled. Zooming in or out automatically disables the Zoom to Editor View.
Zoom to Doc
The Zoom to Doc features zooms out to view as much of the document as possible. Zooming does not adjust row length (number of bytes displayed per row). To adjust the row length, see Increase Row Length, Decrease Row Length, or Set Row Length features.
56 / 159
Data Visualizer
Keyboard Shortcuts:
All keyboard shortcuts require that focus be set to the Data Visualizer by clicking within the Data Visualizer Window.
Key
Home End Page Up Page Down Up Arrow Down Arrow Left Arrow Right Arrow + Space F5
Description
Scroll to top of Visualizer View (not applicable when Zoomed to Editor View) Scroll to end of Visualizer View (not applicable when Zoomed to Editor View) Scroll up one page within Visualizer View (not applicable when Zoomed to Editor View) Scroll down one page within Visualizer View (not applicable when Zoomed to Editor View) Scroll up one line within Visualizer View (not applicable when Zoomed to Editor View) Scroll down one line within Visualizer View (not applicable when Zoomed to Editor View) Decrease Column width (not applicable when Zoomed to Editor View) Increase Column Width (not applicable when Zoomed to Editor View) Zoom In by shrinking Visualizer box height Zoom Out by increase Visualizer box height Match row width to editor width (not applicable when Zoomed to Editor View) Refresh the Data Visualizer by forcing a repaint
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
57 / 159
Expression Calc
Layout
Expression
The expression area allows users to enter compound expressions. The last expression (literal, calculation, variable, etc.) is displayed in the results area.
Results
Displays the results of the last expression. See Options below to set the byte ordering and base (hex or decimal).
Defining Expressions
Please see the Expressions topics for information on defining expressions.
Executing Expression
The expression is evaluated (or executed) when a user presses the "Eval" button or presses Ctrl+Enter within the editor window. The expression is also automatically evaluated when the user changes the Sign or Data Type using the drop down combo boxes on the Expression Calc.
Options
The following options can be set by right-clicking on the Expression Calc's title area or background area (not on the individual controls).
58 / 159
Expression Calc
Show Results As
Controls the displayed base (either hex or decimal) of the results. By default the Expression Calc displays the results based on the Toolbar's Environment Settings for offset base. Options include: Hex Decimal Match Toolbar Settings (default)
59 / 159
Data Operations
Data Operations
Hex Workshop supports integrated data operations within the hex editor. This allow users to perform arithmetic and logical operations on their data while interpreting their data as decimal or other values. You can invoke an operation by 1. Selecting the desired operation on the Data Operation drop down,
2. Selecting the option from the Operations Toolbar. As of Hex workshop v5.1, the operations toolbar is disabled by default in favor the Data Operations drop down menu described above.
To enable the operations toolbar, selection "Toolbars..." from the "Options" Menu and check "Data Operations" 3. Selection the operation under the Tools\Operations menu. The following operations are available: Byte Flip Flip the order of bytes. For example, 0xABCD would become 0xCDAB. This operation can be performed on 16, 32, and 64 bit data blocks. Inverse Bits Inverse the bits. For example 0xA0 (10100000) would become 0x5F (01011111). This operation can be performed on data blocks of any size. Shift Left Shift bits to the left by 1 bit. This operation can be performed on 8 bit, 16 bit, 32 bit, or 32 bit data blocks in either Big Endian or Little Endian Byte order. Shift Right Shift bits to the right by 1 bit. This operation can be performed on 8 bit, 16 bit, 32 bit, or 32 bit data blocks in either Big Endian or Little Endian Byte order.
60 / 159
Data Operations
61 / 159
Data Operations
Hex Workshop will prompt you when additional parameters are required. A sample dialog is shown below:
Byte Ordering:
Hex Workshop allows you to interpret data in either Little Endian (e.g. Intel) or Big Endian (e.g. Motorola) byte ordering. Please see Understanding Byte Ordering for more information on byte ordering in general.
Value:
Users can enter a decimal or hexadecimal operand for operations. You can toggle between hexadecimal and decimal by selecting the appropriate "Decimal" or "Hex" radio button.
Apply On:
Hex Workshop can apply the operation on either a selection or your entire document. The "Selection" radio button will be disabled if the dialog is invoked without a selection.
62 / 159
Data Operations
63 / 159
64 / 159
unsigned char rawData[64] = { 0x4D, 0x5A, 0xC6, 0x00, 0xB6, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, } ;
Java Source: /** * Generated by BreakPoint Software's Hex Workshop v3.10 * http://www.hexworkshop.com * * Source: hworks32.exe * Time: 5/2/2000 9:08 AM * Offset: 0 / 0x00000000 * Length: 64 / 0x00000040 */ char rawData[] = { 0x4D, 0x5A, 0xC6, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, } ; 0xB6, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
65 / 159
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
66 / 159
Find Utility
Criteria Tab
Users can search by Text String, Hex, Bitmasks, or numeric values by selecting the desired option in the "Type" drop down menu.
Searching by Hex
When searching by Hex, users can use a question mark as a wild card. For example, the search string "FF?D" would match on 0xFF0D, 0xFF1D, 0xFF2D, etc.
Searching by Bitmask
When searching by Bitmasks, Hex Workshop will compare the document bytes against the specified bitmask and mark whenever a match is found. For example, a bitmask of 80 will match 0x80 to 0xFF, but not 0x00 to 0x7F.
Searching by Value
Users can search by 8, 16, 32, and 64 bit signed and unsigned fixed point values, floats and doubles. Additionally, users can opt to search for values stored in little endian byte order, big endian byte order, or both.
Direction
The Direction option allows users to control the direction of searches. Up search from bottom to top and Down search from top to bottom where top is the lowest offset and bottom is the highest offset.
67 / 159
Find Utility
Users may also specify the range of a search. Options include searching the entire document, a selected region within the editor, or a manually entered document range. Hex Workshop will only wrap (i.e., restart searching at the start or end of the document) if "Entire File" is selected. By default, Hex Workshop will always search the entire document regardless of the editor selection for each search. Users can change the default behavior through the Find Tool Options Preferences.
Users searching disks or sectors may search the entire disk or enter a start and end sector. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
68 / 159
Example output from executing Find All Instances (including the right-click context menu):
Press the Delete key on the keyboard or right click and select "Remove Find Results" to remove the selected find results. This option supports multiple selections.
Exporting Contents
Users can copy the contents of the Find Results Window: address, length, and string (if using Find Strings) to the Clipboard by "Copy All" from the right-click context menu. An example of that output is included below:
69 / 159
70 / 159
Replace Utility
Replace Utility
The Replace Utility, located under the Edit menu, works in the same manner as the Find Utility.
The Replace Utility allows for different sized search and replace strings, and has a Replace All option. In addition, the Replace Utility offers an option to "Pad String with Nulls" when replacing ASCII. This is useful if you are replacing a string with a shorter string and with to leave the file size intact. The replace string will be padded with NULL chars until it is equal in size to the search string, before substituted. Hex Workshop is set up to notify the user upon wrapping around the file during a Find, Find Again, or Replace execution (See General Configuration Preferences). Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
71 / 159
Find Strings
Find Strings
Find Strings, located under the Tools menu, allows the user to find all of the text strings within a document or selection. While only strings containing ASCII characters are reported, Find Strings optionally locates ASCII strings stored as Unicode. Additionally, the user may restrict their search to only contain strings greater then a certain length or strings that end with a NULL character. See the Find Results Window for details on viewing and working with results.
Parameters
Min Characters:
Defines the minimum number of characters (not bytes) required to be considered a string. Users may specify between 3 and 128 characters. Strings are terminated at the first control character, carriage return, or line feed.
Apply On:
This operation can be performed on either the entire document or a selection within a document. This option is disabled (grayed) if no data was selected in the editor prior to starting the operation. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
72 / 159
Goto Utility
Goto Utility
Hex Workshop support multiple method of navigating around documents. Users can launch the Goto Utility using the Find/Goto Toolbar, right clicking on the Offset Area, or right clicking within the Editor Window. Alternatively, users can enter addresses directly into the Goto Address edit box on the Find/Goto Toolbar.
Goto Utility
The Goto Utility (Ctrl+G), located under the Edit menu, allows the user to logically move throughout the file. The Goto Utility can be used to move from the beginning of the file, the cursor position, or the end of the file. The number of bytes to move can be specified in either hex or decimal (with hex values always positive). When moving from the cursor position a negative decimal value may be entered to move backwards (This is the only time a negative value is allowed). In moving back from the end of the file, a positive number moves back into the file. There is a toolbar button which can be used as a shortcut for Goto. The Goto Again (F5) command, located under the Edit menu, is used to re-execute the last Goto command. If the previous Goto was from the current position, then another Goto is executed moving the same amount of bytes in the same direction, having the same effect as setting up and executing another identical Goto. If the previous Goto was from the beginning or end of file, then the dialog is brought up again with the previous values loaded. If there are no existing Goto parameters, the Goto Again brings up the original Goto Dialog. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
73 / 159
or
74 / 159
The Structure Viewer is docked on the bottom-left of Hex Workshop by default. You can hide and show the Structure Viewer window by using the keycut Ctrl+T or by selecting the "Show Structure Viewer Window" option from the "Options" menu. The Structure Viewer mimics the Window's Explorer by using "+" and "-" symbols to indicate nested data within the data view. You can expand or collapse nested data by pressing the "+" or "-" icons, by double clicking on an entry's Address/Name, or by pressing the right and left arrow keys. Additionally, the icons depict a closed lock or an open lock to represent locked and floating structures. In the example above, a locked structure is shown. For more information on locked and floating structures, please see Adding a Structure.
Toolbar Buttons
Open a Structure Library Close a Structure Library Add a structure from the selected structure library Remove the selected structure (must select root of structure) Execute a structure function
75 / 159
See also Adding a Structure, Removing a Structure, Defining a Structure and Basic Structure Data Types. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
76 / 159
Adding a Structure
Adding a Structure
Before adding a structure, you must select a Structure Library. If you do not have a Structure Library selected, do this now. For help on selecting a Structure Library, please see Structure Libraries.
The Add Structure dialog can be invoked either by using the keycut Ctrl+L, by right-clicking on the Context menu and selecting "Add Structure" from the Structure Viewer, by pressing the "+" button on the Structure Viewer Window, or by selecting "Add Structure" from the "Tools:Structure Viewer" menu. After you have selected a structure from the Structure Library located on the left of the dialog, select desired options, and then press OK button. Options are described below.
Floating Structure
A floating structure is not locked to a specific document or fixed to a specific address/offset. Moving your cursor around a document and changing the document focus will force a floating structure to recalculate and re-render all of it's data elements given the new document and/or offset. This is very useful when searching for structures within documents.
Locked document/offset
A locked structure is locked to a specific offset within document. The document will recalculate and re-render it's data elements whenever the structure is refreshed. Closing and reopening the root data element is one method of refreshing a structure. Locked structures are automatically removed when the document it is locked to is closed.
Document
If adding a locked structure, you must select a document to anchor the structure to. By default, Hex Workshop fills in the in-focus document.
Offset
If adding a locked structure, you must select an offset to anchor the structure to. By default, Hex Workshop fills in the cursor offset of the in-focus document.
Byte Order
If your structure contains integer or floating point values, then you may need to specify the byte order used to interpret the data values. You can select either Big Endian (Motorola) or Little Endian (Intel). The byte order control is disabled when a byte order is specified in the structure definition using a #pragma byteorder directive.
Validate Structures
The Validation Structures check box verifies any pre-conditions defined the structure declaration. The check box is disabled when adding a Floating Structure. For more information on structure validation, see Structure Definition Verification.
Validation Status
The validation status button displays the results of a structure's pre-condition check. The button is only enabled if "Validate Structures" is checked and the structure includes validation checks. See also Structure Viewer Overview, Removing a Structure, Defining a Structure and Basic Structure Data Types.
77 / 159
Adding a Structure
78 / 159
Removing a Structure
Removing a Structure
There are a four methods for removing a structure from the Structure Viewer. 1. Select the top (root) of the structure definition that you wish to remove from the Structure Viewer. Next, press the "Delete" key on your keyboard. 2. Right-click on the top (root) of the structure definition that you wish to remove from the Structure Viewer, and select "Remove Structure" from the popup context menu. 3. Select the top (root) of structure that you wish to remove from the Structure Viewer. Next, select "Structure Viewer" from "Tools" menu, and then select "Remove Structure" from the sub menu. 4. Select the top (root) of the structure that you wish to remove from the Structure Viewer. Next, select the "-" button in the upper right of the structure frame. Additionally, you can also remove all structures by select "Clear Structures" from either the right-click context popup menu or the Tools:Remove Structure submenu.
See also Structure Viewer Overview, Adding a Structure, Defining a Structure and Basic Structure Data Types. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
79 / 159
Structure Libraries
See also Structure Viewer Overview, Adding a Structure, Removing a Structure, Defining a Structure and Basic Structure Data Types. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
80 / 159
Data Types
Data types are declared in the following form: <<DATA_TYPE>> <<VARIABLE_NAME>; A trailing semicolon is required and variable names cannot contain tabs or spaces. For a list of basic built-in data types, see Basic Structure Data Types. Additional data types are provided in the standard-type library included with Hex Workshop.
Nested Structures
You can nest one structure within another by using a command of the following form: struct <<STRUCTURE_NAME>> <<VARIABLE_NAME>>; In the following example, an ARGB structure is defined and followed by the definition of a palette structure, which as defined below contains an array of 256 ARGB structures. struct { BYTE BYTE BYTE BYTE }; ARGB alpha; red; green; blue;
81 / 159
__parent__
Considering having a nested structure that references a length variable within two different parent structures. One might want to define a structure that is based off a relative address from the start of a parent instead of the actual variable name. In the example below, the length variable is defined with different names in PARENT_1 and PARENT_2 typedef struct NESTED { WORD someData[ushortAt(addrof(__parent__))] ; } NESTED ; typedef struct PARENT_1 { WORD parent1Length; NESTED nested ; } PARENT_1;
82 / 159
In the example above, the "NESTED" structure defines an array of WORDs where the array length hard-coded to the first WORD in any parent structure. This allows users to use this structure in definitions where the parent variable name may differ. In this case, PARENT_1's length is "parent1Length" and PARENT_2's length is "parent2Length".
__this__
The __this__ keyword references the begin of a structure. Consider a case where one has a WORD length followed by N number of words. You can define a structure to display this data this in multiple ways: typedef struct TYPICAL { WORD length; WORD data[length]; } TYPICAL; typedef struct ALTERNATIVE { WORD data[ushortAt(addrof(__this__))+1]; } ALTERNATIVE; In this example, the "ALTERNATIVE" structure's length is defined as effectively at the data[0] position. The "TYPICAL" structure is clearly preferred; however, cases exist where using __this__ is useful.
83 / 159
Data Types
Data Types
Hex Workshop supports a limited number of atomic data types. For added flexibility, users may define their own data type definitions that resolve to one of the corresponding data types listed below:
Type
Aliases
Size (bits)
Signed
Comment
bool
Unsigned
signed char
8 8
Signed Unsigned
8 8
Signed Unsigned
__int16
16
Signed
unsigned __int16
16
Unsigned
__int32
DWord signed __int32 int long UDWord unsigned int unsigned long
32
Signed
unsigned __int32
32
Unsigned
64 64
Signed Unsigned
halffloat
16 16 32
float double
84 / 159
Data Types
zstring
variable
N/A
Zero-terminated string.
In addition to the basic data types recognized by Hex Workshop, you can make use of standard types defined in the supplied standard-types.hsl file:
Data Type
CHAR WCHAR BYTE byte UBYTE ubyte WORD word USHORT ushort SHORT DWORD dword LONG ulong quad UQUAD uquad FLOAT DOUBLE char wchar
Maps To
signed __int8 signed __int8 unsigned __int8 unsigned __int8 signed __int16 signed __int16 unsigned __int16 unsigned __int16 signed __int16 signed __int32 signed __int32 signed __int32 unsigned __int32 signed __int64 unsigned __int64 unsigned __int64 float double
85 / 159
Data Types
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
86 / 159
Enumerated Types
= = = = = = =
struct LocalFileHeader { SIGNATURE Signature ; WORD VersionNeededToExtract ; WORD GeneralPurposeBitFlag ; COMPRESSION_METHOD CompressionMethod ; DOSTIME LastModFileTime ; DOSDATE LastModFileDate ; DWORD Crc32 ; DWORD CompressedSize ; DWORD UncompressedSize ; WORD FileNameLength ; WORD ExtraFieldLength ; char FileName[FileNameLength] ; blob ExtraField[ExtraFieldLength] ; blob FileData[CompressedSize] ; __verify(Signature == SIGNATURE.LocalFileHeader) ; } ; The enumeration is referenced using the <enumeration name>.<enumeration field>.
Examples
enum _FINDEX_SEARCH_OPS { FindExSearchNameMatch, // Value: 0 FindExSearchLimitToDirectories, // Value: 1 FindExSearchLimitToDevices, // Value: 2
87 / 159
Enumerated Types
// // // // // //
88 / 159
Arrays
Arrays Overview
To specify an array of a data type, indicate the desired repetition count of the array, in decimal, surrounded by brackets after the variable name. In the example below, 32 values of data type "int" are defined under the variable myArray: int myArray[32]; Users may also define variable length arrays within structures. A variable length character string is demonstrated below: struct pstring16 { unsigned short len; char content[len]; };
Users can specify expressions within array declarations. For example, consider the need to deserialize an array of bytes: struct myByteArray { unsigned short rows; unsigned short columns; __int8 data[rows*columns]; };
89 / 159
Strings
Strings Overview
The Hex Workshop structure view can accommodate three popular types of strings: - A variable length null (or zero) terminated string (zstring). - A fixed length string. - A variable length string where the length precedes the string content. Example of the three string types are shown below: struct stringexample { zstring null_terminated_str; char fixed_length_str[128]; struct length_first_str { WORD length; char string[length]; }; };
90 / 159
Bitfields
Bitfields Overview
Hex Workshop v4.2 added basic support for C style bitfields. Bitfields allow users to view and edit a selection of consecutive bits as an independent integer. This reduces the need to count bits and convert binary to decimal. Hex Workshop supports 8, 16, 32, and 64 bit bitfields. struct screenchar { unsigned short character : 8; unsigned short color : 4; unsigned short underline : 1; unsigned short blink : 1; }; In the example above, 16 bit value is broken into a 8-bit character, 4 bit color, and 1 bit flags for the underline and blink attributes.
91 / 159
Expressions
Expressions Overview
Users can embedded expressions supporting arithmetic and bitwise operations, limited conditionals (? : operators), and document/data manipulation in Array definitions, Structure Conditionals, and Structure Functions. Please see the Expressions Reference Overview for information on expression definitions and features.
92 / 159
Conditionals
Conditionals Overview
Structure definitions support two forms of conditions: switch and if statements. NOTE: The support for conditionals in Structure definitions differ from Structure Functions.
switch statement
The switch statement allow users to define conditional structure elements based on another structure variable or expression. The general form is: switch (<expression>) { case <expression>: <<DATA TYPES>> break; case <expression>: <<DATA TYPES>> break; default: <<DATA TYPES>> break; };
Example:
#include "standard-types.hsl struct conditionalExample { WORD type ; WORD len ; switch (type) { case 1: WORD value ; __verify(len == 2); break; case 2: DWORD value ; __verify(len == 4); break; default: blob value[len]; break; }; };
Limitations:
The variable or expression used in the switch statement must resolve to an integer (8, 16, 32, or 64 bit). Each case statement must be followed by break statement. The following is not supported: ... case 1: case 2: <<DATA>> break ; ... If the structure references switch statement data elements further down in the structure or from a parent structures, the switch data element must be declared in all case branches -- including the default branch. In the example below, all branches define a "length" structure element which is referenced in the declaration of "data". If the "default" case is omitted, the structure may fail to parse or be applied. struct example {
93 / 159
Conditionals
if statement
The statements allows users to define conditional structure elements using if, else if, else statements and resembles the C/C++ language. Each branch of the if statement must include an open and closing brace and the last branch must included a semicolon.
Form 1:
if (<expression>) { } ;
Form 2:
if (<expression>) { } else if (<expression>) { } else { } ;
94 / 159
Functions
Functions Overview
Structure libraries may contain parsing functions for file formats or functions to be used to provide general data manipulation helpers (e.g. recalculating a checksum). Functions include a list of expressions delimited by semicolons and can include arithmetic and bitwise operations, conditionals, loops, functional calls, etc. Please see the Expressions Reference Overview for information on expression definitions and features. Functions may be executed from Structure Viewer by pressing the hammer window and then selecting the desired function. icon located on the structure viewer
Form:
function <function name> { <expression1>; <expression2>; ... };
Example:
function AutoParseZipSelection { UQWord pos = __getCaretPos() ; UQWord end = pos + __getCaretSel() ; while (pos < end) { switch (__getUDWordAt(pos)) { case SIGNATURE.LocalFileHeader: pos += __addStructureAt(pos, "LocalFileHeader", "") ; break ; case SIGNATURE.ArchiveExtraData: pos += __addStructureAt(pos, "ArchiveExtraData", "") ; break ; case SIGNATURE.EndOfCentralDirectory: pos += __addStructureAt(pos, "EndOfCentralDirectory", "") ; break ; case SIGNATURE.DigitalSignature: pos += __addStructureAt(pos, "DigitalSignature", "") ; break ; case SIGNATURE.CentralDirectoryFileHeader: pos += __addStructureAt(pos, "CentralDirectoryFileHeader", "") ; break ; case SIGNATURE.ZIP64EndOfCentralDirectory: pos += __addStructureAt(pos, "ZIP64EndOfCentralDirectory", "") ; break ; case SIGNATURE.ZIP64EndOfCentralDirectoryLocator: pos += __addStructureAt(pos, "ZIP64EndOfCentralDirectoryLocator", "") ; break ; default: pos += 4 ; break ; } ; } ; }
95 / 159
Verification
Verification Overview
The Structure Viewer and Add Structure dialog allow users to verify basic pre-conditions on structures (sanity check). While adding a structure, icons are displayed next to the structure definition to indicate the validation status. Users can press the "Validation Status" to investigate which validation check failed. Floating and locked structures also display a "verify failed" message in the Structure Viewer if any validation conditions fail. The user can press the yellow warning icon button on the Structure Viewer toolbar to investigate. For example, adding a ZIP format "LocalFileHeader" at the wrong offset tells the users that the signature doesn't match expectations.
Structure Definitions support two methods of declaring verification checks: 1. __verify(<expression>) function 2. #pragma verify We recommend using the __verify(<expression>) method when possible as the #pragma method will be deprecated in future releases of Hex Workshop.
__verify(<expression>)
The __verify function allows users to define expressions to validate pre-conditions. For example: typedef struct tagBITMAPFILEHEADER { WORD bfType; DWORD bfSize; WORD bfReserved1; WORD bfReserved2; DWORD bfOffBits; // Verify that file header looks sane __verify( (bfType == 0x4D42) && (bfSize == __getDocSize()) && (bfOffBits < __getDocSize()) ) ; } BITMAPFILEHEADER ;
// Expected type: 'BM' // header size matches file size // image offset within range
This method allows complex validation rules; however, presently does not support string comparisons.
#pragma verify
The pragma verify statement allows users to define integer and string comparisons. The Syntax is as follows: #pragma verify <<MATCHTYPE>>("<<VARIABLE>>", "<<VALUE>>")
96 / 159
Verification
Compares a variable against the specified integer value. 8, 16, 32, and 64 bit values are supported. The value can be declared in either decimal or hex. Examples: #pragma #pragma #pragma #pragma #pragma verify verify verify verify verify match_var_int("Signature[0]", "0x50") match_var_int("Signature[1]", "0x4B") match_var_int("Signature[2]", "0x03") match_var_int("Signature[3]", "0x04") match_var_int("magic", "0xCAFEBABE")
match_var_str
Compares a variable against the specified string value. Examples: #pragma verify match_var_str("method", "add")
97 / 159
Library Settings
#pragma displayname("<string>")
The display name pragma defines the friendly name of the structure. The friendly name is displayed on the structure viewer selection tool. #pragma displayname("zip structures")
#pragma fileextensions("<string>")
The file extensions pragma defines which document extensions are appropriate for the structure definition. Multiple file extensions can be specified by using a semicolon a delimited. If the structure definition is loaded/open, Hex Workshop will automatically select the library whenever a compatible document is in focus. #pragma fileextensions(".zip;.jar")
#pragma hide()
The hide pragma hides all structure definitions and enumerations defined after the #pragma until the next #pragma show() statement is reached. Hidden structures can be referenced by other structures; however, are not shown in the Add Structure Dialog's list of available structures. Users often hide structures that are not useful by themselves or always nested within another structure. #pragma hide()
#pragma show()
The show pragma defeats the #pragma hide() setting and allows structures declared after it to be shown in the Add Structure Dialog. #pragma show()
#pragma maxarray(n)
By default, Hex Workshop limits the length of arrays to 1024 members. This setting imposes an upper limit to bound how much processing Hex Workshop performs when evaluation structures. If a structure definition contains recursive/exponential data structures (e.g. arrays of arrays) and is applied to a corrupt file, Hex Workshop may appear
98 / 159
Library Settings
#pragma maxstring(n)
Like array lengths, Hex Workshop limits the maximum string length to avoid run-away processing of corrupt files. By default, strings are limited to 512 characters, however, users may increase the number of characters to a max of 65,536 by using the maxstring #pragma. An example is shown below: #pragma maxstring(128); // Decrease the max string length to 128
#pragma ptrsize(<n>)
The structure viewer treats pointers to structures or data types as an absolute location to that data. For example, adding "UWord* myValue" to a structure definition is interpreted as "the next data (value) within the document represents an absolute value to a UWord". By default, pointers are assumed to be 32bit. The ptrsize pragma directive can be used to change the default pointer size to 8 bit, 16bit, 32 bit, or 64 bit. #pragma ptrsize(1) // Set pointer size to 8 bit #pragma ptrsize(2) // Set pointer size to 16 bit #pragma ptrsize(4) // Set pointer size to 32 bit #pragma ptrsize(8) // Set pointer size to 64 bit NOTE: #pragma ptrsize is allow supported within structure definitions. See Structure Settings for other definitions allowed within a structure definition.
#pragma enumsize(<n>)
By default an enumerate type is assumed to be a 4 byte (32 bit) data member. To define an enumeration for an 8 bit, 16 bit, 32 bit, or 64 bit enumerated type, use the #pragma directive to indicate the size. The #pragma directive sets the enumeration data size for all enumerations defined after the directive until a new #pragma is encountered. #pragma enumsize(1) // Enums defined after here are 1 byte (8 bits) <<enum definitions>> #pragma enumsize(2) // Enums defined after here are 2 bytes (16 bits) <<enum definitions>> #pragma enumsize(4) // Enums defined after here are 4 bytes (32 bits) <<enum definitions>> #pragma enumsize(8) // Enums defined after here are 8 bytes (64 bits) <<enum definitions>> NOTE: The size can be changed between enumeration definitions, but not in the middle of a definition.
#pragma enumsign("<sign>")
Structure definitions can switch the interpretation type of the enumeration elements using the enum_sign #pragma. Options include signed and unsigned. Enumerated types are signed by default. #pragma enum_sign("signed") <<enum definitions>> #pragma enum_sign("unsigned") <<enum definitions>> NOTE: The sign can be changed between enumeration definitions, but not in the middle of a definition.
99 / 159
Library Settings
#pragma pack(n)
Not yet implemented
100 / 159
Structure Settings
#pragma ptrsize(<n>)
The structure viewer treats pointers to structures or data types as an absolute location to that data. For example, adding "UWord* myValue" to a structure definition is interpreted as "the next data (value) within the document represents an absolute value to a UWord". By default, pointers are assumed to be 32bit. The ptrsize pragma directive can be used to change the default pointer size to 8 bit, 16bit, 32 bit, or 64 bit. #pragma ptrsize(1) // Set pointer size to 8 bit #pragma ptrsize(2) // Set pointer size to 16 bit #pragma ptrsize(4) // Set pointer size to 32 bit #pragma ptrsize(8) // Set pointer size to 64 bit NOTE: #pragma ptrsize is allow outside structure definitions. See Library Settings for other definitions allowed outside a structure definition.
Syntax:
#pragma lockAt(offset) #pragma floatAt(offset) Where offset can be a decimal (e.g. 32) or hexadecimal value (e.g. 0x20).
Example:
struct LocalFileHeader { #pragma lockAt(0x00000010) char Signature[4]; // PK<0x03><0x04> WORD VersionNeededToExtract; WORD GeneralPurposeBitFlag; WORD CompressionMethod; DOSTIME LastModFileTime; DOSDATE LastModFileDate; DWORD Crc32; DWORD CompressedSize; DWORD UncompressedSize; WORD FileNameLength; WORD ExtraFieldLength; };
101 / 159
Structure Settings
102 / 159
Structure Constructs:
struct, union, typedef, enum, switch, case, break, default, else, if, while, for, #include, #pragma, function
Data Types:
signed, unsigned, bool, char, int, __int8, __int16, __int32, __int64, halffloat, float, double, DATE, DOSDATE, DOSTIME, FILETIME, zstring, time_t, time64_t, blob, short, long, Byte, UByte, Word, UWord, DWord, UDWord, QWord, UQWord
Functions:
__min, __max, __byteflip16, __byteflip32, __byteflip64 __addStructureAt __getCaretPos, __getCaretSel, __getDocSize, __setCaretPos, __setCaretSel, __getAddrOf, __getSizeOf __getByteAt, __getUByteAt, __getWordAt, __getUWordAt, __getDWordAt, __getUDWordAt, __getQWordAt, __getUQWordAt __setByteAt, __setUByteAt, __setWordAt, __setUWordAt, __setDWordAt, __setUDWordAt, __setQWordAt, __setUQWordAt __insertByteAt, __insertUByteAt, __insertWordAt, __insertUWordAt, __insertDWordAt, __insertUDWordAt, __insertQWordAt, __insertUQWordAt
Reserved Words:
__parent__, __this__, __verify
Deprecated:
addrof, sizeof, __size__, ubyteAt, ushortAt, ulongAt, uquadAt, byteflip16, byteflip32, byteflip64
Symbols:
// /* */ ; { } [ ] ( ) , ? : + - * / % & | ~ ^ << >> == != || && < <= > >= = += -= *= /= %= &= |= ^= <<= >>= ++ --
103 / 159
User Tools
User Tools
Users Tools allow you to add custom applications and tools to the Hex Workshop environment. Custom applications are added to the end of the Tools Menu and are managed by select "Customize..." from the Tools Menu. Additionally, Hex Workshop allows you to add context sensitive variables in the "Arguments" setting of customize dialog. These variables pull information from the active document. If no document is in focus or a setting is not applicable then a space is substitute for the variable. An overview of the variables are listed below: Variable $(FilePath) $(FileDrive) $(FileDir) $(FileName) $(FileExt) $(DosFilePath) Description Fully qualified path to active document Drive of the active document Directory of the active document Filename of the active document File extension of the active document Fully qualified DOS (8.3) path to active document Current address or offset in decimal Current address of offset in hexadecimal Current selection length in decimal Current selection length in hexadecimal
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
104 / 159
Expressions Overview
Literal Values
Literal values can be specified in either hex or decimal. For hex literals, prefix the value with "0x". Examples: -1, 0x0000FFFF, 100, 0x64
Comments
Expressions support single line and multiline comments. Comment are ignored during parsing and evaluation.
Multiline comments
Users can comment multiple lines (or text within a single line) by wrapping the text between "/*" and "*/" character sequences. Overlapping and nested comments are not supported.
Expression Types
Simple Expressions
A Simple Expression consists of a single expression. For example: "1+2".
Compound Expressions
A Compound Expression consists of multiple expressions delimited by semicolons (";"). For example: "variable2 = variable1; variable2 += 1".
More Information
Expressions Overview Operations: Arithmetic, Bitwise, Logical, and Precedence Functions: Arithmetic and Document Conditionals and Loops Variables Expression Data Types Structure Functions and Expression Calc Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
105 / 159
Arithmetic Operations
Description
Addition Subtraction Multiplication Division Modulus Division Parenthesis (grouping)
Order of Operations
Arithmetic Operations follow the standard mathematical order of operations: 1. Parenthesis 2. Exponents (not supported) 3. Multiplication 4. Division (including modulus division) 5. Addition 6. Subtraction
Examples
1 + 2 2 * 5 + 1 2 * (5 + 1)
More Information
Expressions Overview Operations: Arithmetic, Bitwise, Logical, and Precedence Functions: Arithmetic and Document Conditionals and Loops Variables Expression Data Types Structure Functions and Expression Calc Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
106 / 159
Bitwise Operations
Description
Bitwise AND Bitwise OR Bitwise XOR Bitwise Left Shift Bitwise Right Shift Bitwise Complement
Examples
variable & 0x000000FF variable << 2 variable ^ 0xA5A5A5A5
More Information
Expressions Overview Operations: Arithmetic, Bitwise, Logical, and Precedence Functions: Arithmetic and Document Conditionals and Loops Variables Expression Data Types Structure Functions and Expression Calc Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
107 / 159
Logical Operations
Operators
Operator
== != ||
Description
Equals Not Equals Logical OR: Left-hand side or right-hand side must be true for the larger logical operation to be true. Logical AND: Left-hand side and right-hand side must be both true for the larger logical operation to be true. Less than Less than or equal Greater than Greater than or equal
&&
Examples
variable == 2 variable != 1 (variable == 1) || (variable == 2) variable < 3
More Information
Expressions Overview Operations: Arithmetic, Bitwise, Logical, and Precedence Functions: Arithmetic and Document Conditionals and Loops Variables Expression Data Types Structure Functions and Expression Calc Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
108 / 159
Arithmetic Functions
Description
Returns x if less then y; otherwise y Returns x if greater then y; otherwise y Returns a byte flipped version of x. __byteflip16, __byteflip32, and __byteflip64 flips 16 bit, 32 bit, and 64 bit integers, respectfully. Please see Expression Data Types for information on the data type sign and size.
Examples
__min(-1, 3) __max(100, __getUDWordAt(0x2E)) __byteflip32(__getUDWordAt(0))
More Information
Expressions Overview Operations: Arithmetic, Bitwise, Logical, and Precedence Functions: Arithmetic and Document Conditionals and Loops Variables Expression Data Types Structure Functions and Expression Calc Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
109 / 159
Document Functions
Description
Get the current caret position within the editor's active document view Get the current selection length within the editor's active document view Set the caret position within the editor NOTE: Setting the caret position automatically clears any selection.
UQWord __getCaretSel()
UQWord __setCaretPos(offset)
UQWord __setCaretSel(length)
Structure Functions
Function
UQWord __addStructureAt( offset, "structure name", "variable name")
Description
Adds a structure of the specified name to the specified offset and returns the length of the added structure. If the expression is defined as part of a Structure Viewer function, the current library is used for resolving structure names. If the expression is defined as part of the Expression Calc, the active structure collection is used for resolving structure names.
Description
Returns the size of the editor's active document. Returns the value at the specified address. Each function variation returns a different sized value. The expression is aborted (fails) if unable to read at the specified offset. If using a variable declaration to read or manipulate document data, that variable should be defined as a UQWord (unsigned 64 bit integer). Please see Expression Data Types for information on the data type sign and size.
UQWord __getUQWordAt(offset)
Description
Sets (overwrites) the value at the specified offset.
110 / 159
Document Functions
The expression is aborted (fails) if it's unable to operate at the specified offset. Otherwise, the new value is returned. If using a variable declaration to read or manipulate document data, that variable should be defined as a UQWord (unsigned 64 bit integer). Please see Expression Data Types for information on the data type sign and size.
UQWord __setUQWordAt(offset, value) Byte __insertByteAt(offset, value) UByte __insertUByteAt(offset, value) Word __insertWordAt(offset, value) UWord __insertUWordAt(offset, value) DWord __insertDWordAt(offset, value) UDWord __insertUDWordAt(offset, value) QWord __insertQWordAt(offset, value) UQWord __insertUQWordAt(offset, value) UQWord __deleteAt(offset, length) Deletes a range of data starting at the designated offset. The length is limited to a UDWORD. Inserts the value at the specified offset. The expression is aborted (fails) if it's unable to operate at the specified offset. Otherwise, the new value is returned. If using a variable declaration to read or manipulate document data, that variable should be defined as a UQWord (unsigned 64 bit integer). Please see Expression Data Types for information on the data type sign and size. NOTE: The caret position and length is not modified when inserting data.
Examples
__setUByteAt(0x2E, __getUByteAt(0x2E) + 1) __insertUWordAt(__getDocSize(), 0x0000) ;
More Information
Expressions Overview Operations: Arithmetic, Bitwise, Logical, and Precedence Functions: Arithmetic and Document Conditionals and Loops Variables Expression Data Types Structure Functions and Expression Calc Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
111 / 159
Form 1:
if (<expression>) <expression>; else if (<expression2>) <expression>; else <expression>;
Form 2:
if (<expression>) { <expression1>; <expression2>; };
? : operator
The ? operation can be used to define a simple if operation, and when combined with a : can include an else clause. The true and false branches each allow a single expression.
Form:
<expression> ? <true expression> [: <false expression>] If no : or <false expression> is included, the original expression is returned. For example: 0 ? 100, yields 0 1 ? 100, yields 100 (1==1) ? 100 : 200, yields 100 (1==0) ? 100 : 200, yields 1000 Note: Users must pay attention to operator precedence. The statement "1==1 ? 100 : 200" yields 0 since it is interpreted as "1==(1 ? 100 : 200)", and 1 == 100 is false or 0.
switch statement
The switch statement resembles the C/C++ switch statement with the following exceptions: 1. The closing brace must include a semicolon 2. Users cannot consolidate expressions under multiple case statements. The following is not supported: case 0x01: case 0x02: <expression>; break ; 3. Case statements are not checked for uniqueness.
Form:
switch (<expression>) { case <expression1>: <expression1a>; <expression1b>; break; case <expression2>: <expression2a>; <expression2b>; break; case <expression3>:
112 / 159
Loops
While and for loops resemble the C/C++ constructs, but with the following exceptions: 1. "break" and "continue" statements are not supported 2. The ending brace (if used) must include a trailing semicolon 3. Loops and expression aborted on error
Form 2:
while <expression1> { <expression2>; <expression3>; };
Form 2:
for (<init expression>; <control expression>; <post expression>) { <expression1>; <expression2>; };
More Information
Expressions Overview Operations: Arithmetic, Bitwise, Logical, and Precedence Functions: Arithmetic and Document Conditionals and Loops Variables Expression Data Types Structure Functions and Expression Calc Copyright (c) 1995-2009 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
113 / 159
Variables
Description
Declares a variable of the specified name. The variable is global to the entire expression (or Structure Function). The expression will fail and abort if the variable name already exists. Variable is initialized to zero at time of declaration and the value is returned. Please see Expression Data Types for information on the data type sign and size.
Variable Operators
Operator
= +=
Description
Assignment / equals, sets the variable's value. Equivalent to variable = variable + <expression>. See Arithmetic Operators for more information. Equivalent to variable = variable - <expression>. See Arithmetic Operators for more information. Equivalent to variable = variable * <expression>. See Arithmetic Operators for more information. Equivalent to variable = variable / <expression>. See Arithmetic Operators for more information. Equivalent to variable = variable % <expression>. See Arithmetic Operators for more information. Equivalent to variable = variable & <expression>. See Bitwise Operators for more information. Equivalent to variable = variable | <expression>. See Bitwise Operators for more information. Equivalent to variable = variable ^ <expression>. See Bitwise Operators for more information. Equivalent to variable = variable << <expression>. See Arithmetic Operators for more information. Equivalent to variable = variable >> <expression>. See Arithmetic Operators for more information. Equivalent to variable = variable + 1 Equivalent to variable = variable - 1
-=
*=
/=
%=
&=
|=
^=
<<=
>>=
++ --
114 / 159
Variables
Examples
UQWord i; UWord count; for (i=0; i<100; i++) { count += __getUByteAt(i); }; count;
More Information
Expressions Overview Operations: Arithmetic, Bitwise, Logical, and Precedence Functions: Arithmetic and Document Conditionals and Loops Variables Expression Data Types Structure Functions and Expression Calc Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
115 / 159
Type
Byte UByte Word UWord DWord UDWord QWord UQWord
Description
signed 8 bit integer unsigned 8 bit integer signed 16 bit integer unsigned 16 bit integer signed 32 bit integer unsigned 32 bit integer signed 64 bit integer unsigned 64 bit integer
More Information
Expressions Overview Operations: Arithmetic, Bitwise, Logical, and Precedence Functions: Arithmetic and Document Conditionals and Loops Variables Expression Data Types Structure Functions and Expression Calc Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
116 / 159
Operator Precedence
Operator Precedence
Expressions follow the standard C/C++ operator precedence. In the table below, expressions are evaluated from high to low priorities. Operators at the same priority are evaluated from left-to-right.
Priority Operators
1 2 () Literals, Functions, ++, and -!, ~ * /, % +, <<, >> <, <=, >, >= ==, != & ^ | && || =, +=, -=, *=, /=, %=, &=, ^=, |=, <<=, >>=
Comments
Parenthesis (grouping) Post increment (++) and Post decrement (--) Logical Negation (NOT) and Bitwise complement Multiplication Division and Modulus Division Addition and Substraction Bitwise Left and Right shift Greater than/Less than Comparisons Equals Comparisons Bitwise AND Bitwise XOR Bitwise OR Logical AND Logical OR Assignments
4 5 6 7 8 9 10 11 12 13 14 15
More Information
Expressions Overview Operations: Arithmetic, Bitwise, Logical, and Precedence Functions: Arithmetic and Document Conditionals and Loops Variables Expression Data Types Structure Functions and Expression Calc Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
117 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Open Documents Maximized within editor frame
When enabled (checked), Hex Workshop will always open files or disks with their editing window maximized. This setting is ignored when comparing documents the source and target file may be tiled horizontally or vertically. The Default is enabled.
Group Bytes by
Within the rows, data is broken up into columns to make viewing the data easier. The Column preference allows the user to choose how this data is grouped. For example, if data is grouped in 4 bytes (or longs), there would be 4 columns of 4 bytes in each row of hexadecimal data (assuming 16 bytes per row). The default is group by 1 byte (8 bits). The Group By setting can also be changed in the editor by clicking and dragging the column separators in on the header. When updating by dragging columns, the setting is not saved across application restarts and is only applied to the active document. Use the preference setting to change the default for all documents.
118 / 159
and is only applied to the active document. Use the preference setting to change the default for all documents.
Offset Length
The displayed length of the offset address can be adjusted from 4 to 12 character in length. Users may also drag the divider line in the editor to adjust this value. The default is 8 characters. The Offset Length setting can also be changed in the editor by clicking and dragging the column separators between the offset address list the hex area. When updating by dragging columns, the setting is not saved across application restarts and is only applied to the active document. Use the preference setting to change the default for all documents.
NOTE: The Flip Bytes in Editor setting only controls the displayed hex values and individual character editing within the
editor. Copy, Paste, and other editing features continue to use the bytes as ordered in the file or sector. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
119 / 159
120 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Show Setting For Highlight
Offset Area
Description
Controls the foreground and background colors of the offset address area (left side of editor window) and the editor header (top of edit window). Controls the hex foreground and background colors of odd numbered hex columns. Odd and Even columns color settings are separated to allow for easier viewing of data. Controls the hex foreground and background colors of even numbered hex columns. Odd and Even columns color settings are separated to allow for easier viewing of data. Controls the foreground and background colors of the text area (right side of editor). Controls the color of separator lines display between the offset, hex, and text area within the editor and between columns in the editor header. Controls the foreground and background colors of the caret position (editing caret -- not mouse cursor) within the offset and header areas. Controls the foreground and background color of the mouse cursor position within the offset and header areas. Controls the foreground, background, and border rectangle colors for data modified within the editor, but not yet saved.
Offset Caret
121 / 159
Selected Structure
Controls the foreground, background, and border rectangle colors for even indexed structure element members. The structure selected odd and even settings allow users to view data boundaries of data elements with the editor.
Unselected Structure
Controls the foreground, background, and border rectangle colors of unselected structures. By default, Hex Workshop defines a border rectangle to allow users to view structure boundaries.
Controls the foreground, background, and border rectangle colors of selected bookmarks. Controls the foreground, background, and border rectangle colors of selected bookmarks. By default, Hex Workshop defines a border rectangle to allow users to view structure boundaries.
Controls the foreground, background, and border rectangle colors of data marked as a match during a comparison operation. Controls the foreground, background, and border rectangle colors of data marked as a inserted during a comparison operation. Controls the foreground, background, and border rectangle colors of data marked as a deleted during a comparison operation. Controls the foreground, background, and border rectangle colors of data marked as a replaced during a comparison operation. Controls the foreground, background, and border rectangle colors of an item selected in the Compare tab of the Results Window. Controls the foreground, background, and border rectangle colors of data that will be modified from the Data Inspector. These attributes are applied when the user selects an item in the Data Inspector.
122 / 159
The "Use Default" button reverts the selected color setting back to the original Hex Workshop default.
123 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Color Rendering Priority
The rendering priority specifies how Hex Workshop displays highlighted data if that data is highlighted by multiple sources. For example, data could be modified (Altered Data Highlights) and also tagged as part of a structure definition (Structure Highlights). The default color rendering priority (show above) picks altered data highlights over structure highlights. Hex Workshop merges the color highlights when displaying data. This settings only controls the highlighting priority when color highlights conflict. If one color highlight sets a background color and another sets a foreground color, data will be displayed with both the background color and foreground color highlights (no conflicts). Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
124 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Float Precision
The Float Precision settings controls how many significant digits are displayed when rendering a floating point value. This setting controls the display for the Data Inspector, Structure Viewer, and Bookmarks.
Double Precision
The Double Precision settings controls how many significant digits are displayed when rendering a floating point value. This setting controls the display for the Data Inspector, Structure Viewer, and Bookmarks. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
125 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Display Themes
A display theme is a collection Display Options (All options under Display Options in Preferences). Themes are designed to allow users to save and easily switch between sets of font and colors. By default, Hex Workshop include two themes: Default and Black. Themes are loaded and applied to the Current Settings. Changing color and fonts within Preference will update the Current Settings.
Load
Pressing the Load button will load a theme into the Current Settings. Press the "OK" button view the applied settings within the Hex Workshop Editor.
New
Pressing the "New" button allows users to create a named theme based on either the Current Settings, Hex Workshop's defaults, or a previously saved theme.
Save
Pressing "Save" overwrites the selected theme with the Current Settings.
Delete
Pressing "Delete" removes the selected theme.
Rename
126 / 159
Import
Pressing "Import" allows users to import a previously exported theme. Import and Export allows users to transfer settings between computers and users.
Export
Pressing "Export" allows users to export a theme for use on another computer or backup. Alternatively, users can export all of the preferences from the "All Settings" button. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
127 / 159
That character filter editor is invoked by pressing the New, Edit, or View buttons in Font & Filter Display Options Preferences. The editor allows you to change which characters are displayed for each hexadecimal byte value. Additionally, you can specify the foreground color for characters and control the reverse mapping of characters entered in the text area of the Hex Workshop Hex Editor.
View Characters As
The drop down choice box in the upper right corner of Editor allows you to view the Map From and Map To columns as Hexadecimal values, decimal values, or as characters. The default value is Hexadecimal.
Map Selection To
The group of controls within the Map Selection To group are used to apply changes to a one or more character maps. The table supports multiple selections and users may use the shift and control keys to select additional character maps. The Apply button must be pressed to commit changes.
Character
This edit box contains the character that will be displayed in the text tab of the Hex Workshop Hex Editor when the hex data contains the hexadecimal value in the "Map From" column. You can either: enter a character here, enter the character's hexadecimal value in the Hex edit box, or enter the character's decimal value in the Dec edit box As a convenience, the character filter editor will fill in the character's values in the other edit boxes when changed. The Apply button must be pressed to commit changes.
Hex
This edit box contains the hexadecimal value of the character that will be displayed in the text tab of the Hex Workshop Hex Editor when the hex data contains the hexadecimal value in the "Map From" column. You can enter the hexadecimal value here, enter the character directly in the Character edit box, or enter the character's decimal value in the Dec edit box As a convenience, the character filter editor will fill in the character's values in the other edit boxes when changed. The Apply button must be pressed to commit changes.
Dec
This edit box contains the decimal value of the character that will be displayed in the text tab of the Hex Workshop Hex Editor when the hex data contains the hexadecimal value in the "Map From" column. You can either: enter the decimal value here, enter the character directly in the Character edit box, or enter the character's hexadecimal value in the Hex edit box As a convenience, the character filter editor will fill in the character's values in the other edit boxes when changed. The Apply button must be pressed to commit changes.
Color
Users can specify the foreground color that each map is displayed in. A sample of the current color immediately followings the "Color:" label. A color of "default" indicates that Hex Workshop should use the default Odd Hex Color, Even Hex Color, or Text Color. Press the button labelled "..." to pick a new color or press the "def" button to restore the default color.
128 / 159
This settings allows you to configure whether entering the "Map To" character in the text area of the Hex Workshop Hex Editor (character entered in same Map Selection To group) should map back to the Map From character. For example, the default ASCII filter maps a 0x00 to 0x2E ('.') because a zero/null value is not viewable. However, when a user enters a '.', we want a 0x2E inserted and not a 0x00 character. For this reason Reverse Map is disabled in this case. In other cases, you may want to reverse map characters. NOTE: The Character Filter Editor performs some simple checks when the OK button is pressed and will report conflicting reverse maps (i.e., multiple characters that map to different results). Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
129 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Prompt for file backup when saving
When checked Hex Workshop will ask if a backup should be created whenever an altered file is saved. A backup file with the extension .BAK is created if requested. Default is checked.
Warning on Insertion/Deletion
When checked Hex Workshop will post a warning message (dialog box) before allowing an insert or delete of bytes in an open file. Default is checked.
Define Keycuts
Hex Workshop allows users to update and add new keyboard shortcuts for frequently used operations. See Keyboard Shortcuts for default keyboard shortcut definitions.
130 / 159
Users can view, edit, and create new shortcut sequences for frequently used operations.
131 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Show Settings for Path Setting
Open From
Description
The default open path used when opening files. Options: Last used or user-defined path
Save To
The default save path used when saving files. Options: Last used or user-defined path
Import From
The default open path used when importing files. Options: Last used or user-defined path
Export To
The default open path used when exporting files. Options: Last used or user-defined path
Compare Source
The default open path used when selecting a comparison source file. Options: Last used or user-defined path
Compare Target
The default open path used when selecting a comparison target file. Options: Last used or user-defined path
Temporary Files
The default directory used for temporary files. Options: System default or used-defined.
132 / 159
Bookmarks
The default directory used to find bookmark definition files. Options: Installation default or used-defined.
Color maps
The default directory used to find color map definition files. Options: Installation default or used-defined.
Character Filters
The default directory used to find character filter definition files. Options: Installation default or used-defined.
Palette Directory
The default directory used to find palette files for use with the Data Visualizer. Options: Installation default or used-defined.
133 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Add "Hex Edit" to system right-click context menu
When checked Hex Workshop will install a Windows Context Menu Shell Extension so whenever the right mouse button is clicked on a file, a "Hex Edit using Hex Workshop" menu item will appear. Clicking on the Hex Edit menu item will automatically launch Hex Workshop with the selected file(s) to open. Users can also click on the root directory of drives (e.g. "C:\") to invoke the sector editor. Default is enabled.
134 / 159
135 / 159
Page Setup
Page Setup
Hex Workshop provides the ability to print customized printouts (hex dumps) with a Page Setup feature. Using the Page Setup users can use a custom header and/or footer, printer font, and margins.
Header/Footer:
The header and footer can consist of any valid text. Using special codes (listed to below) users can print the filename or full path, current page number, total pages, and time and date in a number of different formats. In addition, any portion or all of the headers and footers can be left, center, or right justified using these special codes:
Font:
The font which is used to print all data. This can be changed to any monospace font on the users system. The default is Courier 12 point.
Bytes/Row:
You can specify how many bytes are printed on a single low (line). The default is 16 bytes per row.
Margins:
The left, right, top, and bottom margin can be set for printouts. The default is 0.50 inches for all margins. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
136 / 159
Keyboard Shortcuts
Default Shortcuts
Shortcut F1 F2 Alt+F2 Ctrl+F2 Ctrl+I Ctrl+W Description
Help (Contents) Tile Windows Horizontally Tile Windows Vertically Cascade Windows Show/Hide Data Inspector Window Show/Hide Results Window
Create New File Open File Open Drive Save File or Sector Print
Find Find Next Find Previous Replace Find Selected (next/downwards) Find Selected (previous/upwards)
137 / 159
Keyboard Shortcuts
Ctrl+G F5 Shift+F5
Ctrl+M Ctrl+Shift+M
Ctrl+L Ctrl+Shift+L
Alt+Enter
Properties of File/Sector
Tab Ctrl+U
Toggles between Hex and ASCII in main edit window Toggles between ASCII and Unicode text entering modes.
Home End
Goto Previous Sector (Drive Editing Only) Goto Next Sector (Drive Editing Only) Jump Back 10 Sectors (Drive Editing Only)
138 / 159
Keyboard Shortcuts
139 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
When select bookmarks
Users can define the edit caret position and editor selection when selecting a bookmark item. Available options are listed below: Scroll Data Into View Set Caret Position in Editor Select Data In Editor Moves the data into view, but does not adjust the caret position. Scrolls the bookmark data into view and moves the caret position to the start of the bookmark. Scrolls the bookmark data into view and sets the editor selection to match the bookmark data.
140 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Show Character Histogram
Check (enable) to include a character distribution graph of your data. The default is enabled.
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
141 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Prompt to save when closing a file containing unsaved colormaps
If checked (enabled), Hex Workshop will prompt to save any new or modified color maps upon closing a file. The default is enabled. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
142 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Resync Window
This is option is used to limit how far (in bytes) the compare tool will search for an insertion or deletion. A higher number may yield more accurate results, however, will take an exponentially longer time to execute. Lowering the number will speed up the comparison, but may result in more replacements instead of insertions and deletions. The default value is 2048 bytes.
Match Bytes
This option is used to tell the compare tool how many bytes must be identical before a match is reported. The default value is 32 bytes.
143 / 159
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
144 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
When selecting find results
Users can define the edit caret position and editor selection when selecting a find item from the Find tab of the Results Window. Available options are listed below: Scroll Data Into View Set Caret Position in Editor Select Data In Editor Moves the data into view, but does not adjust the caret position. Scrolls the data into view and moves the caret position to the start of the bookmark. Scrolls the data into view and sets the editor selection to match the bookmark data.
145 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
When selecting locked structure
Users can define the edit caret position and editor selection when selecting a locked structure from the Structure Viewer. Available options are listed below: Scroll Data Into View Set Caret Position in Editor Select Data In Editor Moves the data into view, but does not adjust the caret position. Scrolls the data into view and moves the caret position to the start of the bookmark. Scrolls the data into view and sets the editor selection to match the bookmark data.
Floating structures are applied to the current edit caret position and cannot change the caret position or selection. Selecting a floating structure will scroll the data into view without adjusting the caret position or selection. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
146 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Default Variable Name
Defines the variable name used in the C Source or Java Source export of the users data.
Data Type
Specified the data type used for a C Source or Java Source export. Choices include 8 bit, 16 bit, 32 bit, and 64 bit data types.
147 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Use Display Settings to determine Group By and Bytes Per Line
Checking this setting will export your document with the same Bytes Per Line and Group By configuration as seen in the editor. The default is checked.
Group Data By
The Group By controls how much data is grouped together before a breaking white space. Value options are 1, 2, 4, 8, or 16. The default is 2.
Export Color
Checking this setting will export color to the format. The default is checked. Copyright (c) 1995-2008 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
148 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Fill Empty Bytes
Hex Workshop fills unspecified memory with this byte when importing Intel Hex Code or Motorola S-Records. For example, if the hex code or s-records does not supply data for a particular block of memory, this data byte will be used as fill. The default value is 0x00.
Copyright (c) 1995-2008 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
149 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Default Variable Name
Defines the variable name used in the C Source or Java Source export of the users data.
Data Type
Specified the data type used for a C Source or Java Source export. Choices include 8 bit, 16 bit, 32 bit, and 64 bit data types.
150 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Fill Empty Bytes
Hex Workshop fills unspecified memory with this byte when importing Intel Hex Code or Motorola S-Records. For example, if the hex code or s-records does not supply data for a particular block of memory, this data byte will be used as fill. The default value is 0x00.
151 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Use Display Settings to determine Group By and Bytes Per Line
Checking this setting will export your document with the same Bytes Per Line and Group By configuration as seen in the editor. The default is checked.
Group Data By
The Group By controls how much data is grouped together before a breaking white space. Value options are 1, 2, 4, 8, or 16. The default is 2.
Export Color
Checking this setting will export color to the format. The default is checked. Copyright (c) 1995-2008 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
152 / 159
The "All Settings" button allows users to reset all preferences to default settings or import/export settings. The "Help" button displays help for the selected preference sub-category.
Settings
Use Display Settings to determine Group By and Bytes Per Line
Checking this setting will export your document with the same Bytes Per Line and Group By configuration as seen in the editor. The default is checked.
Group Data By
The Group By controls how much data is grouped together before a breaking white space. Value options are 1, 2, 4, 8, or 16. The default is 2. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
153 / 159
Base Converter
Base Converter
Hex Workshop includes a Base Converter (BCONV16.EXE or BCONV32.EXE, in the 16 or 32 bit version, respectively). The Base Converter converts from hex to decimal and decimal to hex (while displaying binary). For a conversion the user can specify byte order (Little Endian/Intel, Big Endian/Motorola, or Raw Hex) and Data Type (byte, unsigned byte, short, unsigned short, long, unsigned long, float, or double). The Base Converter includes an Always on Top (Ctrl+A) option accessible from the system menu.
Note: When entering hex values with the Byte Order set on Intel or Motorola, the Base Converter will only convert and
display a decimal value when the number of digits is exactly the number appropriate for the selected Data Type. For example, if the Byte Order is set to Intel and the Data Type is set to unsigned short a decimal value will only be displayed when 4 hex digits are entered. This is necessary to avoid assumptions on zero padding (right or left) before byte flipping. When the Byte Order is set to Raw Hex, then a decimal value will be displayed when the number of digits is less than or equal to that for the selected Data Type (left padding of zeros is assumed). Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
154 / 159
Hex Calculator
Hex Calculator
Hex Workshop includes a Hex Calculator (CALC16.EXE or CALC32.EXE, in the 16 or 32 bit version, respectively). The Hex Calculator operates in two modes; arithmetic mode and bit manipulation mode. The arithmetic mode supports addition (+), subtraction (-), multiplication (*), and division (/) and the bit manipulation mode supports logical or (|), logical and (&), exclusive or (^), negation (~), left shift (<<), and right shift (>>). Both modes operate on hex or decimal unsigned long values and do not allow negative numbers or fractions. The left shift (<<) and right shift (>>) operators require a second value specifying the amount of bytes to shift. For example to left shift 0xFF by 1 bit, enter FF << 1 =., by 4 bits enter FF << 4 =. Further it should be noted the left and right shift do not rotate the most significant and least significant bit (because that would be dependent on data type). The mode can be toggled from the system menu or using the Ctrl+S keycut. The calculator can be toggled between hex and decimal by clicking on the "HEX" or "DEC" in the display or using the spacebar, and the calculator can be switched into hex or decimal mode using the keycuts, Ctrl+H and Ctrl+D, respectively. The Calculator includes an Always on Top (Ctrl+A) option accessible from the system menu. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
155 / 159
Usage:
hworks32 [file|drive|fixeddisk|/HEXCODE:file|/SRECORDS:file [/READONLY] [/FILELIST] [/GOTO:address] [/SELECT:count] /BOOKMARKS:file] hworks32 [file [/COMPAREWITH:file2]] Attribute/Option file drive Description Opens the specified file. Please place quotes around paths with spaces. Opens a Logical Drive in the form 'X:', where X is the drive letter. A: for Drive A:, C: for Drive C:, etc. Open a Physical Drive in the form '/F:x', where x is the fixed disk number: /F:80 for the first fixed disk /F:81 for the second fixed disk ... /READONLY /FILELIST Open the resource in read-only mode. This disables all write operations. Open the resource as a CrLf delimited text file and then open each individual file specified within it. Places the editor caret at the specified offset 'x'. Values are interpreted as decimal values unless prefixed with "0x" when they are interpreted as hexadecimal values. Select 'x' bytes from the current editor caret position. If a /GOTO is not specified, Hex Workshop will select data starting from offset 0. Import the specified file as Motorola S-Records. Import the specified file as Intel Hex Code. Compare the source file with this target file. This parameter is only valid for file types (not drive, fixeddisk or imports). The default window size and match bytes are used. A starting offset of zero is used for both files. Load and apply the bookmark file to the file, drive, or fixed disks.
fixeddisk
/GOTO:x
/SELECT:x
/BOOKMARKS:file
Examples:
c:\hexworks\hworks32 foobar1.bin foobar2.bin The command above will start Hex Workshop with the files "foobar1.bin" and "foobar2.bin" loaded in the editor. c:\hexworks\hworks32 C: This will start Hex Workshop with the logical "C:" drive loaded in the sector editor. c:\hexworks\hworks32 /F:80 /READONLY The command above will start Hex Workshop with the first physical disk loaded in the sector editor. The sector will be loaded in "read-only" mode so no sectors can be modified.
156 / 159
This will start Hex Workshop with foobar3.bin loaded in the editor. The editor caret will be placed at offset 300 (0x012C) and 256 bytes (0x100) will be selected. c:\hexworks\hworks32 /SRECORDS:mykernel.mot /GOTO:0x1000 This will start Hex Workshop, import mykernel.mot as Motorola S-Records, and place the caret as offset 0x1000.
c:\hexworks\hworks32 file1 /COMPAREWITH:file2 This will start Hex Workshop, and start a resynchronizing compare operation between file1 (source) and file2 (target).
c:\hexworks\hworks32 myIcon.ico /BOOKMARKS:icon.hbk This will start Hex Workshop, load myIcon.ico into the editor and apply bookmarks found in icon.hbk. Hex Workshops looks for bookmark files in the Bookmarks directory if a full path is not specified and unable to load the file from the current working directory. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
157 / 159
Data Types
Data Types
Name
signed byte unsigned byte
Size (bytes)
1 1
Range of Values
-128 to 127 0 to 255
2 2
4 4
8 8
4 8 10
Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com
158 / 159
159 / 159