Archive

Posts Tagged ‘linux’

View content of hex file in linux

October 29th, 2012

If you have generated the binary of a program, you may, under some circumstances wish to view the contents of the file in hex. You can use the od command it -x option to view the content in the terminal. od command stands for octal display and -x supplements it to display the content in hexadecimal. Here is how a typical command looks like.

#od -x test.bin

You may supplement it with more pipeline so that you are not overflowed with information overload.

referencedesigner@ubuntu:~/test$ od -x test.bin | more
0000000 457f 464c 0101 0001 0000 0000 0000 0000
0000020 0002 0028 0001 0000 0000 1780 0034 0000
0000040 15dc 0013 0002 0500 0034 0020 0002 0028
0000060 0015 0012 0001 0000 8000 0000 0000 1780
0000100 0000 1780 4800 0004 4800 0004 0007 0000
0000120 8000 0000 e551 6474 0000 0000 0000 0000
0000140 0000 0000 0000 0000 0000 0000 0007 0000
0000160 0004 0000 0000 0000 0000 0000 0000 0000
0000200 0000 0000 0000 0000 0000 0000 0000 0000

To do : How to see the content starting after a certain location.

Uncategorized