dumping a file in hexadecimal
Posted 05-28-2011 at 04:03 AM by neonsignal
There are several ways to dump a binary as hex values. The following examples generate single byte hex values with no addresses (which can be useful when generating array initialization code).
There is the program od:
The '-A n' turns off the addresses, and the '-t x1' sets it to single byte hex formatting.
There is also the program hexdump, which is more flexible in the formatting of the results:
The '128/1' specifies 128 bytes per line, and the '%02X' is the format string.
There is the program od:
Code:
od -A n -t x1 file.bin
There is also the program hexdump, which is more flexible in the formatting of the results:
Code:
hexdump file.bin -e '"" 128/1 "%02X " "\n"'
Total Comments 0