Page 1 of 1

[C++] ASK: Binary File Comparison

PostPosted: Mon Aug 02, 2010 5:45 pm
by TheJAF
Hi,

I've been looking for some articles related to this topic, but did not find anything meaningful.

example like this:

Code: Select all
Select original file: C:\file1.exe
Select patched file: C:\file2.exe

-> Size is OK and file is DIFFERENT.

-> Result:

    Offset      | Old Byte | New Byte
    00000001    | 33       | 31
    0000003A    | 58       | 90


Like dUP2 Offset Patchdata (diablo2oo2)

Image

Previously I've been looking for the dUP2 source code, unfortunately diablo2oo2 not provide it.

For all, especially L. Spiro, can you provide some sample code in C++? Or can you provide some references from the website about this?

T I A

Re: [C++] ASK: Binary File Comparison

PostPosted: Mon Aug 02, 2010 5:57 pm
by L. Spiro
No sample code would be complete enough to be comprehensive while still being small enough to type up and post.
The concept is fairly simple and many articles can be found discussing the utility called Diff.

http://en.wikipedia.org/wiki/Diff
http://spivey.oriel.ox.ac.uk/wiki/resources/rd/diff.pdf

It uses the longest common subsequence algorithm which can be researched separately.
http://en.wikipedia.org/wiki/File_comparison
http://en.wikipedia.org/wiki/Longest_common_subsequence (some pseudo code included).


L. Spiro

Re: [C++] ASK: Binary File Comparison

PostPosted: Tue Aug 03, 2010 10:23 am
by TheJAF
I will try to find it. Very useful references.

Thanks, L. Spiro.