0% found this document useful (0 votes)
1K views

HexWorks Manual

Breakpoint's hex workshop is a powerful tool for creating and editing hex files. It can be used to create a variety of different hex file formats. The program can be used with any hex editor, including csv files.

Uploaded by

Iguodala Owie
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

HexWorks Manual

Breakpoint's hex workshop is a powerful tool for creating and editing hex files. It can be used to create a variety of different hex file formats. The program can be used with any hex editor, including csv files.

Uploaded by

Iguodala Owie
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 162

Table of Contents

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

Ordering and Activating Hex Workshop

.......................................................................................................................... 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

Goto Toolbar Overview ................................................................................................................................................................. 74 Structure Viewer ............................................................................................................................................................................... 75

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 ..................................................................................................................................................................

Import/Export .................................................................................................................................................................................. 147

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 ...........................................................................................................................................

Hex Workshop v6.6

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

Rich Feature Set


Hex Workshop features a broad and powerful set of features ranging from the ability to color map data sequences to the interpretation of data though our integrated structure viewer and smart bookmarks. Our many features include: binary data editing, importing and exporting blocks of data, searching for data by hex strings, text, Unicode, bitmasks, or decimal values, viewing character distributions, sector editing, embedded data operations, binary file comparison, and import/export capabilities.

Highly Customizable User Interface


Hex Workshop allows users to customize the look of the main editor window through user definable color settings for the data and backgrounds and also through the ability to define how and what data will be displayed. Users can adjust the grouping of hex data, the number of bytes display per line, offset lengths, offset bases, etc. Panels can be docked or pinned to maximize your editing workspace. Integrated tools allow users to color code and tag data within the editor. For example, while viewing a structure in Hex Workshop, users are able to color graphically see the data ranges of structure members. All color coding is user definable.

Data Interpretation, Visualization and Parsing


Four integrated tools are available to help parse and combine data within Hex Workshop. 1. The Structure Viewer applies C-style structures to data within the editor and allows the user to visually view and edit that data. 2. Smart Bookmarks allow users to add bookmarks to a file with functions, mathematical operations, and data types. Users can view and edit both the bookmark and the bookmarks value. 3. Color maps allow users to apply color attributes to hex sequences or character ranges to help identify data within a file. 4. The Data Visualizer allows users to apply color palettes to their data to help identify patterns.

Integrated Binary Comparison


Integrated resynchronizing binary comparisons allow users to compare binary files and review each difference. Starting offsets, lengths, and compare parameters, and color renderings are all user-definable.

Technical Specifications
Software Requirements:
Microsoft Windows 2000 or later

[email protected]

1 / 159

Hex Workshop v6.6


Administrative access for installation, registration, and sector editing

Product Overview

Hardware Requirements:
1 GHz x86 processor 512 MB of system memory 35 MB of available disk space

Full Feature Set


Basic Editing
Cut, Copy, Paste, Insert, Fill and Delete Hex ASCII, DOS, EBCDIC, Macintosh, Window, Unicode or custom character set filters Multilevel Undo and Redo Drag and Drop files onto Hex Workshop for quick editing Highlight hex and text sequences using Color Maps View modified bytes in user defined colors Select by offset/length or Select All Paste Special (any format on the clipboard) Insert File a file or replace selection with the contexts of a file Save a selection as a new file Select "Hex Edit" from Windows Right-Click Context Menu to view and edit files Context sensitive help View character distributions of a document or selection Copy document or selection as: C Source Array, Java Source Array, Hex String, HTML, RTF, Text, Base64 or UUEncoding View offsets and lengths in hex or decimal Integration with 3rd party applications User customizable keyboard shortcut key sequences for common operations

Highly Customizable User Interface


Hex values can be grouped by 1, 2, 4, 8 or 16 bytes Specify the bytes per line (1-128) or let Hex Workshop fit to window size User-definable font and character mapping Specify significant digits for floating point/double presentation Enable/Disable warnings and notification messages Workbook mode allows ability to switch between open documents quickly User-definable colors for the offset area, odd hex columns, even hex column, separators and text area Integrated color and border rectangle tagging for integration tools: Structure Viewer, Bookmarks, Data Inspector, Compare Results, Find Results and Color Maps Import/Export support for Preferences and display themes

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

[email protected]

2 / 159

Hex Workshop v6.6


Replace All instances or instance by instance Replace from top down or bottom up Replace across entire document, selection, or manually entered range

Product Overview

Disk/Drive Sector Editing


Sector edit partitions or physical disks Copy sectors between disks and partitions Save Sector range to a file Restore Sector range from a file

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

[email protected]

3 / 159

Hex Workshop v6.6


Checksum Generation
Checksum either entire document or a selection 8-bit, 16-bit, 32-bit, and 64-bit checksums (sum) CRC-16 CRC-16/CCITT CRC-32 Custom CRC-16 Custom CRC-32 MD2, MD4, MD5 SHA1, SHA-224, SHA-256, SHA-384, SHA-512 RIPEMD-128, RIPEMD-160, RIPEMD-256, RIPEMD-320 Tiger Whirlpool View checksums and CRCs as 1s or 2s Complement

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,

[email protected]

4 / 159

Hex Workshop v6.6


setValueAt, insertValueAt Conditional statements: if, switch Looping constructs: for, while Creation and manipulation of integer variables (signed/unsigned 8, 16, 32, and 64 bit variations) Big Endian or Little Endian byte ordering Option to automatically place results on clipboard

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

[email protected]

5 / 159

Hex Workshop v6.6

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

[email protected]

6 / 159

Hex Workshop v6.6

How to Contact the BreakPoint Software

How to Contact the BreakPoint Software


You can find BreakPoint Software, Inc. and Hex Workshop online at: http://www.bpsoft.com http://www.hexworkshop.com From our web sites you can most up-to-date information on Hex Workshop, download evaluations of the latest BreakPoint Software products, and learn about our plans for future releases. E-Mail Addresses: [email protected] [email protected] [email protected] For further information see Lost Registration Keys, Technical Support and Questions, and Comments and Suggestions. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

7 / 159

Hex Workshop v6.6

Comments and Suggestions

Comments and Suggestions


We are continually planning for future software releases and welcome all feedback. If you have comments on the current version, suggestions for future release, or suggestions for new products please do not hesitate to contact us via e-mail at [email protected]. Online forms are also available on our web site for bug reports and suggestions: http://www.hexworkshop.com/support. For additional information, see Contacting the BreakPoint Software . Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

8 / 159

Hex Workshop v6.6

Technical Support and Questions

Technical Support and Questions


Please visit the Hex Workshop support pages for common support issues and answers to frequently asked questions. http://www.hexworkshop.com/support Technical Support for Hex Workshop is also available by e-mail for registered users. If you require technical support or have found a problem with Hex Workshop please submit an e-mail to [email protected]. Please be as descriptive as possible and title the message appropriately. We make every possible effort to answer all inquiries and problems reported in a timely manner. Please specify the version information located in the About Box (i.e.: version 6.0.0.4132) and the operating system that you are using (i.e. Vista Business 64 bit). For additional information, see Contacting the BreakPoint Software. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

9 / 159

Hex Workshop v6.6

Lost Registration Keys

Lost Registration Keys


If you misplaced or lost your registration number, please visit: http://www.hexworkshop.com/support We provide online forms to help users locate lost registration keys, download license files, and update their contact email address online. If you are unable to use the online tools, please e-mail [email protected] with the product name, approximate order date, name, company, address, phone number, and the e-mail address used when ordered. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

10 / 159

Hex Workshop v6.6

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.

Unlocking an expired evaluation


If the Hex Workshop evaluation has expired, an "Unlock" or "Register" button is presented where customers can enter their Name, E-mail address, and Registration Key to download a license. Alternatively, users can select a predownloaded license file from their file system.

Unlocking a non-expired evaluation


If an evaluation has not expired, customers may activate their license by pressing the "Register" button on the Hex Workshop About Box (Select "About Hex Workshop..." from the "Help" menu). Users have the option of entering their Name, E-mail address, and Registration key to download a license or select a pre-downloaded license file from their file system. See Product Activation Wizard for more information on the activation process. For the latest information on Hex Workshop, please visit our web sites: http://www.bpsoft.com http://www.hexworkshop.com Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

11 / 159

Hex Workshop v6.6

Upgrade and Maintenance Policy

Upgrade and Maintenance Policy


