diff across two binary files in hexview
lets say you have two binary files you want to compare in order to find differences in single bytes..
there is ghex for exmaple that nicely displays a hex file with bytes to the left (16 per row) and ascii characters to the right. wouldn't it be nice to be able to use this view in a diff?
thanks to hexdump, this can be done with any regular diff tool, be it a graphical one like diffuse or just diff on the cli.
here is the hexdump line to convert a binary into a nicely looking text file for comparison:
hexdump -e '16/1 "%02X ""\t"" "' -e '16/1 "%c""\n"' generated.bin > generated.txt
this will return something like this:
6E 6F 74 65 2E 41 42 49 2D 74 61 67 00 2E 6E 6F note.ABI-tag.no 74 65 2E 67 6E 75 2E 62 75 69 6C 64 2D 69 64 00 te.gnu.build-id 2E 67 6E 75 2E 68 61 73 68 00 2E 64 79 6E 73 79 .gnu.hash.dynsy 6D 00 2E 64 79 6E 73 74 72 00 2E 67 6E 75 2E 76 m.dynstr.gnu.v 65 72 73 69 6F 6E 00 2E 67 6E 75 2E 76 65 72 73 ersion.gnu.vers 69 6F 6E 5F 72 00 2E 72 65 6C 61 2E 64 79 6E 00 ion_r.rela.dyn 2E 72 65 6C 61 2E 70 6C 74 00 2E 69 6E 69 74 00 .rela.plt.init 2E 74 65 78 74 00 2E 66 69 6E 69 00 2E 72 6F 64 .text.fini.rod 61 74 61 00 2E 65 68 5F 66 72 61 6D 65 5F 68 64 ata.eh_frame_hd 72 00 2E 65 68 5F 66 72 61 6D 65 00 2E 69 6E 69 r.eh_frame.ini 74 5F 61 72 72 61 79 00 2E 66 69 6E 69 5F 61 72 t_array.fini_ar 72 61 79 00 2E 6A 63 72 00 2E 64 79 6E 61 6D 69 ray.jcr.dynami 63 00 2E 67 6F 74 00 2E 67 6F 74 2E 70 6C 74 00 c.got.got.plt 2E 64 61 74 61 00 2E 62 73 73 00 2E 67 6E 75 5F .data.bss.gnu_ 64 65 62 75 67 6C 69 6E 6B 00 00 00 00 00 00 00 debuglink