I've been making a simple little game to learn more about construct (usually I bite off more than I can chew, give up and never come back to a program again).

Now the basics are done I've been thinking of stuff to add to add replay value, better my construct knowledge and turn the small simple game into something bigger but still simple.

I had two nice ideas stat tracking & achievments. To track these I was going to use INI file(s) but these are simple to hack with a text editor, so I need to protect my files from naughty hackers.

This is what I came up with. It's pretty simple (and probably sloppily made) but seems to work great. When it gets a match between the stored hash it gives one message, if the hash isn't a match it gives a different message. In my game i intent to make it so if the hashes don't match it will simply reset all the stats & values to the default ones.

[quote="Davioware":ry17gpx6]every time you save a file, save a hash of the file too (with crc32). Then when loading, make sure the hash equals the file.[/quote:ry17gpx6]

Thats exactly what I was going to do .

At the end of the game it'll write the new info in the crc32.ini then rehash and save the hash in the hash.ini and recheck at the start of the first layout of the game. If they don't match I'll reset all the info to default.

I did have one DUH! moment when playing about with this, I stored the hash of the crc32.ini in the crc32.ini and kept wondering why the hashes never matched.

Your idea of checking the hashes is pretty good. Just keep in mind that it will only keep "honest" people honest. It does little to prevent a "hacker" from using a modified INI file. The reason why is the hacker can simply find the place in the .exe that checks the hash and simply patch it to always go to the "OK" state. This is not hard, probably only take 10 min or less to do.

That being said what you describe will keep average gamers from messing with the INI.

I find the best way to get rid of the "me too" hackers is to simpley rename the .ini extension to something a bit more scary looking like .cab, .dat or something in the same line of things that way they are to scared to open it.