BreakPoint Software customers are entitled to 12 months of maintenance upon purchase or upgrade of a product. Maintenance includes all major and minor upgrades release during the period. Customers can extend their maintenance period at any time prior to its expiration for 20%* of the original purchase price. If a customer is outside their maintenance period, they must purchase an upgrade at a higher cost. Customers can review their license information and maintenance expiration date in Hex Workshop About Box (Select "About Hex Workshop..." from the "Help" menu. For more information, please visit: http://www.hexworkshop.com/ordering Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

12 / 159

Hex Workshop v6.6

Product Activation Wizard

Product Activation Wizard


The Product Activation Wizard is used to unlock Hex Workshop or update the existing Hex Workshop License. The wizard is started when users press the "Register" button from the Hex Workshop About Box (Select "About Hex Workshop..." from the "Help" menu) or by selecting the "Register" or "Unlock" button from an evaluation expiration notice. Like many software products, Hex Workshop requires a license file to operate beyond its evaluation period. The Activation Wizard can download the license file directly from BreakPoint Software or customers can download the license file from our Web Site and install it using the Activation Wizard.

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.

Automatically downloading the 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:

[email protected]

13 / 159

Hex Workshop v6.6

Product Activation Wizard

Manually downloading the license file

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

[email protected]

14 / 159

Hex Workshop v6.6

Hex Workshop Layout

Hex Workshop Layout


Hex Workshop includes 8 distinct components or window: 1. 2. 3. 4. 5. 6. 7. 8. Tool Bar Data Visualizer Editor Window Data Inspector Expression Calc Structure View Results Window Status Bar

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:

[email protected]

15 / 159

Hex Workshop v6.6

Hex Workshop Layout

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.

[email protected]

16 / 159

Hex Workshop v6.6


Find Results

Hex Workshop Layout

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

[email protected]

17 / 159

Hex Workshop v6.6

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.

Caret Location Highlight


The Caret location is highlighted using the Offset Caret Highlight and shows the location of the editing caret. In the example above, this is shown as blue on dark gray.

Mouse Location Highlight


The Mouse location is highlighted using the Offset Cursor Highlight and shows the location of the mouse cursor. In the example above, this is shown as the default foreground color with a dark gray background.

Showing/Hiding the Offset Header


The offset header can be hidden through the General Display Options Preferences.

Clicking on Offset Header


Clicking on one of the offset labels adjust the caret position to that offset. Only the column position of the caret is adjusted -- not the row.

Adjusting Address Width


The Address width (how many digits are displayed in the Offset Area) can be adjusted by dragging the separator between the Offset Area and Hex Area to the left or right.

[email protected]

18 / 159

Hex Workshop v6.6

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.

Adjusting Group Byte By


The Group Byte By width (how many bytes are grouped together in each column) can be adjusted by dragging the separator between columns.

NOTE: Settings are only applied for the current document. See General Display Options Preferences to set the default used when opening new files.

Adjusting Bytes Per Row


The Bytes Per Line (how many bytes are displayed per row) can be adjusted by dragging the separator between the Hex Area and Text Area to the left or right.

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.

Switching between Hex and Decimal address


Users can switch between Hex and Decimal address presentation using the Offset Area right-click popup context menu or the Environment Toolbar.

Setting the Starting Offset


Users can adjust the starting offset (what is display in the offset area) by selecting "Starting Offset..." from the Offset Area right-click context menu. The starting offset is used for display purposes and when exporting data as Intel Hex Code and Motorola S-Records.

Setting the Offset/Address Width

[email protected]

19 / 159

Hex Workshop v6.6

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.

Jumping to a specific Offset


Clicking on an address in the Offset Area moves the caret position to that location. Alternatively, users can select "Goto..." from the Offset Area right-click context menu to invoke the Goto Tool.

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

[email protected]

20 / 159

Hex Workshop v6.6

General Hex Editing

General Hex Editing


Hex Workshop includes a professional hex editor with the power and ease of a Word Processor allowing cut, copy, paste, insert, delete, undo, redo and more.

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.

Undo & Redo


Undo (Ctrl+Z) and Redo (Ctrl+Y) allows you to reverse the most recent editing operation(s). The size of the undo buffer (which determines how many operations are saved) can be set in the General Configuration Preferences.

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.

Select Block/Select All:


A block of hex can be automatically selected at the cursor position using the Select Block feature and specifying either the size of the block or the ending position. In either case the block starts at the cursor position. Select All (Ctrl+A) automatically selects the entire file.

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

[email protected]

21 / 159

Hex Workshop v6.6

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:

First Sector Previous Sector Next Sector Last Sector

[email protected]

22 / 159

Hex Workshop v6.6


See Drive (Sector) Editing for more information.

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.

Selecting "Toolbars..." from the Options Menu

Right-clicking on a shown toolbar:

[email protected]

23 / 159

Hex Workshop v6.6

Toolbars

Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

24 / 159

Hex Workshop v6.6

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.

File Size or Selection Length


The forth status bar pane contains either the file size in decimal or the current selection size in hex or decimal. If the user is editing a drive or disk, the file size is replaced with the sector size. 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 file size or selection length places the address or length on the clipboard.

Insert/Overwrite Mode (OVR)


The fifth status bar pane indicates whether the user is entering data in Insert or Overwrite mode. Black text indicates enabled and grey text indicates disabled. Double-clicking on the OVR toggles the input mode between Insert and Overwrite. Users can also press the Insert key to toggle modes.

Document Modification Status (MOD)


The sixth status bar pane indicates whether the current document has been modified and not yet saved. Black text indicates enabled (modified document) and grey text indicates disabled (not modifications)

Read-Only/Write Status (READ)


The seventh status bar pane indicates whether the current document is read-only or editable. Black text indicates enabled and grey text indicates disabled. Document can be opened read-only or the user may not have write permissions for the file. Black text indicates enabled (Read-Only) and grey text indicates disabled (Editable).

[email protected]

25 / 159

Hex Workshop v6.6

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

[email protected]

26 / 159

Hex Workshop v6.6

Output Results Window

Output Results Window


The Output Window is located on a tab the Results Window and displays Hex Workshop diagnostics information. By default, the output window includes the last 16K of output information. Output Information ranges for Hex Workshop diagnostics and debugging information to errors and warning found in user-defined structure definitions, color map definitions, and bookmark collections. In the example below, Hex Workshop is reporting an error parsing a unknown data type "DDWORD" on Line 207 of a structure definition.

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

[email protected]

27 / 159

Hex Workshop v6.6

Drive (Sector) Editing

Drive (Sector) Editing

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".

Disk Editing Modes:


Logical Drives are drives mounted by the operating system and are given drive letters like "A:", "C:", "D:", etc. Hex Workshop can edit local drives, some CD-ROM drives, most removable media and floppy drives. You must have proper permission to edit these drives on Windows NT. Physical Drives are the drives installed in your computer and are labeled as 0x80 for the first hard disk, 0x81 for the second, etc. You should edit physical drives when the operating system cannot mount your logical drive or you need to view and/or modify partition tables or unallocated space.

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

[email protected]

28 / 159

Hex Workshop v6.6

Bookmark Overview

Bookmark Overview Definition


Bookmarks are user defined shortcuts to selected data within a document. Each bookmark is defined by a description, offset, length, array count, and an optional data type. The offset, length and array count components support arithmetic operations and functions (e.g. the value at a particular offset). Bookmarks can also reference Structure Definitions. Structure references combined with the ability to calculate offsets and sizes within the bookmark definition enables complete parsing of many file formats. Bookmarks are tied to a single document as opposed to being shared across multiple documents. This design allows you to maintain distinct bookmark collection for each document. Bookmarks can also be associated with file extensions and automatically applied when a document is opened. File associates are defined in the Bookmark Properties or through Preferences.

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.

This behavior can be changed from the Hex Workshop Preferences.

Bookmark Toolbar
Open a new bookmark collection

[email protected]

29 / 159

Hex Workshop v6.6


Save the bookmark collection Clear all bookmarks (unsaved bookmarks will be lost) Set the editor caret to the start of the bookmark data Select the bookmark data within the editor Add a new bookmark Remove the selected bookmark Edit the bookmark definition Refresh the bookmarks. Refreshing the bookmark list will re-apply any functions within the bookmark data. This is often needed if bookmarks reference data at fixed locations and that has been changed within the editor.

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

[email protected]

30 / 159

Hex Workshop v6.6

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".

Bookmark Results Window


Right click within the Bookmark Results Window and 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

[email protected]

31 / 159

Hex Workshop v6.6

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

Count Sequential Address

[email protected]

32 / 159

Hex Workshop v6.6


bookmark. The default is checked (or true), however, one may want to change this if the address is based on a calculation. Count Fixed Length Determines whether array bookmarks should use the length of the first bookmark or if the length should be recalculated each time. The default is checked (or true), however, one may want to change this if the address is based on a calculation. Identifies the data type for this bookmark. The bookmark results window will display the document data rendered as this type. Additionally, within the bookmarks results window, you can edit the bookmark in its native interpretable data type. Identifies the byte order for this bookmark. This parameter is only valid if a interpretable data type is selected. Identifies the structure providing the details of a complex data type. You must associate a structure with the bookmark collection before you can choose a structure. Structures are associated with a bookmark collection through the Bookmark Properties dialog. Please see the Structure Viewer for more information on structures.

Editing a Bookmark

Interpret Data As Type

Interpret Data As Byte Order Interpret Data As Structure

Address / Length Functions and Operators


+ * / % & | ^ << >> UByteAt(OFFSET) UShortAt(OFFSET) Addition. Subtraction. Multiplication. Division. Modulus Division. Bitwise AND Bitwise OR Bitwise XOR Bitwise Left Shift Bitwise Right Shift Unsigned 8 bit value at a specified offset. Unsigned 16 bit Little Endian value at a specified offset. Use byteflip16(UShortAt(OFFSET)) to interpret the value as Big Endian Unsigned 32 bit Little Endian value at a specified offset. Use byteflip32(ULongAt(OFFSET)) to interpret the value as Big Endian Unsigned 64 bit Little Endian value at a specified offset. Use byteflip64(UQuadAt(OFFSET)) to interpret the value as Big Endian

ULongAt(OFFSET)

UQuadAt(OFFSET)

[email protected]

33 / 159

Hex Workshop v6.6


last start Ending position of the last bookmark Position of the caret when the bookmark was originally added. Array index of the bookmark. This is only useful if a bookmark has a repetition count of greater than 1. Otherwise, this value will always be 0. The length of the document file being viewed/editing within Hex Workshop. Flip bytes assuming 16-bit value Flip bytes assuming 32-bit value Flip bytes assuming 64-bit value

Editing a Bookmark

arrayindex

filelength

byteflip16(VALUE) byteflip32(VALUE) byteflip64(VALUE)

Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

34 / 159

Hex Workshop v6.6

Opening and Saving Bookmarks

Opening and Saving Bookmarks Recalling Bookmarks


1. Bring the desired document into focus. 2. Press the Open Bookmark Collection toolbar button or Select "Bookmarks" from the "Tools" menu and choose "Select Bookmarks" from the popup menu. 3. Select a previously saved bookmark file.

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

[email protected]

35 / 159

Hex Workshop v6.6

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.

Bookmark Property Attributes


Description Author Structures Provides an overall description for all bookmarks within this document's bookmark collection. Names the original author of this bookmark collection. Identifies the set of structures used by this bookmark collection. Only one structure definition library can be associated with a collection of bookmarks. Once defined, one can select a structure definition in the bookmark editor. Defines a list of extensions for this bookmark collection. Hex Workshop will automatically load this bookmark collection for any files which match the extension list. To associate the collection with multiple file extensions, use a ";" as a delimiter. For example: .ext1;.ext2;.ext3 NOTE: Extensions are stored on the local PC and are not defined as part of the bookmark collection. File Displays the filename and path of the bookmark collection. This area will be blank if the bookmark collection has not been saved (as demonstrated above).

File Extensions

Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

36 / 159

Hex Workshop v6.6

Color Highlighting Overview

Color Highlighting Overview


Hex Workshop features a powerful color highlighting mechanism within the editor to help users find interesting data. Color highlights are defined through the Color Preferences, Color Priority Preferences, and Color Maps. Users can specify the foreground, background, and border rectangle colors for both the hex and text areas of the editor. The various color attributes are merged and applied using prioritizes to maximize the data representation and value to the user. Hex Workshop also displays popup windows when the user mouse cursor hovers a color highlighted area with information on the data.

Color Highlight Attributes


Foreground Color: Users can set unique foreground (text) colors for both the hex and text areas within the editor. Background Color: Users can set unique background colors for both the hex and text areas within the editor. Border Rectangle: Users can set a unique line colors for both the hex and text areas within the editor. Hex Workshop applies border rectangle around a blocks of highlighted data (as opposed to each byte contained within it).

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

[email protected]

37 / 159

Hex Workshop v6.6

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.

Character Distribution Histogram


The Histogram shows the number of times each byte is present in the file. Users can scroll over each character to see the number of instances of each character.

Clicking on the graph selects that character in the Character Distribution List and populates the Character Distribution Bitmap for that character.

[email protected]

38 / 159

Hex Workshop v6.6

Character Distributions

Character Distribution List


The Distribution List shows the count for each character in the users document. Selecting a character populates the Distribution Bitmap.

Sort the Distribution List by clicking on the column headers.

Character Distribution Bitmap


The Distribution Bitmap shows the distribution of each character across the document. Mouse over the bitmap to view the number of instances of the character.

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

[email protected]

39 / 159

Hex Workshop v6.6

Checksum Generator

Checksum Generator Generating Checksums and Digests


The Checksum Generator allows users to generate checksums and digests for an entire document or a selection within a document and is started by select "Generate Checksum ..." from the "Tools" menu or by pressing the checksum button on either the main Tools toolbar or checksum toolbar (located on the Checksum tab of the Results Window).

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.

Checksum and Digest Algorithms


The Checksum Generator supports 23 checksum and digests variations: Algorithm Checksum (8 bit) Bytes 1 Description Simple count where all the bytes are added in an 8 bit accumulator. Initial value is 0. Simple count where all the bytes are added in an 16 bit accumulator. Initial value is 0. Simple count where all the bytes are added in an 32 bit accumulator. Initial value is 0. Simple count where all the bytes are added in an 64 bit accumulator. Initial value is 0. 16 bit Cyclic Redundancy Check (CRC) with a polynomial of 0x8005 and an initial value of 0x0000. 16 bit Cyclic Redundancy Check (CRC) with a polynomial of 0x1021 and an initial value of 0xFFFF. 32 bit Cyclic Redundancy Check (CRC) with a polynomial of 0x04C11DB7 and an initial value of 0xFFFFFFFF. 16 bit Cyclic Redundancy Check (CRC) with a user supplied polynomial and initial value.

Checksum (16 bit)

Checksum (32 Bit)

Checksum (64 bit)

CRC (16 Bit)

CRC/CCITT (16 bit)

CRC (32 bit)

Custom CRC (16 bit)

[email protected]

40 / 159

Hex Workshop v6.6


Custom CRC (32 bit) 4 32 bit Cyclic Redundancy Check (CRC) with a user supplied polynomial and initial value. MD2 Message-Digest Algorithm (RSA Data Security, Inc.) MD4 Message-Digest Algorithm (RSA Data Security, Inc.) MD5 Message-Digest Algorithm (RSA Data Security, Inc.) 160 bit Secure Hash Algorithm (NIST) 224 bit Secure Hash Algorithm (NIST) 256 bit Secure Hash Algorithm (NIST) 384 bit Secure Hash Algorithm (NIST) 512 bit Secure Hash Algorithm (NIST) 128 bit RACE Integrity Primitives Evaluation Message Digest (RIPEMD) 160 bit RACE Integrity Primitives Evaluation Message Digest (RIPEMD) 256 bit RACE Integrity Primitives Evaluation Message Digest (RIPEMD) 320 bit RACE Integrity Primitives Evaluation Message Digest (RIPEMD) 192 bit Tiger Digest Algorithm 512 bit Whirlpool Hash Algorithm

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

Viewing Checksum Results


Checksums and digests are displayed in the Checksum tab of the Results Window (Ctrl+W).

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.

[email protected]

41 / 159

Hex Workshop v6.6


Copying checksum and digests

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.

Regenerating Checksums and Digests


Checksums can be refreshed by either re-launching the Checksum Generator or by pressing the refresh button (button with 2 rounded arrows) on the Checksum tab of the Results Windows. Refreshing a checksum maintains the selected algorithms and selection parameters (entire document or a block within a document). The document must be open within the editor to refresh a checksum. Hex Workshop automatically replaces checksum results generated on a particular file to reduce confusion. It is not possible to display the checksum result of a particular algorithm before and after an edit without creating a new document.

Hiding and Showing Table Columns


Columns can be shown or hidden by right clicking anywhere on the Checksum tab of the Results Window and selecting the "Columns" sub-menu from the popup context menu. A description of the columns and default state is included below: Column Document Default Shown Description The file name portion of the document used to render the checksum or digest. Selecting a checksum element displays the full path on the top-left of the Checksum tab. Starting offset used to generate the checksum or digest. Length of data used to generate the checksum or digest. The algorithm used to generate the checksum or digest. Decimal checksum value Hex checksum or digest value

Offset Length Algorithm Checksum Checksum/Digest

Hidden Hidden Shown Shown Shown

Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

42 / 159

Hex Workshop v6.6

Color Mapping Overview

Color Mapping Overview


The Color Mapping feature of Hex Workshop helps users visually identify data patterns, add visual cues, and deemphasize uninteresting data by modifying the display properties of user defined byte patterns and ranges. All of the Color Mapping commands are accessible from the "Tools" menu, under the "Color Mapping" sub menu. From this menu, you can add a new color map, editing existing color maps, clear all color maps, save color mappings, and recalling color maps. An add Color Mapping toolbar button is also available on the editor's "Tools" toolbar. For additional information, please see: Adding a Color Map Editing Color Maps Opening and Saving Color Maps Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

43 / 159

Hex Workshop v6.6

Adding a Color Map

Adding a Color Map


The Add Color Mapping dialogs allow you to define a color mapping byte sequence and the display parameters used when viewing that byte sequence.

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".

Color Mapping Attributes


Hex Sequence Defines the byte sequence in hex displayed in a special foreground and background color. The maximum byte sequence is 64 characters; any data entered beyond 32 bytes is ignored. Check to define separate rendering properties for the hex and text display within the editor. A description of the color mapping. This string is displayed in a tooltip when mouse cursor hovers for highlighted data in the editor. Selects the foreground color used to display the specified hex sequence. If no color is selected (unchecked), the default text color will be used. Background Color Selects the background color used to display for the specified hex sequence. If no color is selected (unchecked), the default color will be used. Rectangle Color Selects the color of rectangle drawn around the highlighted data. If no color is selected (unchecked), the default color will be used. Unless another color highlight sets a rectangle, no rectangle will be displayed.

Separate hex and text view colors Description Text Color

[email protected]

44 / 159

Hex Workshop v6.6


For additional information, please see: Color Mapping Overview Editing Color Maps Opening and Saving Color Maps Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

Adding a Color Map

[email protected]

45 / 159

Hex Workshop v6.6

Editing Color Maps

Editing Color Maps


To edit color maps, select the "Tools" menu, then "Color Mapping", and then "Editing Mappings" from the sub menu. This will launch Microsoft Window's Notepad editor to modify an ASCII text file containing your color maps definitions. The Color Map file can include author/description meta data along with the color definitions. Users can create color maps for both hex strings and character ranges. Only hex strings can be added from the Add Color Map dialog; however, all of the information is persisted, except comments. The order of color map definitions is not important. Hex Workshop internally sorts the color maps by hex sequence length prior to applying them. If color maps overlap, Hex Workshop selects the more complex (longer) color map over shorter ones.

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"

Color map Definitions


Color maps are defined in the following form: <Hex Sequence> = <Color Definition > or <Character Range> = <Color Definition >

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

[email protected]

46 / 159

Hex Workshop v6.6

Editing Color Maps

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:

Hex Area Foreground Color Background Color Border Rectangle Color


hexFgRGB hexBgRGB hexRectRGB

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)

