Reputation: 11309
How to modify checksum of a binary?
Specifically, I want to edit embedded checksum in a dll/exe.
Are there any tools available?
Upvotes: 3
Views: 10041
Reputation: 101656
Windows only requires the checksum to be != 0 for kernel modules, you don't need to set it for usermode modules. If you really want to set the checksum, run EDITBIN /RELEASE yourapp.exe, or call CheckSumMappedFile(). See this article for an analysis of the checksum algorithm.
Upvotes: 1
Reputation: 13244
OK, this link gives you the file format of Windows DLLs/Executables: http://www.openrce.org/reference_library/files/reference/PE%20Format.pdf
You can see there are several possible palces in the headers were checksums can be stored, some of which are optional, so you'd need to parse the image to find out what's in there. There are tools like Python PE parsers (google for options) to help with this.
Once you know which bytes you want to change, pick a hex editor and do it. You can even edit binaries in Visual Studio.
[Edit: But, as I commented above, I think Windows might barf on it if it doesn't match the expected value]
Upvotes: 0
Reputation: 322
You can use a "hex editor" to modify a dll/exe, but unless you know how to reverse calculate your checksum, its not going to be much help.
Upvotes: 0