
Ascii Hex editor & converter.

A freeware programmer's tool
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
b2hedit.exe is a HEX editor that will open a binary file as ascii HEX,
edited and save it as an ascii file. It can be reloaded, edited and saved
back as a binary file. 

The ascii HEX can be commented using the normal ASM comment notation E.G.

    ; This is a single line comment.

    00000000: 4D 5A ; This is an end of line comment.

Lines can be split as long as the line is prefixed with a colon : E.G.

      00000000: 4D 5A 0A 00 02 00 00 00 - 
      : 04 00 0F 00 FF FF 00 00

Note that if the line of HEX is NOT prefixed with a colon : it will not be
written and the byte length and sequence of the binary file will be wrong.

HEX can be entered in lower case if desired I.E 4D 5A = 4d 5a

Sample HEX dump. (MZ header of PE file)

      00000000: 4D 5A 0A 00 02 00 00 00 - 04 00 0F 00 FF FF 00 00
      00000010: C0 00 00 00 00 00 00 00 - 40 00 00 00 00 00 00 00
      00000020: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00
      00000030: 00 00 00 00 00 00 00 00 - 00 00 00 00 80 00 00 00
      00000040: B4 09 BA 10 00 0E 1F CD - 21 B8 01 4C CD 21 90 90
      00000050: 54 68 69 73 20 69 73 20 - 61 20 57 69 6E 33 32 20
      00000060: 70 72 6F 67 72 61 6D 2E - 0D 0A 24 00 00 00 00 00
      00000070: 00 00 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00

The offsets are for editing convenience, they are stripped out when the HEX
file is converted back to a binary file. The function that converts the HEX
to binary strips spaces, the centre separators - , crlf pairs and comments
entered as above before it converts the HEX to binary.

If a line is not prefixed with a colon : it will also be stripped out
resulting in an error. 

Size Limitation.
~~~~~~~~~~~~~~~
The read and write functions will work on any size file but the editor will
not handle files over 5 Meg. Files over 1 Meg load slowly due to a bottle-
neck in the design of richedit controls.

Allow when reading a binary file that the HEX dump is roughly 4 times the
size of the original file. This means that the limit imposed by the rich
text edit control on the size of the binary file is about 1.2 Meg. 

All rights on the HEX dump and rewritten binary file rest with the user as
does the responsibility of how they are used. 

Please note that copyright is retained on this software, it is not and will
not be placed in the public domain. It is available without any form of
cost as a programmer's tool, it is not for sale and is not to be sold.

Steve Hutchesson < hutch@pbq.com.au >
Sydney
Australia