[email protected]

47 / 159

Hex Workshop v6.6


A complete color map file including the examples above, might look like the following:

Editing Color Maps

############################################################################## # 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

[email protected]

48 / 159

Hex Workshop v6.6

Opening and Saving Color Maps

Opening and Saving Color Maps Menu


Color Maps can be opened (recalled) or saved from the "Tools", "Color Mapping" menu.

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

[email protected]

49 / 159

Hex Workshop v6.6

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

[email protected]

50 / 159

Hex Workshop v6.6

Compare Tool: Simple Compare

Compare Tool: Simple Compare


The Simple Compare Tool (Ctrl+K ) allows you to quickly and easily find differences within two files. After selecting your files and pressing the "OK" button, Hex Workshop will select the first difference found in your documents. The compare tool starts looking for differences as offset 0 in both documents. You can change this behavior and set a alternative starting offset by pressing the "Advanced" button in the original Compare Dialog. Any future comparisons use the current cursor position. Select Next Difference from the Tools:Compare menu or press F6 to find the next difference. Select Previous Difference from the Tools:Compare menu or press Shift+F6 to find the previous difference. If any data was inserted or deleted, you will need to manually adjust your cursor position. Alternatively, you can use the resynchronizing compare tool. NOTE: You should not see anything in the compare tab of the results control as that window is used for resynchronizing compares. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

