In Windows, I wish to compare old binary files with newly built ones in order to determine which files has been updated. However, when I build the files I give them new meta data details (like version etc.). By right clicking the file and going to the tab 'Details' you can see file version and other information. This causes the comparisons differentiate. Is it possible to work around this in order to check which files are equal or not?
Give Angus Johnson's Resource Hacker a try. This free tool will allow you to view (and even edit) the resource tables in a given executable as long as the PE or library was compiled with the
Version Info resource. Please keep in mind that you won't be able to view or edit the resource files within an obfuscated binary.
I reread your comments and it looks to me like you want to compare version info from executable files and libraries instead of checking integrity of files.
Well, first off all you need to understand that there no such terms as "metadata header". Executable files and libraries on windows has concept of so called "resources" that linked to final file on compilation/linking. It isn't requirement, so programmer may use resources or simply skip it. In a file's resources one can pack practically anything, icons, sounds, picture, malicious encrypted payload and so on. In the same resource file programmer may specify additional textual info such as file version. You need to understand, that file version isn't advancing automatically in some languages, it is a programmers manual job to change file's version.
Ok, let back to subject, I guess you want to compare file versions between executable/libraries files, so you can use command line tool to extract file version from resources with help of official utility from Microsoft
sigcheck.exe that is part of very useful utilities from Sysinternals Suite. If you would run
sigcheck.exe on executable files that has resources, then this program will extract "meta-data" you mentioned:
Publisher: Company: Description: Product: Prod version: File version:
You can parse further fields you need to compare with you preferred tool.
If you can use Windows API, you can extract "meta-data" from resources programmatically by employing FileVersionInfo WinAPI.
Since you mentioned
compare old binary files with newly built ones, then the best option for you would be to use version control systems such as git or fossil that both can track changes in binary files besides of convenient tracking of source files.
You can also compare binary files in multiple ways:
The standard Unix's
diff utility that can compare binary files, it simply would tell if it differ or not.
(If you're on windows 10, you can use WSL to run natively unix's utility)
There is also
visual binary diff that runs on both, - windows and Unix.
Native window's utility
fc also can do binary comparison as
fc /b file1 file2
If you using Microsoft visual studio, you can also use WinDiff
For a huge files (in Terabytes size) comparison you can use old good HxD