使用户无法访问资源 [英] Make resources inaccessible for user

查看:110
本文介绍了使用户无法访问资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用C / C ++写了一个游戏,很快就可以发布了。

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.

到目前为止,资源没有在Visual Studio项目中链接,它们是从一个路径加载的。

As of now the resources are not linked in the Visual Studio project, they are loaded from a path.

推荐答案

一个简单的方法来处理它将压缩所有的文件到一个密码保护的ZIP文件,你解压缩在内存中(如果你想成为一个基于内存的文件系统)。

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.

编辑:一个快速搜索给我这个链接到一个Q& A有关这个:
使用zlib解压缩.zip文件的简单方法

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.

这篇关于使用户无法访问资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