51 / 159

Hex Workshop v6.6

Compare Tool: Resynchronizing Compare

Compare Tool: Resynchronizing Compare


The Resynchronizing Compare Tool (Ctrl+K ) allows you find differences between two files. This technique is much more time consuming than a simple compare, however the analysis yields detailed information on what blocks of data have been inserted, deleted, replaced, or are matching. After the analysis completes, the differences are presented in the Compare tab of the results control window:

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

[email protected]

52 / 159

Hex Workshop v6.6

Advanced Compare Options

Advanced Compare Options

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

[email protected]

53 / 159

Hex Workshop v6.6

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.

Managing Data Inspector Data Types


Right click on the data inspector window and select "Manage List" to hide and show data inspector types.

Showing/Hiding the Data Inspector


The Data Inspector can be toggled on/off (shown/hidden) from the Options Menu, the Data Inspector right-click context menu or by pressing Ctrl+I. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

54 / 159

Hex Workshop v6.6

Data Visualizer

Data Visualizer Overview


The Data Visualizer allows users to view a bitmap representation of their document contents to help identify patterns within their data. By selecting or creating different color palettes users can quickly identify text sequences within binary data, patterns and repeating data, tables, and even palette-based images.

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.

Reverse Grey Scale

[email protected]

55 / 159

Hex Workshop v6.6


The reverse grey reverses the palette order of the grey scale palette. For example, <byte> becomes RGB(255-<byte>, 255-<byte>, 255-<byte>).

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.

Set Editor Caret Position and Selection


Mouse-Over location
When users move the mouse over the visualizer bitmap, the cursor position displayed in the Status Bar is updated to show the offset within the document.

Clicking within the Visualizer Bitmap


Pressing the left mouse button while on the Visualizer bitmap will set the caret position within the editor window.

Selecting within the Visualizer Bitmap


Users can select data within the Visualizer Bitmap (and editor) by either: 1. Pressing the left mouse button and dragging the mouse pointer to the ending location. 2. Pressing the left mouse button to set the start location and holding the shift key while pressing the left mouse button to select the ending position. Both selection methods will update the selection indicator in the Status Bar.

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.

[email protected]

56 / 159

Hex Workshop v6.6


Zoom In (Keyboard: '+')
Zoom in decreases the height of the Visualizer boxes.

Data Visualizer

Zoom Out (Keyboard: '-')


Zoom out increases the height of the Visualizer boxes.

Match Editor Row Length (Keyboard: <space>)


Set the Visualizer row length to match the editor row length. The number of bytes displayed per row will automatically adjust as the editor view is adjusted by sizing or through the General Display Options Preferences.

Increase Row Length (Keyboard: <right arrow>)


Increases the number of bytes displayed per row in the Visualizer. The maximum number of rows displayed is limited by the width of the Data Visualizer window. Increase the window size by dragging the window frame to allow for larger row lengths.

Decrease Row Length (Keyboard: <left arrow>


Decreases the number of bytes displayed per row in the Visualizer.

Set Row Length


Defines a specific row length. The row length will be reset if the window is sized smaller than the designated row length.

Refresh (Keyboard: F5)


Forces a repaint of the 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

[email protected]

57 / 159

Hex Workshop v6.6

Expression Calc

Expression Calc Overview


The Expression Calc doubles as a simple calculator supporting arithmetic and bitwise operations, as well as scripting extension to Hex Workshop, supporting variables, document manipulation, and conditional expressions. The calculator uses the same expression parsing and evaluation engine that Hex Workshop uses for functions defined as part of the Structure Viewer.

Layout

Sign and Size


The sign and size drop down lists control the sign and type of data used for the expression.

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.

Sign and Data Type


The sign and data type selections are used to render the final evaluation results and any literal values within the expression. Some expression functions require specific data type sizes and will report an error if the data type is too small (e.g. invoking getDWordAt(...) when the data type is set to 16 bits).

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).

[email protected]

58 / 159

Hex Workshop v6.6

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)

Interpret Byte Order As


Controls the byte order used to interpret hexadecimal strings (e.g. 0x00FF) and the byte order used to render the results. By default the Expression Calc displays the results based on the Toolbar's Environment Settings for byte order. Options include: Big Endian (Motorola) Little Endian (Intel) Match Toolbar Settings (default)

Place results on clipboard


Controls whether expression results are automatically placed on the clipboard. This option is enabled by default. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

59 / 159

Hex Workshop v6.6

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.

[email protected]

60 / 159

Hex Workshop v6.6


Rotate Left Rotate 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. Rotate Right Rotate 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. Block Shift Left Block shift bits to the left by 1 bit (bits are carried across byte boundaries). This operates at a byte level and can be performed on data blocks of any size. Block Shift Right Block shift bits to the right by 1 bit (bits are carried for across byte boundaries). This operates at a byte level and can be performed on data blocks of any size. XOR Perform XOR (Exclusive OR) on data. 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. OR Perform bitwise OR on data. Requires additional parameter. 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. AND Perform bitwise AND on data. Requires additional parameter. 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. Change Sign Change sign from negative to positive or from positive to negative. This operation can be performed on 8 bit, 16 bit, 32 bit, and 64 bit integers and float or doubles under Big Endian or Little Endian byte order. Add Add value to data. This operation can be performed on 8 bit, 16 bit, 32 bit, and 64 bit integers (signed or unsigned) and float or doubles under Big Endian or Little Endian byte order. Subtract Subtract value from data. This operation can be performed on 8 bit, 16 bit, 32 bit, and 64 bit integers (signed or unsigned) and float or doubles under Big Endian or Little Endian byte order. Multiply Multiply data by a value. This operation can be performed on 8 bit, 16 bit, 32 bit, and 64 bit integers (signed or unsigned) and float or doubles under Big Endian or Little Endian byte order. Divide Divide data by a value. This operation can be performed on 8 bit, 16 bit, 32 bit, and 64 bit integers (signed or unsigned) and float or doubles under Big Endian or Little Endian byte order. Modulo Division Perform modulo division on data.

Data Operations

[email protected]

61 / 159

Hex Workshop v6.6


This operation can be performed on 8 bit, 16 bit, 32 bit, and 64 bit integers (signed or unsigned) and float or doubles under Big Endian or Little Endian byte order. Set Floor Value Sets the minimum/floor value. If any values are lower than the specified value, then the value is replaced with another value. This operation can be performed on 8 bit, 16 bit, 32 bit, and 64 bit integers (signed or unsigned) and float or doubles under Big Endian or Little Endian byte order. Set Ceiling Value Sets the maximum/ceiling value. If any values are greater than the specified value, then the value is replaced with another value. This operation can be performed on 8 bit, 16 bit, 32 bit, and 64 bit integers (signed or unsigned) and float or doubles under Big Endian or Little Endian byte order. Upper Case Lower Case Swap Case Convert ASCII characters to upper case. Non-alphabetic characters are not changed. Convert ASCII characters to lower case. Non-alphabetic characters are not changed. Swaps the case of ASCII characters: lower case becomes upper case, uppercase becomes lower case, non-alphabetic does not change.

Data Operations

Hex Workshop will prompt you when additional parameters are required. A sample dialog is shown below:

Treat Data As:


Hex Workshop needs to interpret the data as a decimal value for most data operations. For example, rotating 4 individual bytes will yield different results than rotating a single long which is 4 bytes in length. Signed vs Unsigned status is only used for arithmetic operations.

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.

[email protected]

62 / 159

Hex Workshop v6.6


Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

Data Operations

[email protected]

63 / 159

Hex Workshop v6.6

Export and Clipboard Formats

Export and Clipboard Formats


Hex Workshop includes the capability to both export and copy hex as formatted text (RTF), text, and HTML, for publishing; C source and Java Source for inserting into code for development; and Motorola S-Records and Intel Hex Code. Hex Workshop v4.2 added support for Base64 and UUEncoding. Exporting is accomplished using the FileExport Menu and copying to the windows clipboard is performed using the Edit-Copy As Menu. Format settings can be adjusted from Hex Workshop Preferences. Below are some samples of the different formats: Rich Text Format (RTF): 00000000 00000010 00000020 00000030 Text: 00000000 00000010 00000020 00000030 HTML: <html> <head> <title> HWS5383 </title> </head> <body bgcolor="#FFFFFF"> <h1><center>HWS5383</center></h1> <meta name="GENERATOR" CONTENT="Hex Workshop"> <hr> <pre><code> <font color="#000000">00000000 </font><font color="#0000FF">4D5AC600 </font><font color="#004080">B6000000 </font><font color="#0000FF">15040100 </font><font color="#004080">FFFF0000 </font><font color="#000000">MZ.............. 00000010 </font><font color="#0000FF">00000000 </font><font color="#004080">00010000 </font><font color="#0000FF">1E000000 </font><font color="#004080">01000000 </font><font color="#000000">................ 00000020 </font><font color="#0000FF">00000000 </font><font color="#004080">00000000 </font><font color="#0000FF">00000000 </font><font color="#004080">00000000 </font><font color="#000000">................ 00000030 </font><font color="#0000FF">00000000 </font><font color="#004080">00000000 </font><font color="#0000FF">00000000 </font><font color="#004080">00000000 </font><font color="#000000">................ </font> </code></pre> <hr> <font size="-3"> Generated by <a href="http://www.bpsoft.com">Hex Workshop</a> </font> </body> </html> C Source: // Generated by BreakPoint Software's Hex Workshop v3.10 4D5AC600 00000000 00000000 00000000 B6000000 00010000 00000000 00000000 15040100 1E000000 00000000 00000000 FFFF0000 01000000 00000000 00000000 MZ.............. ................ ................ ................ 4D5AC600 00000000 00000000 00000000 B6000000 00010000 00000000 00000000 15040100 1E000000 00000000 00000000 FFFF0000 01000000 00000000 00000000 MZ............ .............. .............. ..............

