Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Do you know Unix/Linux diff(1) tool works? It shows which lines were added and removed between 2 text files, and shows it in the human-readable form. I need the same kind of tool for binary files - except for working on sequences of bytes, not text lines. It still must produce human-readable output (in hex thus).

Note that I don't need cmp -l which diffs binary files byte by byte and can't detect insertions and removals. Note that I don't need xdelta or bsdiff which produce non-human-readable output. Actually, I'm a bit astonished that neither xdelta nor bsdiff offer some kind of human-readable representation for patches they produce. IMHO, such option should be there first, and only then an option to produce an efficient binary patch. After all, how the authors of those tools verify them to work right? And don't they think users will want to verify them either, to make sure that they indeed produce sane and minimal patches?

(Sorry for the rant ;-))

share|improve this question
    
Why not convert the two files into hex and then diff the hexed versions? –  Andrew Lambert Jan 12 '12 at 18:51
    
If you convert to just hex values, w/o offset, then resulting diff won't convey strict information - it could be used as heuristical measure of how files are different, not to analyze differences, or be used as a patch. If convert with offset information, you immediately get spurious diffs on first insertion/deletion. So, it must be a smarter, special-purpose tool, not a quick hack. And existing tool ("how to write such tool?" I would post on StackOverflow). –  pfalcon Jan 12 '12 at 19:20

1 Answer 1

I have found jdiff. Probably, this tool you looking for.

JDIFF is a program that outputs the differences between two binary files, either in binary format or in human readable format (detailed or summarized). JPATCH then allows to reconstruct the second file from the first file.

update

It looks like jdiff is not save patch in the human readable format. It shows only summary in human readable format :(

I research many tools and found only cracker tools can be helpful for this purpose: So human readable format is .XCK and .CRK file extensions. tools for these extensions:

for using patch:

  1. Cracker.Exe by Corner Crackers
  2. patch-xck.rb

for creating patch:

  1. c2c (compare to crack) ex: C2C by Nimnull, C2C/2 by SkullC0DEr, MC2C by MaD k0DeR.
  2. fc
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.