The source code is written to use an ANSI C99 compatible compiler for portability between Operating Systems.
Hexed is released under the BSD license
Hexed had a problem on Windows with CR, LF line conversion. Hexed opened the file using the ‘r+b’ file mode but MinGW seemed to ignore the file mode and opened the file in text mode. I’m now setting the _fmode from fcntl.h to _O_BINARY. This fix only compiles on Windows for the MinGW compiler and is done in a separate file, bfcntl.c, to stop any warnings about DLL settings.
Hexed now also shows the version number on the help screen with the command
The last few commands have been added to hexed today, these are move, move overwrite and word size. Move is similar to the copy command with 2 modes of operation, while the word command sets the word size between 8 bit, 16 bit, 32 bit and 64 bit word sizes.
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.
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.
Sets the data word size for most commands like dump, enter, insert etc.
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...
The next step is to implement a simple console editor.
The copy command was added to hexed a little while ago. This command has 2 modes of operation: copy (c) or copy overwrite (co).
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.
Copies data from the source overwriting the destination
-co 100 200 20
Copy 32 bytes from 0x100 to 0x200 overwriting the original data.