Jump to content
  • Advertisement
Sign in to follow this  
floatingwoods

File signature calculation

This topic is 3048 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I want to be able to check whether a given file (e.g. *.exe or *.dll or any other) is the original one. For that I am using several variations of a CRC check. The question that I am wondering about now is: is it possible that Windows will store additional information in that file if the file is copied onto another pc (for exe or dll files)? I can imagine that every exe file or every dll file has a header part used by Windows for various reasons, and that the actual code of that exe or dll comes only after the header part. If I read an exe or dll with following code:
		CFile file(filePath,CFile::modeRead|CFile::shareDenyNone);
		CArchive archive(&file,CArchive::load);
		DWORD archiveLength=DWORD(file.GetLength());
		for (int i=0;i<archiveLength;i++)
		{
			BYTE myByte;
			archive >> myByte;
			// Now calculate the CRC and other signatures with that byte!
		}


Will the result always be same on every Windows platform? (given that the file was not manipulated other that copy/pasting into a different location) Thanks

Share this post


Link to post
Share on other sites
Advertisement
Any additional information the OS stores won't be kept in the PE file header, it'll be in a different file, in the registry, or in alternate NTFS data streams.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!