[email protected]

64 / 159

Hex Workshop v6.6


// // // // // // http://www.hexworkshop.com Source: hworks32.exe Time: 5/2/2000 9:08 AM Offset: 0 / 0x00000000 Length: 64 / 0x00000040

Export and Clipboard Formats

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, } ;

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,

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,

8 bit Intel Hex Code: :140000004D5AC600B600000015040100FFFF000000000000B1 :14001400000100001E000000010000000000000000000000B8 :140028000000000000000000000000000000000000000000C4 :04003C0000000000C0 :00000001FF

Motorola S28 Records: S00600004844521B S2180000004D5AC600B600000015040100FFFF000000000000AC S218000014000100001E000000010000000000000000000000B3 S2180000280000000000000000000000000000000000000000BF S20800003C00000000BB S804000000FB

Base64: TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAA4AAAAA== UUEncoding: begin 666 BinDiff.exe

[email protected]

65 / 159

Hex Workshop v6.6


M35J0 , $ __\ +@ 0 3 X end

Export and Clipboard Formats

Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

66 / 159

Hex Workshop v6.6

Find Utility

Find Utility Overview


The Find Utility (Ctrl+F), located under the Edit menu, allows you to search for a hex, ASCII, decimal values, or bitmasks within a file or disk. There are toolbar buttons that can be used as a shortcut for the Find Utility: Initiates a new search or find. Search for the next occurrence of a previous search. The default keycut is F3 or select Find Next under the Edit Menu. Search for the previous occurrence of a search. The default keycut is Shift+F3 or select Find Previous under the Edit Menu. Initiate a new search and replace task.

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 Text String


When searching by Text, users can opt to search for 8-bit characters, 16 bit characters (Unicode) or both. Additionally, users can opt for a case sensitive or insensitive search using the Match Case check box.

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.

Find All Instances


If "Find All Instances" is selected, all occurrences of that search string are displayed in the Find Results Window. Within

[email protected]

67 / 159

Hex Workshop v6.6


the Find Results Window the user can use the up and down cursor keys to navigate through search results.

Find Utility

Document Range Tab

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.

Sector Range Tab

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

[email protected]

68 / 159

Hex Workshop v6.6

Find Results Window

Find Results Window


The Find Results Window displays the results of Find Strings or a Find when "Find All Instances" is selected. The window is located on the Find tab of the Results Window. Example output from executing Find Strings on notepad.exe:

Example output from executing Find All Instances (including the right-click context menu):

Working with find results


Selecting one of the rows in the Find Results Window scrolls the found area into the editor window based on the user's indicated Find Tool Option Preferences. Users can use the up and down cursor keys to move between find results. Press the Press the Press the button to set caret position to the start of found data and return input focus to editor window. button to select the found data within the editor and return input focus to the editor window. button to remove all contents from the Find Results window.

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.

Copying Address or Value


Right click on a row and select Copy Address or Copy Value, to place either the finding's address or value on the clipboard.

Applying Structures and Bookmarks


Users can apply Structure or Bookmarks to one or more find results in single action by selecting "Apply Bookmark..." or "Apply Structure..." from the right-click context menu. 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:

[email protected]

69 / 159

Hex Workshop v6.6


