[C++] ASK: Binary File Comparison

Technical Discussions not Related Directly to MHS. For Example, Coding, Hex Editing, General Hacking, Etc.

Moderators: g3nuin3, SpeedWing, WhiteHat

[C++] ASK: Binary File Comparison

Postby TheJAF » Mon Aug 02, 2010 5:45 pm


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)


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?

I Have A Few Questions
Posts: 6
Joined: Mon Aug 02, 2010 5:14 pm

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

Postby L. Spiro » Mon Aug 02, 2010 5:57 pm

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.


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

L. Spiro
Our songs remind you of songs you’ve never heard.
User avatar
L. Spiro
L. Spiro
Posts: 3126
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

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

Postby TheJAF » Tue Aug 03, 2010 10:23 am

I will try to find it. Very useful references.

Thanks, L. Spiro.
I Have A Few Questions
Posts: 6
Joined: Mon Aug 02, 2010 5:14 pm

Return to Technical Unrelated

Who is online

Users browsing this forum: No registered users and 1 guest