-3

I am new to coding and trying to understand something. I have read that a .EXE can not change itself or change embedded files inside itself. So lets say you make a game and that game has setting that the user can adjust like difficulty or level or whatever. Maybe it is an RPG game and they need to save progress. Where does that information get saved? If you save it to a text file then the user could go into the text file and adjust their level and cheat. Also you would not save a password to a text file because then anyone could open the text file and see the password. Another problem would be that, if they moved the game to a different computer and did not also move the save file they would not have access to their saved information.

rathi bond
  • 81
  • 2
  • 8
  • 2
    "if they moved the game to a different computer and did not also move the save file they would not have access to their saved information" - and, indeed, that should be a relatively common experience for you (unless your only experience of games is via tools such as Steam that also include save game synchronization). – Damien_The_Unbeliever Jul 13 '16 at 07:00
  • 1
    Most of what you said is correct. That why on some mobile operating systems, you have a secure location for each app than the user can't access (unless rooted). As for PCs, it is very, very hard to make an app that can't be hacked when using managed code. – Zein Makki Jul 13 '16 at 07:01

1 Answers1

3

For C# applications, there are several ways to save application data; various practices are dicsussed in this question; the most usual ways are custom data files (Xml, Json, binary formats), the Windows registry, or the cofiguration settings file of the application. The problem that a user could manually edit the saved data is always present and somewhat unrelated; this is a drawback of either possibility. One solution would be to encrypt the saved data or use checksums to detect manipulation.

Community
  • 1
  • 1
Codor
  • 17,447
  • 9
  • 29
  • 56