PC Review


Reply
Thread Tools Rate Thread

Binary Diff Utility

 
 
R I G Consulting, Inc.
Guest
Posts: n/a
 
      10th Mar 2010
I am looking for a microsoft or public domain tool that can diff two
binary files (exe, lib or DLL) and able to concur if they are
identical or not *ignoring* the header details such as time stamps.
The idea is to find if two binary files built during two different
time period are identical.

The binary files are built using .NET 2008 version, if that matters.

Please repond to the posting or reply to e-mail. Suggestions and
existing tools, pointers to MSDN are welcome. MVP replies are most
apperciated.

TIA
rigconsulting@[nospam]yahoo.com
 
Reply With Quote
 
 
 
 
Mike Lovell
Guest
Posts: n/a
 
      10th Mar 2010
> I am looking for a microsoft or public domain tool that can diff two
> binary files (exe, lib or DLL) and able to concur if they are
> identical or not *ignoring* the header details such as time stamps.
> The idea is to find if two binary files built during two different
> time period are identical.
>
> The binary files are built using .NET 2008 version, if that matters.
>
> Please repond to the posting or reply to e-mail. Suggestions and
> existing tools, pointers to MSDN are welcome. MVP replies are most
> apperciated.


You say you want to know if it's identical or not? So you're just looking
for a true/false if the files are the same?

If so, just take a hash of each and compare them, the bigger the hash the
less likely collisions (of course they are pretty unlikely anyway for such
an application).

I notice someone has already written one, bound to be many about though:
http://corz.org/windows/software/checksum/

Or if you want to write one, see:

http://msdn.microsoft.com/en-us/libr...aphy.sha1.aspx
http://msdn.microsoft.com/en-us/libr...hy.sha512.aspx


IF you want to compare every single byte and list differences, you can just
File.GetAllBytes() the files you want, step through each of them in a for
loop a byte at a time and not the differences.

--
Mike
GoTinker, C# Blog
http://www.gotinker.com

 
Reply With Quote
 
Brian Muth
Guest
Posts: n/a
 
      10th Mar 2010
I really like WinMerge. It can handle entire folders, text files, and will
support binary files as well.

Brian



 
Reply With Quote
 
Liviu
Guest
Posts: n/a
 
      11th Mar 2010
"R I G Consulting, Inc." <(E-Mail Removed)> wrote...
>I am looking for a microsoft or public domain tool that can diff two
> binary files (exe, lib or DLL) and able to concur if they are
> identical or not *ignoring* the header details such as time stamps.
> The idea is to find if two binary files built during two different
> time period are identical.
>
> The binary files are built using .NET 2008 version, if that matters.


You may have a look at Microsoft's bindiff.exe in the XP Support
Tools package. It works for simple cases, such as an unmanaged C
"hello world" built with the default settings. Does not necessarily work
with all combinations of compiler/debug options and other languages.
If you need finer control, you can always dumpbin.exe the relevant
(to you) PE sections and compare them externally.

Liviu



 
Reply With Quote
 
Nobody
Guest
Posts: n/a
 
      11th Mar 2010
"Brian Muth" <(E-Mail Removed)> wrote in message
news:132C3F08-0D29-4E7B-9CB4-(E-Mail Removed)...
>I really like WinMerge. It can handle entire folders, text files, and will
>support binary files as well.


Vote #2 for WinMerge. It compares 2 folders, like what changed between 2
projects and it does binary comparison for binary files. It shows "Binary
files are identical" so you know it did binary comparison(based on file
extension).

You could also use "FC" which is part the OS since the DOS days. Example:

fc /b file1 file2

Use "fc /?" to see the command line options.


 
Reply With Quote
 
Nobody
Guest
Posts: n/a
 
 
Reply With Quote
 
gast128@hotmail.com
Guest
Posts: n/a
 
      11th Mar 2010
On 10 mrt, 23:19, "R I G Consulting, Inc." <rig_pos...@yahoo.com>
wrote:
> I am looking for a microsoft or public domain tool that can diff two
> binary files (exe, lib or DLL) and able to concur if they are
> identical or not *ignoring* the header details such as time stamps.
> The idea is to find if two binary files built during two different
> time period are identical.


When building the same project twice, the resulting binary differs,
since pdb guids and maybe timestamps are incoperated. U can use
dumpbin to compare only the content, which is described in kb article
Q164151.
 
Reply With Quote
 
Liviu
Guest
Posts: n/a
 
      12th Mar 2010
<(E-Mail Removed)> wrote...
> "R I G Consulting, Inc." <rig_pos...@yahoo.com> wrote:
>> I am looking for a microsoft or public domain tool that can diff two
>> binary files (exe, lib or DLL) and able to concur if they are
>> identical or not *ignoring* the header details such as time stamps.
>> The idea is to find if two binary files built during two different
>> time period are identical.

>
> When building the same project twice, the resulting binary differs,
> since pdb guids and maybe timestamps are incoperated. U can use
> dumpbin to compare only the content, which is described in kb article
> Q164151.


That article is rather old and referring to VC v6, though the principles
still apply. It likely predates the bindiff.exe utility I mentioned in
my other post, which appears to have been originally meant to automate
such comparisons (and does still work in non-debug/unmanaged cases).

Unfortunately, bindiff itself hasn't been actively maintained in a
while, and is missing a number of options relevant to real life usage,
such as ignoring .pdb paths and timestamps.

So, yes, dumpbin is the last resort as always, but I still wish there
were a more direct and painless way to verify "reproducible builds".

Liviu



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binary Diff Utility R I G Consulting, Inc. Microsoft VC .NET 7 12th Mar 2010 05:46 AM
Binary 'Diff' Tool? Cool Guy Freeware 3 11th Mar 2005 03:18 AM
Program to do 'diff' of binary files? Chaos Master Freeware 1 27th Nov 2004 04:15 AM
Same code build twice => diff binary Viviana Vc Microsoft Dot NET 4 5th Jun 2004 08:16 PM
binary diff Ching-Lung Microsoft C# .NET 7 4th Oct 2003 10:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:45 AM.