Validating an .exe file

M

Martijn Mulder

When I distribute my .exe assembly, I want to make sure that users get
the correct file. When someone has meddled with the contents, I want the
program to quit with a message. Is there a way to set some kind of
checksum in the .exe itself so that the .exe auto-validates itself? I am
not sure if I express myself clearly
 
J

Jesse Houwing

Hello Martijn,
When I distribute my .exe assembly, I want to make sure that users get
the correct file. When someone has meddled with the contents, I want
the program to quit with a message. Is there a way to set some kind of
checksum in the .exe itself so that the .exe auto-validates itself? I
am not sure if I express myself clearly

You can sign the assembly with a Code Signing Certificate (you'll need to
buy such a certificate) for best protection.
You can also sign the assembly with a Strong Name (which is free). The is
last option is less secure and more easily (though it takes time) circumvented.

Other solutions might consist of saving the checksum or hash of the executable
in an encrypted file. Then upon startup, decrypt the file and verify the
hash. It becomes harder if you want to embed that hash into the hashed executable
itself. This method is also the easiest to circumvent.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top