有哪些技术可用于隐藏着色器资源?

发布于 2024-12-21 12:33:13 字数 194 浏览 4 评论 0原文

我的游戏和应用程序中有许多着色器,我目前使用一个简单的程序来获取着色器并生成一个 java 类,该类将文本放入 StringBuilder 中,一次一个字符,因此文本搜索找不到如果有人进行逆向工程,就会发生任何事情。

这感觉不对,但它确实可以让它们远离我的视线,但我并不幻想它们非常安全。

我看到一个关于预编译的问题,没有答案。还可以做什么?

I have a number of shaders in my games and apps, I currently use a simple program I made to take the shaders and generate a java class which puts the text into a StringBuilder, one char at a time, so text searching won't find anything if someone reverse enginneers.

It feels wrong, but it does the job of getting them out of immediate sight, but I'm under no illusion that they are very safe.

I've seen a question on pre-compiling, with no answers. What else can be done?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

比忠 2024-12-28 12:33:13

考虑到着色器通常是非常小的程序这一事实,到目前为止我见过的最好的解决方案就是按照您刚才所说的方式将它们嵌入到您的代码中。

这是相当安全的。

考虑一下,如果有人想拿走你的着色器,会通过从 GPU 转储它来实现,显然这要复杂得多,但可以完成(谈论逆向工程)。

加密是一个选项,但它确实只保护着色器的本地存储,我仍然可以在解密后转储程序的内存。

最后但并非最不重要的一点是,预编译着色器通常并不方便,考虑到您正在使用的平台上存在广泛的 GPU 和驱动程序实现,情况就更是如此。

回到关于预编译着色器的其他问题,OpenGL Gold Book(OpenGL ES 2.0 编程指南)的第 350 页有一个非常好的解释,其中解释了为什么您不应该这样做。

原因之一是设备供应商可以按照他们喜欢的方式自由存储二进制着色器。

我希望这有帮助。

块引用

The best solution I have seen so far, considering the fact that the Shaders are usually very small programs, is to embed them in your code in the way you just said you do.

This is quite safe.

Consider that, if someone wants to take your shaders, will do it by dumping it from the GPU, obviously it is way far more complicated but it can be done (talking about reverse engineering).

Encryption is an option but it does protect only the local storage of the shaders, I can still dump the memory of your program just after the decryption.

Last but not least, it is not convenient to pre-compile your shaders in general and it is even more true considering the platform you are working on where there is a wide family of GPUS and Drivers implementations.

Going back to your other question about pre-compiled shaders, there is a very good explanation at page 350 of the OpenGL Gold Book (OpenGL ES 2.0 Programming guide) where it is explained why you should not do it.

One of the reasons is that device vendors are free to store binary shaders in the way they prefer.

I hope it was helpful.

Blockquote

此岸叶落 2024-12-28 12:33:13

一种选择是加密文件。看看 Cipher< /a> 类。

One option is to encrypt the files. Have a look at Cipher class.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文