Hiding application resources

I am making a simple game with SFML 1.6 in C ++. Of course, I have many image files, levels and data. The problem is that I do not want these files to be visible. Right now they are just image files in the res/ subdirectory, and I want to either hide them or encrypt them. Is it possible to put raw data from files into a resource file or something else? Any solution is fine for me, I just don't want the files to be open to the user.

EDIT

Cross-platform solutions are best, but if they do not exist, everything is fine, I work on windows. But I do not want to use the library if it is not needed.

+4
source share
2 answers

Most environments have a resource compiler that converts images / icons / etc to string data and includes them in the source code.

Another common method is to copy them to the end of the final .exe as the last part of the build process. Then, at run time, open the .exe file as a file and read the data from a specific specific offset, see Embedding a file system in an executable?

0
source

The ideal way to do this is to create your own archive format, which will contain all the data of your files, as well as additional information necessary for a clear separation of the files inside it.

0
source

Source: https://habr.com/ru/post/1416255/


All Articles