PDA

View Full Version : Protecting Resources?


UselessRob
2005.04.14, 02:08 AM
Howdy

Just a quick question: Is there a way of protecting your resources when compiling a bundle? What I mean is, you can just open a terminal and cd into the bundle and get whatever you like out of it, it makes it easy to code for, but I'd like to stop people fiddling with my files. Is that possible? Is there someway to "lock" them so they can't be read/changed? Or is the solution to somehow combine them in my own data file format? If that's the case, any pointers?

Ok, so it was a little more than one quick question. :)

Rob.

PowerMacX
2005.04.14, 03:34 AM
Howdy

Just a quick question: Is there a way of protecting your resources when compiling a bundle? What I mean is, you can just open a terminal and cd into the bundle and get whatever you like out of it, it makes it easy to code for, but I'd like to stop people fiddling with my files. Is that possible?
Actually, is even easier than Terminal+cd: Try right-clicking (or control-clicking) on your app, and select "Show Package Contents" :sneaky:

Is there someway to "lock" them so they can't be read/changed? Or is the solution to somehow combine them in my own data file format? If that's the case, any pointers?

If you want to prevent casual users from opening and playing with your files, simply change their extensions. For instance, change every file extension to .dat, or something non-standard. You will still be able to read them, but a double click won't open them anymore. Another thing you can do to prevent casual access, is compress everything in one file and use zlib or some other library to read your files directly from that one compressed file. Of course, if you use zip or gz, remember to change the extension to something else!
Also, you could try using a password protected, compressed file, and embed the password in your app. It won't be 100% secure, but would make things a bit harder for the occasional tinkerer.

UselessRob
2005.04.14, 04:59 AM
Wow, it is even easier than I thought! :)

I've tried renaming the files, but I hadn't thought of zipping or anything like that.

All great suggestions, thanks a lot!

Puzzler183
2005.04.15, 09:36 AM
Just remember that any scheme you come up with, no matter how complicated, can and will always be broken. People have a lot of free time:P.

UselessRob
2005.04.15, 09:52 AM
Hehe ofcourse. I just want it to be harder than a quick click for people to mess with the data files.

Just stop the casual folks having a fiddle.

Err.. I mean that in the nicest possible way. :)

blobbo
2005.04.15, 02:00 PM
UselessRob: Frankly, I don't see the problem with people poking around your app bundle. Almost all commercial games leave the resources sitting out there. Really, I doubt it's worth it.

kelvin
2005.04.15, 03:43 PM
There is a commercial toolkit for encrypting all your assets in the bundle. But the name escapes me at the moment.

UselessRob
2005.04.15, 10:26 PM
Blobbo: The reason I want to do something to stop fiddling is that with my first Windows shareware app way back when, I wasn't bothered by it. I had my files in the exe as resources, and it took only a couple of days before I had emails from people saying they'd simply changed the "please register" message to a blank image. Now, this was partly my fault for doing such simple crippling, but I then added some simple checks and stuff and it didn't happen again. :) So I just wanna take a simple step to stop the average user playing with it. I'd rather choose which bits are customizable, if that makes any sense. I'm small and petty. :)