I would be interested in whether it is possible in some way to check my application against modifications by checking its checksum.
So, for example:
int main()
{
const std::string checksum = "98123abc1239";
std::string myChecksum = calculateChecksumOfThisApp();
if(checksum != myChecksum)
std::cerr << "This application is invalid. Please check if the download has been successful." << std::endl;
}
Clearly, the issue here is that compiling my application, getting the executable's checksum and inserting it into my checksum
changes the checksum of the application.
I could store the checksum externally in some file, but I would like to have the side-benefit of others not being able to manipulate the exe. They could just calculate the checksum once again and put it into the checksum file, so nothing would be gained from that.
Is there any way to create such a self-check?