How to Compare two exe files One built from the ol

2019-06-28 04:09发布

I am looking to compare two exe files. I should ensure that the existing exe on the server is a product of the code I have now.

I am using

>dumpbin /rawdata oldfile.exe > oldfile.txt
>dumpbin /rawdata newfile.exe > newfile.txt
>fc /b oldfile.txt newfile.txt  //compare them like this
>windiff  oldfile.txt newfile.txt // or this 

I guess they should only differ by the timestamp. These are VB.net exes from visual studio 2003.

Any thoughts?

Thanks.

标签: .net
4条回答
够拽才男人
2楼-- · 2019-06-28 04:18

I always use fc with /b option to compare two exes (or any binary files).

查看更多
SAY GOODBYE
3楼-- · 2019-06-28 04:22

There are date stamps internal to executable files. Wrote a PASS/FAIL program to do this 10 years ago for a build backup process, but lost the code since. Easy to do on your own though.

I remember that after checking the header for the location of the build date stamp and ignoring that address, it was a straight byte to byte block compare.

查看更多
别忘想泡老子
4楼-- · 2019-06-28 04:42

If all you're looking to do is verify the binaries are identical, then you could use a utility like md5sum or sha1sum which will effectively hashes the binary. If the hashes for each binary are the same, then the chances are the files are identical.

查看更多
我欲成王,谁敢阻挡
5楼-- · 2019-06-28 04:43

Here's an add-in for Reflector that lets you compare the code between 2 assemblies.

查看更多
登录 后发表回答