HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Reinforced save-load code

06-04-2008, 07:49 PM#1
d07.RiV
Here's a method I think can be used for generating save-load codes. It's very hard to crack but it makes the code uncompatible between different versions.

You create a handle object (e.g. a location) at the end of the main function and store it's H2I in a global variable. Then in save/load functions set the random seed to this number and use random functions to shuffle the code.
Other approaches include using a hash of player name instead of a H2I, it would keep the code compatible but it would be easier to crack by creating another map and copying the code.
06-04-2008, 08:43 PM#2
Vexorian
This adds a lot of complications (Like it will be very easy to make a code stop working) and no benefit whatsoever. One could get the value for that handle's id very easily.
06-04-2008, 11:37 PM#3
Strilanc
Quote:
Originally Posted by d07.RiV
Here's a method I think can be used for generating save-load codes. It's very hard to crack but it makes the code uncompatible between different versions.

You create a handle object (e.g. a location) at the end of the main function and store it's H2I in a global variable. Then in save/load functions set the random seed to this number and use random functions to shuffle the code.
Other approaches include using a hash of player name instead of a H2I, it would keep the code compatible but it would be easier to crack by creating another map and copying the code.

Your assertion that it's "very hard to crack" is laughable. It's not anything to do with your method, save-load codes are just *easy* to crack in general. I won't go into how you do that, but suffice it to say that given almost any map's script (even optimized) many people on these boards could give you a forged hero code within an hour. Actually, that would be a pretty neat contest.

You're better off using a method that doesn't automatically break compatibility. A good save-load code should focus on defending against people that can't modify JASS. Good codes: incorporate the player's name so people can't steal codes, use simple encryption to hide patterns in the code, and use a checksum so random typing almost never gives a valid code.
06-05-2008, 02:23 AM#4
Dark.Revenant
The best defense against code-wizards is to make the most complicated and unoptimized bundle of shit possible and call it your save-load system. Few will bother to crack it if it's hard to even read. The catch is YOU have to be able to understand it.
06-05-2008, 05:20 AM#5
d07.RiV
I know most save codes are really easy to crack (I laghed at tbr that had a huge function with a lot of elseif's to convert items to integers, 300 items!! and a backward function!!).
But really, there is a way to find handle id without changing the map?
Oh well unless you add a bjdebugmsg into an existing function.