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.

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.

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

Convert ASCII characters to upper case. Non-alphabetic characters are not changed.

Lower Case

Convert ASCII characters to lower case. Non-alphabetic characters are not changed.

Swap Case

Swaps the case of ASCII characters: lower case becomes upper case, uppercase becomes lower case, non-alphabetic does not change.

 

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.