我可以使用 mono 的 AOT 功能来本地“预编译”吗? .NET DLL/EXE 使它们更难进行逆向工程?
我可以使用 mono 的 AOT(提前编译)功能来本机“预编译”我自己的一些 .NET DLL(和/或 EXE)的全部或部分,以使它们更难以进行逆向工程吗?我正在使用 Windows(7 / x64,但我也有 x86 XP 机器)和 .NET 3.5(VS 2008),我很好奇 mono/AOT 是否可以/已经用于此目的? (此时将它们绑定到 x86 是可以接受的。)
另请参阅 此问题 我尝试过这个但没有运气。
Can I use mono's AOT (Ahead of Time compilation) feature to natively "pre-compile" all or part of some of my own .NET DLLs (and or EXEs) to make them harder to reverse engineer? I'm using Windows (7 / x64 but I have an x86 XP machine as well) and .NET 3.5 (VS 2008) and I'm curious if mono/AOT can be/has been used for this purpose? (Tying them to x86 is acceptable at this point.)
See also this question where I tried this and had no luck.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一旦代码被预编译,程序集中的 IL 代码就可以被删除(这就是我们为 monotouch 所做的,例如,为了减少应用程序下载大小)。有一些限制,但它有效。
不过,你是否应该不遗余力地用困惑来迷惑你的客户是另一回事。
The IL code in assemblies can be removed once the code has been precompiled (this is what we do for monotouch, for example, to reduce app download size). There are a few restrictions, but it works.
Whether you should go to such lengths to screw your costumers with obfuscation is another matter, though.
AFAIK,mono 的 AOT 不会删除元数据,这意味着黑客有大量信息可以尝试理解代码中的逻辑。
此外,它并不适用于所有处理器和平台(特别是我认为它不适用于 Windows)。
尝试一些商业混淆器可以更容易地做到这一点,同时带走大部分元数据。
AFAIK, mono's AOT doesn't remove the metadata which means a hacker has lots of information to try to understand the logic in your code.
Also it isn't available for all processors and platforms (specifically I think it isn't available on Windows).
It is easier to try some commercial obfuscators that do just that, while taking away most of the metadata.
简短的回答,不。
AOT 程序集只会生成一个共享库,因此下次您使用该程序集时,Mono 不必对您使用的方法进行 JIT 编译,而是从 .so 加载它们。您的程序集需要在那里,因为仍然需要其中的元数据。
Short answer, no.
AOT'ing an assembly will only generate a shared library so the next time you use that assembly, Mono will not have to JIT-compile the methods that you use, but instead it will load them from the .so. Your assembly needs to be there because the metadata in it is still needed.