The firmware analysis tool binwalk
also has this as a feature through its -W
/--hexdump
command line option which offers options such as to only show the differing bytes:
-W, --hexdump Perform a hexdump / diff of a file or files
-G, --green Only show lines containing bytes that are the same among all files
-i, --red Only show lines containing bytes that are different among all files
-U, --blue Only show lines containing bytes that are different among some files
-w, --terse Diff all files, but only display a hex dump of the first file
In OP's example when doing binwalk -W file1.bin file2.bin
:
Add | less -r
for paging.