Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - saving variables on harddrive | | | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
paraplayer Snifit Level: 22 Posts: 163/280 EXP: 57271 For next: 1079 Since: 06-06-05 Since last post: 44 days Last activity: 44 days |
| ||
Well i've learnt quite a bit. I can save a variable in notepad then recall it into another using a few string functions but... I want something that's not editable! Is there a special file format or do i have to use a special code to save all my variables? also pancakes. |
|||
neotransotaku Baby Mario 戻れたら、 誰も気が付く Level: 87 Posts: 3409/4016 EXP: 6220548 For next: 172226 Since: 03-15-04 From: Outside of Time/Space Since last post: 11 hours Last activity: 1 hour |
| ||
if you do not want the file editable, just make the file read-only if you encode it, then editing it would mess up what you saved |
|||
HyperLamer <||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people Sesshomaru Tamaranian Level: 118 Posts: 5355/8210 EXP: 18171887 For next: 211027 Since: 03-15-04 From: Canada, w00t! LOL FAD Since last post: 2 hours Last activity: 2 hours |
| ||
Actually there are ways to do so. One, binary files instead of text (unless you're storing text ) would make it harder for them to figure out the file format. Two, simple encryption could help (the most popular kind, though pretty easy to beat, is to XOR each byte with some specific number before writing it to and after reading it fromt the file). Three, A checksum somewhere in the file can make things especially difficult. (Bonus if you stick a bunch of garbage at the end of the file to force it to have a certain checksum, instead of just storing the checksum in the file. ) Making the file read-only is an incredibly lame protection and will cause problems when your program tries to write to it. |
|||
paraplayer Snifit Level: 22 Posts: 175/280 EXP: 57271 For next: 1079 Since: 06-06-05 Since last post: 44 days Last activity: 44 days |
| ||
Maybe i'll just write a little note at the beggining of it say "Please dont hack!" then i'll just rely on the decentsy in peoples hearts. Couldn't a binary file be used to store text? i mean. not text but binary code that represents text? |
|||
beneficii Lakitu Level: 36 Posts: 233/567 EXP: 299656 For next: 8454 Since: 06-27-04 From: Cordova, TN, USA Since last post: 14 hours Last activity: 6 hours |
| ||
Originally posted by paraplayer Nuh uh. You gotta come up with your own algorithms and then you gotta implement them. |
|||
Ramsus Octoballoon Level: 19 Posts: 124/162 EXP: 34651 For next: 1126 Since: 01-24-05 From: United States Since last post: 39 days Last activity: 71 days |
| ||
Originally posted by paraplayer Actually, a text file stores text in the binary code that represents it (ASCII, but also extended character sets like ISO-8859-1 and UTF-8). Most operating systems don't even consider binary and text files different. The real difference is that with text I/O, you read and write data using string buffers (which also being done 1 byte at a time means you never have to worry about endianness). With binary I/O operations (read, write), you write blocks of data to disk as they're represented in memory. A string is the same regardless, so you can use binary I/O operations to read and write them with the same results. Anyway, it's impossible to keep users from editing/tampering with your data (especially files) while giving them a program that can both change and use that data. Why? Even if you use public/private key encryption, your program needs both keys to read and write the data, so they can be removed and used to fake data. If your program needs to store and retrieve information that your users shouldn't have access to (or the ability to save), the only way to securely accomplish it is to make it a web application running on a remote server that the users interact with through their browser. Now, if you just want to make it a bit harder for an "average" computer user to tamper with your files, try gzip compressing the data, encrypting the GZIP header using a simple algorithm, and creating an SHA1 checksum, then writing it all to a file. It's easy to circumvent, but it'll confuse the hell out of regular users and they won't mess with it. Anything more complicated is a bunch of work for a problem that can't be solved. In other words, the real problem isn't that you can't save "special files" that users can't tamper with, but that your program is designed to require such things. |
|||
Jaguarstrike Level: 8 Posts: 28/32 EXP: 1469 For next: 718 Since: 08-28-05 From: Brooklyn, NYC Since last post: 24 days Last activity: 24 days |
| ||
Youre all morons. Well, not really, but youre missing the obvious. Save the file in the system32 directory as a dll file with an important sounding name! |
|||
Gavin Fuzzy Rhinoceruses don't play games. They fucking charge your ass. Level: 43 Posts: 731/799 EXP: 551711 For next: 13335 Since: 03-15-04 From: IL, USA Since last post: 13 hours Last activity: 13 hours |
| ||
Originally posted by Jaguarstrike Heh, actually he has the right idea. Save it where similar pieces of sensitive data go, like the registry or Application Data, or whichever area your particular platform has set aside. That's why they made those areas in the first place. |
|||
HyperLamer <||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people Sesshomaru Tamaranian Level: 118 Posts: 7104/8210 EXP: 18171887 For next: 211027 Since: 03-15-04 From: Canada, w00t! LOL FAD Since last post: 2 hours Last activity: 2 hours |
| ||
That doesn't make it uneditable though. That just keeps n00bs from finding it. Plus, this is a huge bump. |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - saving variables on harddrive | | | |