Validating an .exe file

  • Thread starter Thread starter Martijn Mulder
  • Start date Start date
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
 
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.
 
Back
Top