I once heard that it's possible to store high scores (or other information) in the game .exe file. Do any of you know how to do that in windows?
I once heard that it's possible to store high scores (or other information) in the game .exe file. Do any of you know how to do that in windows?
If your program is running, Windows doesn't allow you to modify it. What you could do is create another .exe file so that it modifys your app. Of course you'd have to change it in binary (or hex maybe) which could mess up your app and it wouldn't work. I wouldn't recomend modifying an .exe after it's been compiled. Why don't you just store it in a txt file? It's easier.
SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
I say what I say, I mean what I mean.
IDE: emacs + make + gcc and proud of it.
Nah i think it's possible, coz i saw someone done it before. I just want to know how to do it, even though txt file is an alternative.
Besides it's more portable, in terms of distributing the exe from person to person.
I've never heard of that nor would I even want to try. If you want to store the high score, but not use a txt (so people can't easily change it and cheat), and you're using Windows then just store the score in the System Registry.Originally posted by Nutshell
I once heard that it's possible to store high scores (or other information) in the game .exe file. Do any of you know how to do that in windows?
It's quite possible and has been done a good deal, but not by me (yet).Originally posted by Nutshell
Nah i think it's possible, coz i saw someone done it before. I just want to know how to do it, even though txt file is an alternative.
http://community.borland.com/article...,27979,00.html
It involves the fact that executables can have data added to the end of the file and it will not mess up anything. Both Windows and Linux function in this matter, but Windows prevents self-modification while Linux allows it.
lol, I thought I forgot how to program until I realized that it really wasn't C++ code :P Anyway, that's really cool...and has an amazing potential for misuse by "naughty" people.
Away.
Not quite naughty... you could use the techniques to build a compiler.
Adventure Maker's compiler uses this technique...
Right thnx, exactly what i wanted, although im still not if that code is kylix or delphi
Last edited by Nutshell; 04-26-2003 at 08:19 PM.
Instead of using a txt file use an XML file!
There are those who say they can, and there are those who acutally do.
...you can not learn programming in a class, you have to learn it on your own
i dont think that really solves the problem as xml files can be opened in almost any text editor...Originally posted by cMADsc
Instead of using a txt file use an XML file!
Save the highscore in a binary file. That way it can't be easily modified through notepad.
If you're really paranoid, use encryption .
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
yes, you can open xml files with text editors but xml can make data organization easier. Just write yourself a nice parser.
Code:<player> <name>Mario</name> <score>1500></score> <lives>999</lives> </player>
Yes, but that doesn't change the fact that we're talking about storing it in the .exe file, so everything is together in one file...
Away.