Hexed is a command line Hexadecimal File Editor.

The source code is written to use an ANSI C99 compatible compiler for portability between Operating Systems.

Hexed is released under the BSD license

Latest Updates
May 6, 2014
hexed help screen now shows the version number.

May 6, 2014
Bugfix: #1 - Added bfcntl to set _fmode to _O_BINARY in MinGW as 'r+b' in fopen was

January 23, 2014
Modified the Makefile. It now has fewer options and should be a cleaner build process.

Bug reports & feature requests

For bug reports and feature requests please create a new ticket

Notes & trouble shooting

If you are having trouble with a file name that starts with a hex value (0-f) include a – (hyphen) before the file name. This will end any command arguments before looking for the next argument or file name.

hexed -e 10 1 2 3 - 01.dat

Help: -?

Help simply displays the command list and how to use each command:

hexed - Hexadecimal File Editor
  v?.?.?

Usage:
  hexed [options] [file]

Options:
  -?                            Shows this help screen
  -c [src] [dest] [len]         Copy data from src to dest for len words
  -co [src] [dest] [len]        Copy data from src overwriting dest for len
                                words
  -d [src] [len]                Display data from src for len words
  -e [dest] [...]               Enter hex values [...] at dest
  -i [dest] [cnt] [...]         Insert hex values [...] at dest repeating cnt
                                times. Defaults to 0 for empty hex values.
  -m [src] [dest] [len]         Move data from src to dest for len words
  -mo [src] [dest] [len]        Move data from src overwriting dest for len
                                words
  -r [src] [len]                Remove data from src for len words
  -w [bytes]                    Set the word size in bytes: 1 = 8 bits
                                2 = 16 bits, 4 = 32 bits, 8 = 64 bits

Copy: -c

Copies data from the source inserting it at the destination

-c 100 200 20

This will copy 32 bytes from 0x100 to 0x200 moving everything at 0x200 up by 32 bytes.

Copy Overwrite: -co

Copies data from the source overwriting the destination

-co 100 200 20

Copy 32 bytes from 0x100 to 0x200 overwriting the original data.

Dump: -d

The dump command displays a range of values and their ascii symbols:

-d 0 100

Displays values starting from 0x0 for 0x100 (256) bytes, all options to commands are set in hex values.

Enter: -e

Enter adds new values to a file, overwriting any values that were already at the address:

-e 100 10 20 30 40

Enters the values 0x10, 0x20, 0x30 and 0x40 starting at 0x100. If a file name is set then the values will be automatically saved to the file.

Insert: -i

Inserts bytes in the file at the destination, repeating the bytes for a number of times.

-i 100 10 01 02 03

This will insert the bytes 0x01 0x02 0x03 at 0x100 16 times.

Move: -m

Moves data from the source to the destination

-m 100 200 20

Will move 32 bytes from 0x100 to 0x200 and move everything from 0x120 to 0x220 down by 32 bytes.

Move Overwrite: -mo

Moves the data from the source to the destination over writing the original data at destination

-mo 100 200 20

This will move 32 bytes from 0x100 to 0x200 but will insert zeroes into the file below the destination. This way the data will appear where you expect it to be after the move.

Remove: -r

Removes a number of bytes from the file starting at the source.

-r 10 100

Removes 0x100 bytes from the file at 0x10 to 0x110.

Word size: -w

Sets the data word size for most commands like dump, enter, insert etc.

-w 2

This will set the word size to 16 bit so when used with a command like dump will display the data as 2 bytes long as in this example:

hexed -w 2 -e 18 ffff abcd 1234 dead -d
00000000  0000 0000 0000 0000  0000 0000 0000 0000  ................
00000010  0000 0000 0000 0000  ffff abcd 1234 dead  ............4...