Jump to content
  • Advertisement
Sign in to follow this  
Retlaf

Hidden Source Files (perhaps difficult to explain in one line)

This topic is 4284 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm new to these forums! This is my second semester of my first year of Software Engineering in University. The thing that interests me most is game development. Anyway, I've been messing around with OpenGL & C++ and it's been a blast. Now, I've come here with what might turn out to be a very simple question, but might not. I'm really not sure! What I want to know is how I can hide my source image files, music files, etc. so that the average user will not be able to view/edit them. Right now I basically import everything from a folder. But the user could just open up the folder and get a sneak peek at all the textures and music used for the hidden levels and everything! I would like to make these files hidden or encypted somehow. Is there an easy way to do this? I use Microsoft Visual Studio C++ 6.0 if that needs to be known. Edit: I forgot to mention that if this IS a difficult task, I'd be thrilled if you could send me in the right direciton towards learning how to do this. Thank a lot! ~Retlaf

Share this post


Link to post
Share on other sites
Advertisement
Is including them as resources in the executable out of the question? If not that, have you considered a "virtual file system"?

Share this post


Link to post
Share on other sites
You can put all your resources in a zip file (or some other, possibly your own, format) and extract it in-memory. This is what older quakes used to do anyway(.pak is just a .zip renamed, AFAIK. I don't know about the newer ones). There are libraries which can help with this, like physfs.

You could also build all the resources into your executable by using resources. I don't know much about this, I don't use resource files.

Note none of these will stop determined attempt to get to your data, but it will stop a casual look for these files.

Encryption would also work, but its not difficult to read the data once you decrypt it in memory so you can't stop the data being read altogether.

Share this post


Link to post
Share on other sites
"Is including them as resources in the executable out of the question?"

No. I don't believe so, anyway. I've never tried it nor do I know how to go about doing it. I suppose it would depend if the file types I use would be compatible with this method. But I don't know anything about it... so I'd be very thankful if you could send me in the right direction for learning more about how to do this.

Share this post


Link to post
Share on other sites
You can do that by adding them as resources. I don't remember how they work, but the last time I saw this being used was here: http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=38
Basically, they will be placed inside your executable file.
Another way, especially if you don't want to load it all at the starting, is to make your own file format, or just encript existing ones.
EDIT: this was posted before you replied. Anyway, I really think you should try to learn how resources work - this will be the easier way to do what you want (however, I have never tried to use them in Visual Studio, so I can't really tell you how to do it).

Share this post


Link to post
Share on other sites
There are a few ways I can thinl of off the top of my head, some easier than others, some more secure (nonthing is totaly secure)

1) Compile all the source files into a single file, you will need to write a bit of code to handle the loading of the indvidual resource from this file. This is how a lot of big games (eg Doom :) ) do it, ie the WAD file. Think of it as a "zip" file containing many other files, not always compressed. You could add some form of encryption to this.

2) Use a less common file format (if you were using directx you could use DDS which is less likely to be supported on a "user" machine.

3) Roll your own image and sound file types and your own loaders (can just be adding more header info at the start of the file to confuse regular editing software.

"1" is probably your best option but it is a bit of work.

There is prob. some libs out there to do it if you hunt for them.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!