00000077 00000206 00000496 00000535 00000575 00000616 00000655 00000695 00000880 00000893 00000906 00000916 00000926 00000937 00000948 00000040 00000006 00000005 00000007 00000006 00000006 00000006 00000007 00000012 00000012 00000009 00000009 00000010 00000010 00000012 !This program cannot be run in DOS mode. \zRich .text `.rdata @.data .pdata @.rsrc @.reloc ADVAPI32.dll KERNEL32.dll NTDLL.DLL GDI32.dll USER32.dll msvcrt.dll COMDLG32.dll Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

Find Results Window

[email protected]

70 / 159

Hex Workshop v6.6

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

[email protected]

71 / 159

Hex Workshop v6.6

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.

Requires trailing Null:


Restricts strings to those strings that end with a NULL (or zero) character.

ASCII, Unicode, Both:


Find Strings can report ASCII strings, ASCII strings stored as Unicode, or both ASCII and Unicode. The default is "Both", however selecting only ASCII or Unicode will quicken the search.

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

[email protected]

72 / 159

Hex Workshop v6.6

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

[email protected]

73 / 159

Hex Workshop v6.6

Goto Toolbar Overview

Goto Toolbar Overview


The Quick Goto Toolbar control allows users to quickly jump to offsets in an active document.

Goto Absolute Address


To jump to an absolute address in a document, either that address in the Quick Goto box and press enter. Prefix addresses with "0x" for hex addresses. For example, to jump to position 32 in the file, enter either:

or

and press the Enter key.

Goto Relative Address


To jump to an address relative to the current caret position, prefix your address with either "+" to jump forward or "-" to jump backwards. To jump 100 bytes forward, enter:

and press the Enter Key To jump 64 bytes backwards, enter:

and press the Enter Key

Repeat Previous Goto


The Quick Goto control includes a list of the most recently used goto sequences. Select an item from the drop down list to repeat a jump. Alternatively, the Goto Next and Goto Previous toolbar buttons will update the caret position if the last goto sequences was a relatively address (+<value> or -<value). Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

74 / 159

Hex Workshop v6.6

Structure Viewer Overview

Structure Viewer Overview


The Hex Workshop Structure Viewer helps you view and edit binary data in a convenient and natural format. In the screen capture below, an example is shown of a .ZIP file header in the Structure Viewer. The file is shown as a structured set of data types instead of a series of hexadecimal values. In order to work with data files in the Structure Viewer, perform the following steps: 1) Define your structures and package them into a Structure Library 2) Selected your structure library within Hex Workshop 3) Add individual structures to the Structure Viewer window. Please review Structure Libraries, Defining a Structure and Adding a Structure for more information on steps 1, 2, and 3 above. The rest of this topic will focus on viewing and working with structures.

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.

Mapping Structure to Document View


Once a structure is added, selecting the top element (or root node) of the structure highlights the all of the structure's binary data within the document view of your file. Selecting a single row within the structure will highlight only that row's data. The default highlight color is a green foreground on a white background. You can alter the default foreground and background colors of the data selected in the document view in the Color Settings Display Options Preferences.

Editing Structured Data


To modify the structure data, you can either edit the binary data in the document view or edit the rendered data within the structure viewer. To edit data within the structure view either: - Click on the data within the "Value" column of the Structure Viewer. - Selected the data that you wish to modify in the Structure Viewer and press the "F2" key. Pressing the "Enter" key, or clicking the mouse off of the editor will valid and accept your changes. If you wish to abort a change while editing, press the "Esc" key.

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

[email protected]

75 / 159

Hex Workshop v6.6


View Validation results Goto start of structure in Editor Goto end of structure in Editor Selection Structure Contents in Editor Refresh All Structures

Structure Viewer Overview

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

[email protected]

76 / 159

Hex Workshop v6.6

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.

[email protected]

77 / 159

Hex Workshop v6.6


Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

Adding a Structure

[email protected]

78 / 159

Hex Workshop v6.6

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

[email protected]

79 / 159

Hex Workshop v6.6

Structure Libraries

Structure Libraries Definition


A structure library (.hsl file) contains 1 or more Hex Workshop Structure Definitions. Each structure definition can be used to render binary data into structured data within the Hex Workshop Structure Viewer. This is a powerful and useful feature, with the following limitations: - Structure definitions are limited to a set of predefined basic data types, type definitions, and other structures/enumerations. - A structure can only reference another structure defined before it within the same Structure Library (or an included library). - Only one structure library can be active at any point in time. It is recommended that you save structures in the "Structures" directory created during installation. This directory is created relative to your installation directory and is by default: "C:\Program Files\Hex Workshop <version>\Structures".

Selecting a Structure Library


You can select a structure library using the key cut Ctrl+Shift+L or by selecting "Select Structure Library" from the Structure Viewer's right-click context menu, or by selecting "Select Structure Library" from the "Tools:Structure Viewer" menu. NOTE: You cannot add a structure to the structure viewer before a structure library has been selected.

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

[email protected]

80 / 159

Hex Workshop v6.6

Structure Definition Overview

Structure Definition Overview General Form


A Hex Workshop structure closely resembles a structure definition the C programming language, which is familiar to many developers and easily learned by others. Future versions of Hex Workshop will incorporate a structure building tool along with the ability to extract structures from existing C/C++ source files. The following is an example of a Hex Workshop Structure definition. Both C++ comments ("// COMMENT") and C comments( "/* COMMENT */") are supported. /* * LocalFileHeader for a .ZIP compressed file. */ struct LocalFileHeader { char Signature[4]; // PK<0x03><0x04> #pragma verify match_var_int("Signature[0]", "0x50") #pragma verify match_var_int("Signature[1]", "0x4B") #pragma verify match_var_int("Signature[2]", "0x03") #pragma verify match_var_int("Signature[3]", "0x04") WORD VersionNeededToExtract; WORD GeneralPurposeBitFlag; WORD CompressionMethod; DOSTIME LastModFileTime; DOSDATE LastModFileDate; DWORD Crc32; DWORD CompressedSize; DWORD UncompressedSize; WORD FileNameLength; WORD ExtraFieldLength; }; The general format of a structure is as follows: struct <<STRUCTURE_NAME>> { <<DATA_TYPES_AND_NAMES>> }; A structure definition begins with the key word "struct" followed by the structure name. The structure name cannot contain any tabs or spaces. An opening brace "{" marks the beginning of the data declaration and a closing brace "}" marks its end. Lastly, a semicolon ";" marks the end of the structure definition.

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;

[email protected]

81 / 159

Hex Workshop v6.6


struct palette { struct ARGB entries[256]; };

Structure Definition Overview

Defining your own types (typedef)


The typedef keyword allows users to create and name new data types. Each new data type must map to a basic built-in data type or a pre-defined type. The following example creates two 8 bit signed integer data types named "BYTE" and "byte". The struct myTypedefExample then uses a basic type and the newly created data types to create a structure with three 8 bit signed values (b1, b2, and b3). typedef signed __int8 BYTE; typedef BYTE byte; struct myTypedefExample { signed __int8 b1; BYTE b2; byte b3; } ; Users can also typedef structures and enumerations. Typedef must be specified as part of the declaration. The example below defines a new data type POINT and LINE structure. The LINE structure defines the start and end points of the line by naming the full structure (struct tagPOINT) and the typedef name (POINT): typedef struct tagPOINT { LONG x; LONG y; } POINT; struct LINE { struct tagPOINT start; POINT end; };

Including other files (#include)


By adding a #include directive to a structure library definition file, Hex Workshop will insert the literal contents of the designated structure library (#include parameter) into your current structure library file where the #include is defined. For example, all of the sample structure libraries included with Hex Workshop reference a common library that consists of common and standard data types. The #include directive used in the sample libraries is provided below. #include "standard-types.hsl"

Keyword Variables (__this__ and __parent__)


The __this__ and __parent__ variables are used to reference data from the base of the structure or parent structure.

__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;

[email protected]

82 / 159

Hex Workshop v6.6


typedef struct PARENT_2 { WORD parent2Length; NESTED nested ; } PARENT_2;

Structure Definition Overview

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.

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

83 / 159

Hex Workshop v6.6

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

char unsigned char

signed char

8 8

Signed Unsigned

Treated as String in arrays

__int8 unsigned __int8

Byte signed __int8 UByte

8 8

Signed Unsigned

__int16

Word signed __int16 short UWord unsigned short

16

Signed

unsigned __int16

16

Unsigned

__int32

DWord signed __int32 int long UDWord unsigned int unsigned long

32

Signed

unsigned __int32

32

Unsigned

__int64 unsigned _int64

QWord signed __int64 UQWord

64 64

Signed Unsigned

halffloat

16 16 32

N/A N/A N/A

16-bit half precision float (IEEE 754-2008)

float double

[email protected]

84 / 159

Hex Workshop v6.6


DATE 64 16 16 64 32 64 N/A N/A N/A N/A N/A N/A Microsoft OLE Date/Time structure. MS-DOS style time. MS-DOS date time. Window FILETIME structure. ANSI C time_t structure. ANSI C time64_t structure.

Data Types

DOSDATE DOSTIME FILETIME time_t time64_t

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

[email protected]

85 / 159

Hex Workshop v6.6


To utilize these standard types, please add the following line to the top of your structure library: #include "standard-types.hsl"

Data Types

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols.

Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

86 / 159

Hex Workshop v6.6

Enumerated Types

Enumerated Types Overview


Enumerated types allow users to couple human readable names with numeric values. When an enumeration is defined, Hex Workshop allows you to view and work with the human readable names within the editing environment. Enumerated types are defined similarly to structures. The general form begins with the "enum" keyword, followed by the enumeration name, an opening brace "{", enumeration definitions, a closing brace "}", and a trailing semicolon ";". Enumeration values may be specified in decimal or hex. To specify an enumeration value in hex, prefix the hex value with "0x". enum <ENUM_NAME> { <ENUM_DEFINITIONS> }; typedef enum <ENUM_NAME> { <ENUM_DEFINITIONS> } <ENUM_NAME>;

Controlling Enumeration sign and size


The sign and size of the enumeration is control through the #pragma enumsign and #pragma enumsize Library Settings.

Using Enumerations as Constants


Users can use enumerations as constants where an expression is expected. See the __verify statement at the end of the example: #pragma enumsize(4) #pragma enumsign("unsigned") typedef enum tagSIGNATURE { LocalFileHeader ArchiveExtraData EndOfCentralDirectory DigitalSignature CentralDirectoryFileHeader ZIP64EndOfCentralDirectory ZIP64EndOfCentralDirectoryLocator } SIGNATURE ;

= = = = = = =

0x04034B50, 0x08064B50, 0x06054B50, 0x05054B50, 0x02014B50, 0x06064B50, 0x07064B50

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

[email protected]

87 / 159

Hex Workshop v6.6


FindExSearchMaxSearchOp }; enum myOtherExample { MY_STARTING_VALUE = 100, MY_NEXT_VALUE_1, MY_NEXT_VALUE_2, MY_RESET_VALUE = 200, MY_NEXT_VALUE_3, MY_OTHER_VALUE = 0x10 }; // Value: 3

Enumerated Types

// // // // // //

Value: Value: Value: Value: Value: Value:

100 101 102 200 203 16

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

88 / 159

Hex Workshop v6.6

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]; };

// 16 bits worth of length // Actual string content

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]; };

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

89 / 159

Hex Workshop v6.6

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]; }; };

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

90 / 159

Hex Workshop v6.6

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.

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

91 / 159

Hex Workshop v6.6

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.

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

92 / 159

Hex Workshop v6.6

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 {

[email protected]

93 / 159

Hex Workshop v6.6


UWord len_type; switch (len_type) { case 1: UByte length; break; case 2: UWord length; break; default: UDWord length; break; } blob data[length]; };

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 { } ;

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

94 / 159

Hex Workshop v6.6

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 ; } ; } ; }

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

95 / 159

Hex Workshop v6.6

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>>")

[email protected]

96 / 159

Hex Workshop v6.6


NOTE: The variable and value must be quoted. MATCHTYPE match_var_int Description

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")

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

97 / 159

Hex Workshop v6.6

Library Settings

Library Settings Overview


Structure Definitions support various #pragma directives to control the properties of structure definitions. Like C/C++ pragma usage, the directives can be placed in different locations to control properties of elements defined after it. Exception: the fileextensions, and displayname #pragma directives must only allow to appear once. Library Setting #pragma directives must be defined outside of a structure, enumeration, or function declaration. Some exception exist.

With Library #pragma directives, users can control:


Display Name of the Structure Library Expected File Extensions Whether structures are shown/hidden when adding Byte Order Pointer Size Maximum Array and String lengths Enumeration Size and Sign

#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 byteorder(<byte order type>)


The byte order directive controls the interpretation of document data (in either Little Endian or Big Endian byte order). Options include little_endian, big_endian, and environment. The Environment setting will use the byte order set on the Environment Toolbar. #pragma byteorder(little_endian) #pragma byteorder(big_endian) #pragma byteorder(environment)

#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

[email protected]

98 / 159

Hex Workshop v6.6


to hang while processing. #pragma maxarray(2048); // Increase the max array length to 2048

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.

[email protected]

99 / 159

Hex Workshop v6.6

Library Settings

#pragma pack(n)
Not yet implemented

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

100 / 159

Hex Workshop v6.6

Structure Settings

Structure Settings Overview


Structure Definitions support various #pragma directives to control the properties of structure definitions. Like C/C++ pragma usage, the directives can be placed in different locations to control properties of elements defined after it. Structure Setting #pragma directives must be defined within a structure definition.

With Structure #pragma directives, users can control:


Pointer Size Suggested location

#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.

#pragma lockAt(n) #pragma floatAt(n)


The lockAt and floatAt pragma commands are used to suggest an initial locked or floating offset. If specified, the add structure dialog will pre-populate the offset and float/locked options when adding a structure.

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; };

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols.

[email protected]

101 / 159

Hex Workshop v6.6


Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

Structure Settings

[email protected]

102 / 159

Hex Workshop v6.6

Reserved Words and Symbols

Reserved Words and Symbols


The following strings are reserved by Hex Workshop and cannot be used as structure or variable names:

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:
// /* */ ; { } [ ] ( ) , ? : + - * / % & | ~ ^ << >> == != || && < <= > >= = += -= *= /= %= &= |= ^= <<= >>= ++ --

More Information on Structure Definitions


Definition Overview, Data Types, Enumerated Types, Arrays, Strings, Bitfields, Expressions, Conditionals, Functions, Verification, Library Settings, Structure Settings, and Reserved Words and Symbols. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

103 / 159

Hex Workshop v6.6

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

$(CurrOffsetDec) $(CurrOffsetHex) $(CurrSelectionDec) $(CurrSelectionHex)

Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

104 / 159

Hex Workshop v6.6

Expressions Overview

Expressions Overview Overview


Expressions are used by the Expression Calc and by the Structure Viewer. Expressions include arithmetic, logical, and bitwise operations; arithmetic and document functions; conditional statements; and the creation and manipulation of atomic integer variables.

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.

Single line comments


Users can comment out a single line by entering "//" on that line. All text is ignored from the start of the comment until the next line.

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

[email protected]

105 / 159

Hex Workshop v6.6

Arithmetic Operations

Arithmetic Operations Operators


Operator
+ * / % ( )

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

[email protected]

106 / 159

Hex Workshop v6.6

Bitwise Operations

Bitwise Operations Operators


Operator
& | ^ << >> ~

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

[email protected]

107 / 159

Hex Workshop v6.6

Logical Operations

Logical Operations Overview


Logical Operations enable that comparison of different values and return a boolean (0 for FALSE and 1 for TRUE) indicating the results of the comparison.

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

[email protected]

108 / 159

Hex Workshop v6.6

Arithmetic Functions

Arithmetic Functions Functions


Function
value __min(x, y) value __max(x, y) UWord __byteflip16(x) UDWord __byteflip32(x) UQWord __byteflip64(x)

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

[email protected]

109 / 159

Hex Workshop v6.6

Document Functions

Document Functions Caret and Selection Functions


Function
UQWord __getCaretPos()

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)

Set the selection length within the active document window.

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.

Document Reading Functions


Function
UQWord __getDocSize() Byte UByte Word UWord DWord __getByteAt(offset) __getUByteAt(offset) __getWordAt(offset) __getUWordAt(offset) __getDWordAt(offset)

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.

UDWord __getUDWordAt(offset) QWord __getQWordAt(offset)

UQWord __getUQWordAt(offset)

Document Manipulation Functions


Function
Byte __setByteAt(offset, value)

Description
Sets (overwrites) the value at the specified offset.

[email protected]

110 / 159

Hex Workshop v6.6


UByte Word UWord DWord __setUByteAt(offset, value) __setWordAt(offset, value) __setUWordAt(offset, value) __setDWordAt(offset, value)

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.

UDWord __setUDWordAt(offset, value) QWord __setQWordAt(offset, value)

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

[email protected]

111 / 159

Hex Workshop v6.6

Conditionals and Loops

Conditionals and Loops Conditionals


if statements
The if statement supports both simple and complex logical operations. if, else, and else if branches are supported with and without open and close braces ('{' and '}'). Unlike many programming languages, a semicolon is required at the end of the final close brace (if used).

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>:

[email protected]

112 / 159

Hex Workshop v6.6


case <expression3>: <expression3a>; <expression3b>; break; default: <expression4a>; <expression4b>; break; };

Conditionals and Loops

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

while loop Form 1:


while <expression1> <expression2>;

Form 2:
while <expression1> { <expression2>; <expression3>; };

for loop Form 1:


for (<init expression>; <control expression>; <post expression>) <expression>;

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

[email protected]

113 / 159

Hex Workshop v6.6

Variables

Variables Declaring Variables


Function
Byte myByte UByte myUByte Word myWord UWord myUWord DWord myDWord UDWord myUDWord QWord myQWord UQWord myUQWord

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

-=

*=

/=

%=

&=

|=

^=

<<=

>>=

++ --

[email protected]

114 / 159

Hex Workshop v6.6

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

[email protected]

115 / 159

Hex Workshop v6.6

Expression Data Types

Expression Data Types

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

[email protected]

116 / 159

Hex Workshop v6.6

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

[email protected]

117 / 159

Hex Workshop v6.6

General Display Options Preferences

General Display Options Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Display documents in Tabbed Workbook Mode


When enabled (checked), Hex Workshop displays a tab for each opened file in list located under the editor window. At the expensive of screen real estate, it allows the user to quickly switch between opened documents. 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.

Fit Contents to Window (automatic bytes per row calculation)


If enabled (checked), Hex Workshop will fill automatically calculate the bytes per row to be displayed in the editor by the size of the window. The maximum displayed byte per row is 128. See Bytes per Row below for more information. The default is enabled.

Bytes per Row


Specifies the amount of data that is displayed for each row (or line) within the editor. Users can specify between 1 and 128 bytes or have the Byte per Row calculated automatically based on the window size (see Fit Contents to Window above). The value must be an even multiple of the column group by length (see below). The default is 16 bytes per row. To enter a fix bytes/row value, "Fit Contents to Window" must be disabled (unchecked). The Byte per Row setting can also be changed in the editor by clicking and dragging the column separators between the hex area and the text area. When updating by dragging columns, the setting is not saved across application restarts

[email protected]

118 / 159

Hex Workshop v6.6

General Display Options Preferences

and is only applied to the active document. Use the preference setting to change the default for all documents.

Show Offset Header


If enabled (checked), Hex Workshop will display a header above the Hex and Text areas within the editor window. The header displays the offset for each of the columns in either hex or decimal and highlights both the current caret position and the mouse-over position.

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.

Display Tooltips and Pop-up Information in editor


Hex Workshop display context information within the editor if you leave the mouse over highlighted data. The default is enabled.

Automatically Flip Bytes In Editor


Hex Workshop includes a feature to swap the byte order of the document data based on the Group Bytes By size. Flipping bytes allow uses to view data in its natural byte order. This settings control whether the Byte Flip Options (Ctrl+Alt+Shift+B) is set when switching between Little Endian and Big Endian byte order from the Environment Toolbar. Default is disabled.

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

[email protected]

119 / 159

Hex Workshop v6.6

Font & Filter Display Options Preferences

[email protected]

120 / 159

Hex Workshop v6.6

Color Settings Display Options Preferences

Color Settings Display Options Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Odd Hex Column Area

Even Hex Column Area

Text Area Separator Line

Offset Caret

Offset Cursor Modified Bytes

[email protected]

121 / 159

Hex Workshop v6.6


Find All Selected Find All

Color Settings Display Options Preferences


Controls the foreground, background, and border rectangle colors for data found as part of a "Find All Instances" search. Controls the foreground, background, and border rectangle colors for a "Find All Instances" item selected in the Find tab of the Results Window. Controls the foreground, background, and border rectangle colors for a structure element selected in the Structure Viewer window. Controls the foreground, background, and border rectangle colors for odd indexed structure element members. The structure selected odd and even settings allow users to view data boundaries of data elements with the editor.

Selected Structure

Selected Structure Odd

Selected Structure Even

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.

Selected Bookmark Unselected Bookmark

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.

Compare Matched Data

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.

Compare Inserted Data

Compare Deleted Data

Compare Replaced Data

Selected Compare Item

Selected Data Inspector Item

[email protected]

122 / 159

Hex Workshop v6.6


Use Default

Color Settings Display Options Preferences

The "Use Default" button reverts the selected color setting back to the original Hex Workshop default.

Use Same colors for Hex and Ascii Areas


If checked, users can specify different color settings for the hex and text areas within the editor. If unchecked, color settings will be used for both the hex and text areas within the editor.

Disable color Highlight in editor


Disabled color rendering for the selected color setting. This options allows users to temporarily disable color settings without clearing selected colors. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

123 / 159

Hex Workshop v6.6

Color Priority Display Options Preferences

Color Priority Display Options Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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

[email protected]

124 / 159

Hex Workshop v6.6

Precision Display Options Preferences

Precision Display Options Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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

[email protected]

125 / 159

Hex Workshop v6.6

Theme Display Option Preferences

Theme Display Option Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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

[email protected]

126 / 159

Hex Workshop v6.6


Pressing "Rename" allows users to change the name of the selected theme.

Theme Display Option Preferences

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

[email protected]

127 / 159

Hex Workshop v6.6

Character Filter Editor

Character Filter Editor

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.

[email protected]

128 / 159

Hex Workshop v6.6


Reverse Map

Character Filter Editor

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

[email protected]

129 / 159

Hex Workshop v6.6

General Configuration Preferences

General Configuration Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Notification of Goto and Find Wrapping


When checked Hex Workshop will prompt the user whether or not to wrap the file (move from the end to the beginning or vice-versa) during the Goto, Find/Replace, or Compare Operations. Default is checked.

Notification if operation exceeds undo buffer size


When checked Hex Workshop will post a warning message (dialog box) before allowing an operation that cannot be undone. Default is checked.

Undo Buffer (KB)


Specifies the size of the buffer used by Hex Workshop for maintaining a list of previous editing operations. This is used when the undo command is selected, the larger the buffer the more operations which can be saved and undone later, if requested. Default is 256 KB.

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.

[email protected]

130 / 159

Hex Workshop v6.6

General Configuration Preferences

Users can view, edit, and create new shortcut sequences for frequently used operations.

Print Page Setup


The Page Setup settings allow users to customize the header, footer, font, displayed bytes per row, and margins for printing. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

131 / 159

Hex Workshop v6.6

Paths Configuration Preferences

Paths Configuration Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

[email protected]

132 / 159

Hex Workshop v6.6


Structures

Paths Configuration Preferences


The default directory used to find structure definition files. Options: Installation default or used-defined.

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.

Used Last <setting> Directory


Check to use the last-used directory or Uncheck to specify a path.

Use Default Directory


Check to use the default directory or Uncheck to specify a path. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

133 / 159

Hex Workshop v6.6

Advanced Configuration Preferences

Advanced Configuration Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Allow Multiple Instances of Hex Workshop to run


When checked Hex Workshop allows multiple instances of itself to be run. If not checked, launching Hex Workshop from anywhere will result in the previously running instance moving to the foreground with the selected files open if appropriate. Default is disabled.

Enable Direct File editing (no temporary files)


Hex Workshop supports a direct edit mode which allows you to modify files with out creating a temporary work file. This feature is useful when users need to modify very large documents and do not have enough free disk space for a complete working copy. All changes are made immediately to the source file and the users should backup their data before editing. The Status Bar will display a "DIR" in the last pane when a file is opened under direct editing mode. The "save" command is also disabled when direct file editing is enabled. Default is disabled.

Postpone write initialization until needed


When checked Hex Workshop will delay creating a temporary working copy of your data until you first modify the file. The default is enabled.

Allow Plug-in auto execution


Hex Workshop's plug-in framework allows a plug-in to register for file extensions and automatically executed when a file is opened. This settings can be used to disable that behavior. Default is enabled.

[email protected]

134 / 159

Hex Workshop v6.6

Advanced Configuration Preferences


Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

135 / 159

Hex Workshop v6.6

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

[email protected]

136 / 159

Hex Workshop v6.6

Keyboard Shortcuts

Keyboard Shortcuts Updating Shortcuts


You may modify existing or create new keyboard shortcut sequences for frequent tasks by selecting "Define Keycuts" from the "Options" menu or from the General Display Options Preferences.

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

Ctrl+N Ctrl+O Ctrl+D Ctrl+S Ctrl+P

Create New File Open File Open Drive Save File or Sector Print

Ctrl+C Ctrl+V Ctrl+X Ctrl+Z Ctrl+Y Ctrl+Ins

Copy Paste Cut Undo Redo Insert

Ctrl+F F3 Shift+F3 Ctrl+H Ctrl+F3 Ctrl+Shift+F3

Find Find Next Find Previous Replace Find Selected (next/downwards) Find Selected (previous/upwards)

[email protected]

137 / 159

Hex Workshop v6.6

Keyboard Shortcuts

Ctrl+G F5 Shift+F5

Goto Goto Again Goto Previous (jump backwards)

Ctrl+B F7 Shift+F7 Ctrl+Shift+B

Add Bookmark Next Bookmark Previous Bookmark Select Bookmark File

Ctrl+M Ctrl+Shift+M

Add Color mapping Select Colormap File

Ctrl+L Ctrl+Shift+L

Add Structure Select Structure Library

Ctrl+K Ctrl+R F6 Shift+F6

Compare Files Recompare Files Next Difference Previous Difference

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 Beginning of File/Sector Goto End of File/Sector

Alt+Up Alt+Dn Alt+PgUp

Goto Previous Sector (Drive Editing Only) Goto Next Sector (Drive Editing Only) Jump Back 10 Sectors (Drive Editing Only)

[email protected]

138 / 159

Hex Workshop v6.6


Alt+PgDn Alt+Home Alt+End Ctrl+Shift+G Ctrl+Alt+Shift+G
Jump Ahead 10 Sectors (Drive Editing Only) Goto First Sector (Drive Editing Only) Goto Last Sector (Drive Editing Only) Goto Sector (Drive Editing Only) Goto Sector Again (Drive Editing Only) Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

Keyboard Shortcuts

[email protected]

139 / 159

Hex Workshop v6.6

Bookmarks Tool Options Preferences

Bookmarks Tool Options Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Prompt to save when closing a file containing unsaved bookmarks


If checked (enabled), Hex Workshop will prompt to save new or modified bookmark collections upon closing a file. The default is enabled.

Automatically load bookmark collections by file extension


If checked (enabled), Hex Workshop will automatically load and apply bookmarks based on the file extension. The default is enabled.

Bookmark file extension associations


Users can define a mapping between file extensions and bookmark files by pressing the "+" button to add new entries or the "-" button to remove entries. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

140 / 159

Hex Workshop v6.6

Char Distributions Tool Options Preferences

Char Distributions Tool Options Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Show Character Distribution Bitmap


Check (enable) to include a graph showing the distribution of characters across a file or selection. The default is enabled.

Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

141 / 159

Hex Workshop v6.6

Color Maps Tool Options Preferences

Color Maps Tool Options Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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

[email protected]

142 / 159

Hex Workshop v6.6

Compare Tool Options Preferences

Compare Tool Options Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Default Comparison Dialog with


The Comparison Dialog can be defaulted with either the Last Compared Files or Open Documents. The default is Last Compared Files.

When displaying result files


When performing a comparison, Hex Workshop can align the files to better compare differences. Available options are listed below: Do not Tile Files Tile Files Vertically Tile Files Horizontally Open the files, but do not tile the files (place them side-by-side) Tile the files vertically (side-by-side) Tile the files horizontally (one on top, one on bottom)

When selecting results


Users can define the edit caret position and editor selection when selecting a comparison item from the Compare tab of the Results Window. Available options are listed below:

[email protected]

143 / 159

Hex Workshop v6.6


Scroll Data Into View Set Caret Position in Editor Select Data In Editor

Compare Tool Options Preferences


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.

Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

144 / 159

Hex Workshop v6.6

Find Tool Options Preferences

Find Tool Options Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Default to searching entire document (as opposed to selection)


This setting defines the default search range when using the Find/Replace Utility on documents. If checked, Hex Workshop defaults to searching the entire document regardless of any selection. If unchecked, Hex Workshop defaults to limiting search results to the selected document region (or entire document if no selection is made. Users can override this default for each search by changing options on the Find/Replace Utility's Range tab. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

145 / 159

Hex Workshop v6.6

Structure Viewer Tool Options Preferences

Structure Viewer Tool Options Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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

[email protected]

146 / 159

Hex Workshop v6.6

C Source Import/Export Preferences

C Source Import/Export Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Bytes Per Line


Defines the number of data bytes to include on each line of C Source or Java source export array definition.

Swap Byte Order


Allows users to swap the byte order (e.g. big endian vs little endian) of their data when exporting to C Source or Java Source arrays. The default is disabled.

Limit Array Length


Allows users to set the maximum array size for C or Java source export. If a user tries to export data larger then the maximum size defined, Hex Workshop will output multiple chunks of data into separate arrays. This feature was added to address the a maximum array size limitation in some compilers. By default, this is disabled.

Pad uneven selections with hex byte


Defines the handling of uneven file sizes or selections when exporting as C and Java source. If the selection or file size is not an even multiple of the data type, Hex Workshop can either: 1. Truncate the data by unchecking this parameter 2. Pad the data with the specified hex byte by checking this parameter The default is unchecked (or truncate data). Copyright (c) 1995-2008 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

147 / 159

Hex Workshop v6.6

HTML Import/Export Preferences

HTML Import/Export Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Bytes Per Line


This setting controls the amount of data displayed on each line or row. Valid values range from 1 to 64, however, this value must be a multiple of the Group By setting. The default is 16.

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

[email protected]

148 / 159

Hex Workshop v6.6

Intel Hex Code Import/Export Preferences

Intel Hex Code Import/Export Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Bytes Per Line


Defines the number of data bytes to include on each line of output. The default is 16.

Copyright (c) 1995-2008 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

149 / 159

Hex Workshop v6.6

Java Source Import/Export Preferences

Java Source Import/Export Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Bytes Per Line


Defines the number of data bytes to include on each line of C Source or Java source export array definition.

Swap Byte Order


Allows users to swap the byte order (e.g. big endian vs little endian) of their data when exporting to C Source or Java Source arrays. The default is disabled.

Limit Array Length


Allows users to set the maximum array size for C or Java source export. If a user tries to export data larger then the maximum size defined, Hex Workshop will output multiple chunks of data into separate arrays. This feature was added to address the a maximum array size limitation in some compilers. By default, this is disabled.

Pad uneven selections with hex byte


Defines the handling of uneven file sizes or selections when exporting as C and Java source. If the selection or file size is not an even multiple of the data type, Hex Workshop can either: 1. Truncate the data by unchecking this parameter 2. Pad the data with the specified hex byte by checking this parameter The default is unchecked (or truncate data). Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

150 / 159

Hex Workshop v6.6

Motorola S-Records Import/Export Preferences

Motorola S-Records Import/Export Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Bytes Per Line


Defines the number of data bytes to include on each line of output. The default is 16. Copyright (c) 1995-2008 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

151 / 159

Hex Workshop v6.6

RTF Import/Export Preferences

RTF Import/Export Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Bytes Per Line


This setting controls the amount of data displayed on each line or row. Valid values range from 1 to 64, however, this value must be a multiple of the Group By setting. The default is 16.

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

[email protected]

152 / 159

Hex Workshop v6.6

Text Import/Export Preferences

Text Import/Export Preferences Preferences


Hex Workshop Preferences Dialog is launched by either selecting "Preferences..." from the "Options" menu or by pressing the Preferences icon on the File Operations Toolbar. Preferences are organized under 4 major categories: Display Options, Configuration, Tool Options, and Import/Export followed by sub-categories.

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.

Bytes Per Line


This setting controls the amount of data displayed on each line or row. Valid values range from 1 to 64, however, this value must be a multiple of the Group By setting. The default is 16.

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

[email protected]

153 / 159

Hex Workshop v6.6

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

[email protected]

154 / 159

Hex Workshop v6.6

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

[email protected]

155 / 159

Hex Workshop v6.6

Command Line Usage

Command Line Usage


Hex Workshop allows users the ability to open files, logical drives, and physical drives via the command line.

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

/SRECORDS:file /HEXCODE:file /COMPAREWITH:file

/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.

[email protected]

156 / 159

Hex Workshop v6.6


c:\hexworks\hworks32 foobar3.bin /GOTO:300 /SELECT:0x100

Command Line Usage

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

[email protected]

157 / 159

Hex Workshop v6.6

Data Types

Data Types
Name
signed byte unsigned byte

Size (bytes)
1 1

Range of Values
-128 to 127 0 to 255

signed short unsigned short

2 2

-32,768 to 32,767 0 to 65,535

signed long unsigned long

4 4

-2,147,483,648 to 2,147,483,647 0 to 4,294,967,295

signed quad unsigned quad

8 8

-9223372036854775808 to 9223372036854775807 0 to 18446744073709551615

float double long double

4 8 10

3.4E +/- 38 1.7E +/- 308 1.2E +/- 4932

Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

158 / 159

Hex Workshop v6.6

Understanding Byte Ordering

Understanding Byte Ordering


Hex Workshop supports both Big Endian and Little Endian byte ordering. These terms are used to describe the order in which bytes are stored in memory. In Big Endian byte ordering, the most significant byte is stored first. For example, the decimal number 1,000 would be stored as 0x03E8 and the decimal number 100,000 would be stored as 0x000186A0. In Little Endian byte ordering, the least significant byte is stored first. For example, the decimal number 1,000 would be stored as 0xE803 and the decimal number 100,000 would be stored as 0xA0860100 You can observe that changing the most significant or first byte of a Big Endian number from 0x03E8 to 0x04E8 (decimal 1,256) causes a more significant change than changing the least significant or first byte of Little Endian number 0xE803 to 0xF803 (decimal 1,016). Hex Workshop will interpret these decimal values based on the byte ordering environment settings. You can also use the Byte Flip operation to convert between different byte ordering. Copyright (c) 1995-2011 BreakPoint Software, Inc. All Right Reserved http://www.bpsoft.com http://www.hexworkshop.com

[email protected]

159 / 159

You might also like