Since I haven’t really written about hexinspector before, I thought I would.
It started off as a project because I got tired of looking at binary diffs using hexdump and vimdiff. At the time people at work (EchoStar Europe) said a binary diff utility was impossible to do perfectly. While it is true that there is no accurate way of doing a binary diff 100% of the time, there are enough heuristics to make it a worthwhile tool, and hexinspector was born.
The ‘smart’ mode is basically the following algorithm (which is used as default)
1) Go through the file until you find a difference
2) When there are differences, try to slide a window of 16 bytes trying to find a match in the second file.
3) When that fails, try to use the Rabin-Karp algorithm (based on hashes fixed length bytes to find them)
Unfortunatly that algorithm isn’t perfect and isn’t that high performance, but it’s usually okay, and was for the primary dataset I was looking at at the time (mainly MPEG-2 transport streams)
I’m looking at improving it, both in terms of performance and accuracy.
As well as the ‘smart’ mode there is the ‘simple’ mode which doesn’t try to realign the data, and just calculates if it is equal or not.
For it’s warts it has become a useful tool at work, and is one of the better binary diff tools available (and probably the best one available on linux)
Anyway, hexinspector is available for download and is licensed under the GPL.




