Skip to content
Advertisement

How to insert an offset to hexdump with xxd?

Is there an easy way to add an offset to the hex dump generated by xxd ?

i.e instead of

0000: <data>
0004: <data>
0008: <data>

I should get

Offset+0000: <data>
Offset+0004: <data>
Offset+0008: <data>

Advertisement

Answer

This is what I am doing now..It works perfectly but its kind of lame approach for just adding an offset 🙂

xxd file.bin | xxd -r -s 0x2e00000 | xxd -s 0x2e00000 > file.hex
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement