At the office, I want to compare the difference between two custom binary files (which should be very very similar) as part of a verification of the files.
I’m curious as to how much I can do using a binary editor.
I used a program on my Linux desktop called ‘bvi’ to view binary files (although its a binary editor, which in some ways is as painful to use as the Unix/Linux ‘vi’ editor … ). Still, its pretty neat.
I can also compare the files with ‘diff file1 file2’ which gives a confusing (to me) output. If I redirect the output to another binary file, I can also compare the files with ‘diff file1 file2 > file-difference.bin’ and then open up file-difference.bin with bvi and its a bit better, but I still find that rather obscure.
Also of interest is the Linux/Unix command ‘cmp’ … ie for example: cmp -b file1 file2
Also of interest is using the Linux program ‘dhex’ to compare a couple of the binary files. ie: dhex file1 file2 #I rather like dhex.
Anyone else have any other recommended tools for this ?
Part of the complexity is the file contents is defined more in binary than in hex, and thus a hex presentation is in some cases not as useful as a binary presentation! … but in other parts of the file, a hex (or even decimal) presentation is more useful.
oldcpu wrote:
> Anyone else have any other recommended tools for this ?
might take a look at BeeDiff, it is a GUI that can load one file in
the left side and another in the right and it highlights the
differences between the two, line by line…
true the presentation is sometimes confusing…but usually that is
because the two files may be SO different…
hmmmmm…now i see it says “User have the possibility to work with two text files” and in fact i’ve never used it for anything other than
text…so…so, maybe it is of no use to you…but, you could give it
look…i’ve run it for a long time with no problems…
In fact, that is what dhex does, but its a terminal program.
I think you are correct that beediff is for text files. I tried loading a couple of different (but almost the same) binary files into it, and beediff came back and incorrectly reported both files were the same.
In addition to dhex, I also found vbindiff, I could not find an openSUSE rpm for it, and I failed to compile it myself, so I used ‘alien’ to convert the .deb I found here for debian squeeze to an rpm which installed ok. But IMHO vbindiff is no better than dhex IMHO.
This image gives a good idea as to the appearance of dhex :
Thanks for the suggestion. I’m found bvi and dhex worked quite well and I used them today at the office to verify the binary output of a program, where it is important we don’t make mistakes.
I’m currently wishing I had a quick way of taking the hex that dhex produces from the binary and put it in a text file, but I’ve run out of time (for now) to search. Unfortunately its not a simple matter of redirecting the output. (I probably need to learn xxd or something like that)
>
>At the office, I want to compare the difference between two custom
>binary files (which should be very very similar) as part of a
>verification of the files.
>
>I’m curious as to how much I can do using a binary editor.
>
>I used a program on my Linux desktop called ‘bvi’ to view binary files
>(although its a binary editor, which in some ways is as painful to use
>as the Unix/Linux ‘vi’ editor … ). Still, its pretty neat.
>
>I can also compare the files with ‘diff file1 file2’ which gives a
>confusing (to me) output. If I redirect the output to another binary
>file, I can also compare the files with ‘diff file1 file2 >
>file-difference.bin’ and then open up file-difference.bin with bvi and
>its a bit better, but I still find that rather obscure.
>
>Also of interest is the Linux/Unix command ‘cmp’ … ie for example:
>cmp -b file1 file2
>
>Also of interest is using the Linux program ‘dhex’ to compare a couple
>of the binary files. ie: dhex file1 file2 #I rather like dhex.
>
>Anyone else have any other recommended tools for this ?
>
>Part of the complexity is the file contents is defined more in binary
>than in hex, and thus a hex presentation is in some cases not as useful
>as a binary presentation! … but in other parts of the file, a hex
>(or even decimal) presentation is more useful.
I don’t quite know what to say. Binary, octal and hexadecimal are all
pretty much the same to me, too many years pounding bits direct using
all those representations i guess.
Indeed it is an area that if one only touches upon it very very occasionally in the past, its a lot more difficult to come back, than if one spent years working with binary.
I ended up using ‘dhex’ and ‘bvi’ together. If looking at ONLY 1 file, then I use ‘bvi’. But if comparing 2 binary files, I prefer ‘dhex’.