Reputation: 855
I've written a game in C/C++ which is soon ready to be released.
My question is: what would be a good way to make the resources (images/sound etc) inaccessible to the user?
It doesn't have to be a strong encryption, I just don't want the average player to browse the resource folders.
As of now the resources are not linked in the Visual Studio project, they are loaded from a path.
Upvotes: 3
Views: 918
Reputation: 2039
A simple way to handle it would be to compress all the files into a password protected ZIP file that you unzip in memory (onto a memory based file system if you want to be fancy).
The obvious drawback is that you'll either need to keep everything in memory or do several calls to get the files you want at the moment.
EDIT: A quick search gave me this link to a Q&A relating to this: Simple way to unzip a .zip file using zlib
The hacker can still access these strings by detaching the application process with a debugger while the application is running.
Upvotes: 3
Reputation: 36896
It depends how badly you want to hide things from users; how much you're willing to invest versus the reward. Here are some ideas:
Upvotes: 4