我一直在思考如何保护我的C/ c++代码不被反汇编和逆向工程破坏。通常情况下,在我的代码中,我绝不会宽恕这种行为;然而,为了各种人的安全,我目前正在研究的协议决不能被检查或理解。

现在这对我来说是一个新的主题,互联网并没有真正的资源来防止逆向工程,而是描述了大量关于如何逆向工程的信息

到目前为止我想到的一些事情是:

Code injection (calling dummy functions before and after actual function calls) Code obfustication (mangles the disassembly of the binary) Write my own startup routines (harder for debuggers to bind to) void startup(); int _start() { startup( ); exit (0) } void startup() { /* code here */ } Runtime check for debuggers (and force exit if detected) Function trampolines void trampoline(void (*fnptr)(), bool ping = false) { if(ping) fnptr(); else trampoline(fnptr, true); } Pointless allocations and deallocations (stack changes a lot) Pointless dummy calls and trampolines (tons of jumping in disassembly output) Tons of casting (for obfuscated disassembly)

我的意思是,这些是我想过的一些事情,但它们都可以在适当的时间框架内由代码分析师解决。我还有别的选择吗?


但只要有合适的时间框架,代码分析人员都可以解决这些问题。

如果你给人们一个他们能够运行的程序,那么只要有足够的时间,他们也能够对它进行逆向工程。这就是程序的本质。一旦二进制文件可供想要破译它的人使用,您就无法阻止最终的逆向工程。毕竟,计算机必须能够破译它才能运行它,而人类只是一台较慢的计算机。


安全网哨兵(原阿拉丁)。不过要注意的是——他们的API很烂,文档也很烂,但与他们的SDK工具相比,这两者都很棒。

I've used their hardware protection method (Sentinel HASP HL) for many years. It requires a proprietary USB key fob which acts as the 'license' for the software. Their SDK encrypts and obfuscates your executable & libraries, and allows you to tie different features in your application to features burned into the key. Without a USB key provided and activated by the licensor, the software can not decrypt and hence will not run. The Key even uses a customized USB communication protocol (outside my realm of knowledge, I'm not a device driver guy) to make it difficult to build a virtual key, or tamper with the communication between the runtime wrapper and key. Their SDK is not very developer friendly, and is quite painful to integrate adding protection with an automated build process (but possible).

Before we implemented the HASP HL protection, there were 7 known pirates who had stripped the dotfuscator 'protections' from the product. We added the HASP protection at the same time as a major update to the software, which performs some heavy calculation on video in real time. As best I can tell from profiling and benchmarking, the HASP HL protection only slowed the intensive calculations by about 3%. Since that software was released about 5 years ago, not one new pirate of the product has been found. The software which it protects is in high demand in it's market segment, and the client is aware of several competitors actively trying to reverse engineer (without success so far). We know they have tried to solicit help from a few groups in Russia which advertise a service to break software protection, as numerous posts on various newsgroups and forums have included the newer versions of the protected product.

最近,我们在一个较小的项目上尝试了他们的软件许可解决方案(HASP SL),如果您已经熟悉HL产品,那么这个解决方案就足够简单了。它似乎有效;目前还没有关于盗版事件的报道,但这款产品的需求要低得多。

当然,没有什么保护措施是完美的。如果有人有足够的动机,并且有大量的现金可以烧,我相信HASP提供的保护是可以规避的。


安布尔说的完全正确。你可以让逆向工程变得更难,但你永远无法阻止它。永远不要相信依赖于防止逆向工程的“安全性”。

That said, the best anti-reverse-engineering techniques that I've seen focused not on obfuscating the code, but instead on breaking the tools that people usually use to understand how code works. Finding creative ways to break disassemblers, debuggers, etc is both likely to be more effective and also more intellectually satisfying than just generating reams of horrible spaghetti code. This does nothing to block a determined attacker, but it does increase the likelihood that J Random Cracker will wander off and work on something easier instead.


很多时候,担心你的产品被逆向工程是多余的。是的,它可以被逆向工程;但它是否会在短时间内变得如此出名,以至于黑客们会发现它值得逆转。它吗?(对于大量的代码行来说,这项工作不是一个小时间活动)。

如果它真的能赚钱,那么你就应该筹集足够的资金,通过专利或版权等合法途径来保护它。

恕我直言,采取你将要采取的基本预防措施,然后释放它。如果它成为逆向工程的一个点,这意味着你已经做得非常好,你自己会找到更好的方法来克服它。祝你好运。


如果有人想花时间来反转你的二进制文件,那么你绝对无法阻止他们。你可以适度增加难度,但仅此而已。如果您真的想了解这一点,请获取http://www.hex-rays.com/idapro/的副本并分解一些二进制文件。

CPU需要执行代码的事实是你的失败。CPU只执行机器代码…程序员可以阅读机器代码。

话虽如此……你可能有不同的问题,可以用另一种方式解决。你想保护什么?根据您的问题,您可以使用加密来保护您的产品。


最好的反反汇编技巧,特别是在可变字长指令集上,是在汇编程序/机器代码中,而不是在c中

CLC
BCC over
.byte 0x09
over:

The disassembler has to resolve the problem that a branch destination is the second byte in a multi byte instruction. An instruction set simulator will have no problem though. Branching to computed addresses, which you can cause from C, also make the disassembly difficult to impossible. Instruction set simulator will have no problem with it. Using a simulator to sort out branch destinations for you can aid the disassembly process. Compiled code is relatively clean and easy for a disassembler. So I think some assembly is required.

I think it was near the beginning of Michael Abrash's Zen of Assembly Language where he showed a simple anti disassembler and anti-debugger trick. The 8088/6 had a prefetch queue what you did was have an instruction that modified the next instruction or a couple ahead. If single stepping then you executed the modified instruction, if your instruction set simulator did not simulate the hardware completely, you executed the modified instruction. On real hardware running normally the real instruction would already be in the queue and the modified memory location wouldnt cause any damage so long as you didnt execute that string of instructions again. You could probably still use a trick like this today as pipelined processors fetch the next instruction. Or if you know that the hardware has a separate instruction and data cache you can modify a number of bytes ahead if you align this code in the cache line properly, the modified byte will not be written through the instruction cache but the data cache, and an instruction set simulator that did not have proper cache simulators would fail to execute properly. I think software only solutions are not going to get you very far.

上面这些都是老的和众所周知的,我对当前的工具了解不够,不知道它们是否已经围绕这些事情工作了。自修改代码可能/将使调试器出错,但是人类可以/将缩小问题范围,然后看到自修改代码并解决它。

It used to be that the hackers would take about 18 months to work something out, dvds for example. Now they are averaging around 2 days to 2 weeks (if motivated) (blue ray, iphones, etc). That means to me if I spend more than a few days on security, I am likely wasting my time. The only real security you will get is through hardware (for example your instructions are encrypted and only the processor core well inside the chip decrypts just before execution, in a way that it cannot expose the decrypted instructions). That might buy you months instead of days.

另外,读读凯文·米特尼克的《欺骗的艺术》。这样的人可以拿起电话,让你或同事把秘密交给系统,以为那是公司其他部门的经理、其他同事或硬件工程师。你的安全系统也被破坏了。安全不仅仅是管理技术,还要管理人。


起初,虚拟机中受保护的代码似乎不可能进行逆向工程。Themida封隔器

但它不再那么安全了。无论你如何打包你的代码,你总是可以对任何加载的可执行文件进行内存转储,并使用任何反汇编程序(如IDA Pro)进行反汇编。

IDA Pro还提供了一个漂亮的汇编代码到C源代码转换器,尽管生成的代码看起来更像一个指针/地址数学混乱。如果你把它与原来的比较,你可以修复所有的错误,并撕下任何东西。


看看http://en.wikipedia.org/wiki/Security_by_obscurity#Arguments_against。我相信其他人可能也能给出一个更好的来源,说明为什么通过隐匿性实现安全是一件坏事。

它应该是完全可能的,使用现代加密技术,让您的系统是开放的(我不是说它应该是开放的,只是它可以是),并且仍然具有完全的安全性,只要加密算法没有漏洞(如果您选择了一个好的算法,就不太可能),您的私钥/密码保持私有,并且您的代码中没有安全漏洞(这是您应该担心的)。


可能最好的选择仍然是使用虚拟化,这引入了另一层需要绕过的间接/混淆,但正如SSpoke在他的回答中所说,这种技术也不是100%安全的。


关键是你不会得到终极保护,因为根本就没有这种东西,即使有,也不会持续太久,这意味着它一开始就不是终极保护。

凡是人组装起来的东西,都可以拆卸。

通常情况下,(正确的)拆卸通常是(一点或更多)更困难的任务,所以你的对手必须更熟练,但你可以假设总有这样的人,这是一个安全的赌注。

如果您希望保护某些内容不受REs的影响,那么您必须至少了解REs使用的常见技术。

这样的话

互联网并不是真正的资源预防逆向工程,而是描述了大量关于如何逆向工程的信息

表现出你的坏态度。我并不是说要使用或嵌入保护,你必须知道如何打破它,但要明智地使用它,你应该知道它的弱点和陷阱。你应该明白这一点。

(有一些软件以错误的方式使用保护,使得这种保护实际上不存在。为了避免含糊,我给你举一个在网上简单描述的例子:牛津英语词典第二版CD-ROM - v4。您可以在以下页面了解SecuROM使用失败的原因:16、32或64位Windows环境下CD-ROM上的牛津英语词典(OED):硬盘安装、错误、字处理宏、网络、字体等)

每件事都需要时间。

如果你是这门学科的新手,没有几个月甚至几年的时间来学习正则表达式,那么就使用其他人提供的可用解决方案。这里的问题很明显,它们已经在那里了,所以你已经知道它们不是100%安全的,但制作自己的新保护只会给你一种被保护的错误感觉,除非你非常了解逆向工程和保护的艺术状态(但你不知道,至少目前不知道)。

软件保护的目的是吓唬新手,拖延常见的正则,并让经验丰富的正则在她/他(希望很有趣)到达应用程序中心后面带微笑。

在商业谈话中,你可能会说这都是为了尽可能地推迟竞争。

(看看Philippe Biondi和Fabrice Desclaux在Black Hat 2006上展示的Skype中的银针)。


你知道有很多关于RE的东西,所以开始阅读吧。:)

我说过虚拟化,所以我将给你一个链接到EXETOOLS论坛的一个示例线程:最佳软件保护:Themida还是Enigma protector ?这可能会对你进一步的搜索有所帮助。


使代码难以进行逆向工程称为代码混淆。

你提到的大多数技术都很容易解决。他们专注于添加一些无用的代码。但是无用的代码很容易被发现和删除,留下一个干净的程序。

为了有效地混淆,您需要使程序的行为依赖于正在执行的无用部分。例如,与其这样做:

a = useless_computation();
a = 42;

这样做:

a = complicated_computation_that_uses_many_inputs_but_always_returns_42();

或者不这样做:

if (running_under_a_debugger()) abort();
a = 42;

这样做(其中running_under_a_debugger不应该很容易被识别为测试代码是否在调试器下运行的函数-它应该将有用的计算与调试器检测混合在一起):

a = 42 - running_under_a_debugger();

有效的混淆并不是仅仅在编译阶段就能做到的。编译器能做的,反编译器也能做。当然,您可以增加反编译器的负担,但这不会有太大的帮助。有效的混淆技术,就其存在而言,包括从第一天开始编写混淆的源代码。让你的代码自修改。你的代码中充斥着从大量输入中得到的计算跳跃。例如,而不是简单的调用

some_function();

这样做,你碰巧知道some_data_structure中精确的位的预期布局:

goto (md5sum(&some_data_structure, 42) & 0xffffffff) + MAGIC_CONSTANT;

如果你认真对待混淆,那就在你的计划中增加几个月的时间;混淆视听代价不菲。请务必考虑到,到目前为止,避免人们对您的代码进行逆向工程的最好方法是使其无用,这样他们就不会费心了。这是一个简单的经济考虑:如果对他们来说价值大于成本,他们就会逆向工程;但提高他们的成本也会大大提高你的成本,所以尽量降低他们的价值。

既然我已经告诉过你,混淆是困难和昂贵的,我要告诉你,无论如何,它不适合你。你写

目前我正在研究的协议绝不能被检查或理解,为了各种人的安全

这是一个危险的信号。它是通过默默无闻来保证安全的,而默默无闻的记录非常糟糕。如果协议的安全性依赖于人们不知道协议,那么你已经输了。

推荐阅读:

安全圣经:Ross Anderson的《安全工程》 混淆的圣经:由Christian Collberg和Jasvir Nagra开发的Surreptitious软件


与大多数人所说的相反,基于他们的直觉和个人经验,我不认为密码安全的程序混淆通常被证明是不可能的。

这是一个完美混淆的程序语句的例子,以证明我的观点:

printf("1677741794\n");

人们永远猜不到它真正的作用是什么

printf("%d\n", 0xBAADF00D ^ 0xDEADBEEF);

关于这个问题有一篇有趣的论文,它证明了一些不可能的结果。它叫做“关于混淆程序的(Im)可能性”。

尽管这篇论文确实证明了使程序与它实现的函数不可区分的混淆是不可能的,但以某种较弱的方式定义的混淆仍然是可能的!


不行,你不能保护你的代码不被反汇编。你所能做的就是为业务逻辑设置服务器,并使用webservice为你的应用程序提供它。当然,这种情况并不总是可行的。


最近有一篇论文叫做“程序混淆和一次性程序”。如果你真的想保护你的应用程序。本文主要围绕使用简单通用硬件的理论不可能结果。

如果你负担不起额外的硬件,那么还有另一篇论文,在所有具有相同功能和相同大小的程序中,给出了理论上的最佳可能混淆“On最佳可能混淆”。然而,本文表明,信息理论的最佳可能意味着多项式层次结构的崩溃。

如果这些结果不能满足你的需要,这些论文至少应该给你足够的参考书目引导去查阅相关文献。

更新:一种新的混淆概念,称为不可区分混淆,可以减轻不可能性结果(论文)


要了解自己,请阅读有关代码混淆的学术文献。亚利桑那大学的克里斯蒂安·科尔伯格是这一领域的著名学者;哈佛大学的Salil Vadhan也做了一些不错的工作。

我在这方面落后了,但我知道的基本思想是,你不能阻止攻击者看到你将执行的代码,但你可以用没有执行的代码包围它,攻击者花费指数级的时间(使用最知名的技术)来发现你的代码的哪些片段被执行了,哪些没有。


关于隐藏代码要记住的第一件事:不是所有的代码都需要隐藏。

最终目标:我对大多数软件程序的最终目标是能够出售不同的许可证,这些许可证将打开和关闭我的程序中的特定功能。

最佳技术:我发现构建一个像WordPress提供的钩子和过滤器系统,绝对是迷惑对手的最佳方法。这允许您加密某些触发器关联,而无需实际加密代码。

这样做的原因是,您希望加密尽可能少的代码。

了解你的破解者:了解这一点:破解代码的主要原因不是因为恶意分发许可,实际上是因为需要更改你的代码,而他们真的不需要分发免费副本。

入门:撇开少量要加密的代码,其余的代码应该尝试塞到一个文件中,以增加复杂性和可理解性。

准备加密:你将在我的系统中分层加密,这也将是一个非常复杂的过程,所以构建另一个程序来负责加密过程。

第一步:使用base64名称来混淆所有内容。完成之后,将混淆的代码base64,并将其保存到一个临时文件中,该文件稍后将用于解密和运行此代码。有意义吗?

我重复一遍,因为你会一次又一次地这样做。您将创建一个base64字符串,并将其保存到另一个文件中,作为将被解密和呈现的变量。

第二步:您将把这个临时文件作为一个字符串读入并混淆它,然后将它作为base64并将其保存到第二个临时文件中,该文件将用于解密并为最终用户呈现它。

第三步:重复第二步,你想重复多少次都行。一旦你让它正常工作,没有解密错误,然后你就会想要开始为你的对手埋地雷。

雷区一:你一定要把你收到通知这件事绝对保密。因此,在第2层构建一个破解尝试安全警告邮件系统。这将让你知道你的对手的细节,如果有任何事情是错误的。

地雷二:依赖。你不希望你的对手能够运行第1层,而没有第3层、第4层或第5层,甚至没有实际设计的程序。因此,请确保在第一层中包含某种终止脚本,如果程序不存在,该脚本将被激活,或在其他层中。

我相信你能想出你自己的地雷,玩得开心。

需要记住的事情:你可以加密你的代码,而不是base64。这样,简单的base64就不会解密程序。

奖励:记住,这实际上是你和对手之间的一种共生关系。我总是在第一层里面放一条评论,评论祝贺破解者,并给他们一个促销码,以便从你那里获得现金奖励。

让现金奖励意义重大,但不涉及偏见。我通常会说500美元左右。如果你的男朋友是第一个破解密码的人,那就付钱给他,成为他的朋友。如果他是你的朋友,他就不会分发你的软件。问问他是怎么做到的,你可以如何改进!

好运!


正如很多人已经说过的:在一个普通的CPU上,你不能阻止它们,你只能延迟它们。就像我以前的密码学老师告诉我的那样:你不需要完美的加密,破解密码的代价肯定比获得的代价更大。你的困惑也是一样。

但还有3个注意事项:

It is possible to make reverse engineering impossible, BUT (and this is a very very big but), you cant do it on a conventional cpu. I did also much hardware development, and often FPGA are used. E.g. the Virtex 5 FX have a PowerPC CPU on them, and you can use the APU to implement own CPU opcodes in your hardware. You could use this facility to really decrypt incstuctions for the PowerPC, that is not accessible by the outside or other software, or even execute the command in the hardware. As the FPGA has builtin AES encryption for its configuration bitstream, you could not reverse engineer it (except someone manages to break AES, but then I guess we have other problems...). This ways vendors of hardware IP also protect their work. You speak from protocol. You dont say what kind of protocol it is, but when it is a network protocol you should at least protect it against network sniffing. This can you indeed do by encryption. But if you want to protect the en/decryption from an owner of the software, you are back to the obfuscation. Do make your programm undebuggable/unrunnable. Try to use some kind of detection of debugging and apply it e.g. in some formula oder adding a debug register content to a magic constant. It is much harder if your program looks in debug mode is if it where running normal, but makes a complete wrong computation, operation, or some other. E.g. I know some eco games, that had a really nasty copy-protection (I know you dont want copyprotection, but it is similar): The stolen version altered the mined resources after 30 mins of game play, and suddenly you got just a single resource. The pirate just cracked it (i.e. reverse engineered it) - checked if it run, and volia released it. Such slight behaviour changings are very hard to detect, esp. if they do not appear instantly to detection, but only delayed.

所以最后我想建议: 估算逆向工程人员的收益,将其转化为一些时间(例如,使用最便宜的印度工资),并进行逆向工程,使时间成本更大。


我不认为任何代码都是牢不可破的,但奖励必须非常棒,才能让人们愿意尝试它。

话虽如此,你还是应该做以下事情:

Use the highest optimization level possible (reverse engineering is not only about getting the assembly sequence, it is also about understanding the code and porting it into a higher-level language such as C). Highly optimized code can be a b---h to follow. Make structures dense by not having larger data types than necessary. Rearrange structure members between official code releases. Rearranged bit fields in structures are also something you can use. You can check for the presence of certain values which shouldn't be changed (a copyright message is an example). If a byte vector contains "vwxyz" you can have another byte vector containing "abcde" and compare the differences. The function doing it should not be passed pointers to the vectors but use external pointers defined in other modules as (pseudo-C code) "char *p1=&string1[539];" and "char p2=&string2[-11731];". That way there won't be any pointers pointing exactly at the two strings. In the comparison code you then compare for "(p1-539+i)-*(p2+11731+i)==some value". The cracker will think it is safe to change string1 because no one appears to reference it. Bury the test in some unexpected place.

尝试自己破解汇编代码,看看哪些是容易的,哪些是困难的。您可以尝试一些想法,使代码更难进行反向工程,并使调试更加困难。


Take, for example, the AES algorithm. It's a very, very public algorithm, and it is VERY secure. Why? Two reasons: It's been reviewed by lots of smart people, and the "secret" part is not the algorithm itself - the secret part is the key which is one of the inputs to the algorithm. It's a much better approach to design your protocol with a generated "secret" that is outside your code, rather than to make the code itself secret. The code can always be interpreted no matter what you do, and (ideally) the generated secret can only be jeopardized by a massive brute force approach or through theft.

我认为一个有趣的问题是“为什么你想让你的代码变得模糊?”你想让攻击者难以破解你的算法?让他们更难在你的代码中发现可利用的漏洞?如果代码一开始就不可破解,那么您就不需要混淆代码。问题的根源在于易破解的软件。解决问题的根源,不要只是混淆它。

而且,你的代码越混乱,你就越难找到安全漏洞。是的,这对黑客来说很难,但你也需要找到漏洞。从现在开始,代码应该很容易维护,即使是编写良好的清晰代码也很难维护。不要让事情变得更糟。


为了能够做出正确的选择,你应该考虑以下几个方面:

有没有可能“新用户”不愿意花钱而是使用你的软件? 现有客户是否有可能需要比他们拥有的更多的许可证? 潜在用户愿意支付多少钱? 你想按用户/并发用户/工作站/公司发放许可证吗? 你的软件需要培训/定制才能有用吗?

如果问题5的答案是“是”,那么就不用担心非法拷贝。反正也没用。

如果问题1的答案是“是”,那么首先考虑定价问题(见问题3)。

如果你回答问题2“是”,那么“按使用付费”模式可能会 适合你。

从我的经验来看,按使用付费+定制和培训是最好的保护 为您的软件,因为:

新用户被定价模式所吸引(很少使用->很少付费) 几乎没有“匿名用户”,因为他们需要培训和定制。 没有软件限制会吓跑潜在客户。 现有客户源源不断地提供资金。 由于长期的业务关系,您可以从客户那里得到有价值的发展反馈。

在您考虑引入DRM或混淆之前,您可能会考虑这些要点,以及它们是否适用于您的软件。


有人试过codemoth: http://www.sourceformat.com/code-obfuscator.htm吗? 或者Themida: http://www.oreans.com/themida_features.php ?

晚一点看起来更有希望。


通过不公开来保证安全并不像比他聪明得多的人所证明的那样有效 我们两个。如果你必须保护你的客户的通信协议,那么你是 道德上有义务使用最好的代码,这些代码是公开的,并由专家全面审查。

这适用于人们可以检查代码的情况。如果您的应用程序是在嵌入式微处理器上运行的,那么您可以选择一个具有密封功能的微处理器,这使得在运行时不可能检查代码或观察更多的琐碎参数,例如当前使用情况。(是的,除了硬件入侵技术,你要小心地拆卸芯片,使用先进的设备来检查单个晶体管上的电流。)

我是x86逆向工程汇编程序的作者。如果你准备感冒的话 惊喜,寄给我你竭尽全力的结果。(通过我的网站联系我。) 在我所看到的答案中,很少有人会给我带来实质性的障碍。如果你想看的话 如何复杂的逆向工程代码工作,你真的应该研究网站 逆向工程挑战。

你的问题需要澄清一下。你怎么能保守协议的秘密,如果 计算机代码可以进行逆向工程吗?如果我的协议是发送一个RSA加密消息(甚至是公钥),通过保持协议的秘密,你能得到什么? 出于所有实际目的,检查器将面对一系列随机比特。

问候阿尔伯特


为了避免逆向工程,您不能将代码提供给用户。也就是说,我建议使用在线应用程序……然而(因为你没有给出背景),这对你来说可能是毫无意义的。


自2013年7月以来,人们对密码学上健壮的混淆(以不可区分混淆的形式)重新产生了兴趣,这似乎是由Amit Sahai的原始研究激发的。

Sahai, Garg, Gentry, Halevi, Raykova, Waters,候选人 以及所有电路的功能加密(2013年7月21日)。 Sahai, Waters,《如何使用无区别模糊处理》 可否认加密,以及更多。 Sahai, Barak, Garg, Kalai, Paneth,保护混淆不受代数攻击(2014年2月4日)。

您可以在这篇Quanta Magazine文章和IEEE Spectrum文章中找到一些提炼的信息。

目前,利用这项技术所需的资源数量使其不切实际,但AFAICT的共识是对未来相当乐观。

我这么说很随意,但对于那些习惯于本能地忽视混淆技术的人来说——这是不同的。如果它被证明是真正的工作和实际,这确实是重要的,而不仅仅是为了混淆视听。


传统的逆向工程技术依赖于智能代理使用反汇编程序回答关于代码的问题的能力。如果你想要更强的安全性,你必须做一些事情,可以证明阻止代理得到这样的答案。

您可以通过依赖停止程序(“程序X停止吗?”)来做到这一点,这通常是无法解决的。向程序中添加难以推理的程序,会使程序难以推理。构建这样的程序要比拆解它们容易。你也可以在程序中添加推理难度不同的代码;一个很好的候选程序是关于别名(“指针”)的推理程序。

Collberg等人有一篇论文(“制造廉价、弹性和隐形的不透明结构”)讨论了这些主题,并定义了各种“不透明”谓词,这些谓词会使对代码的推理变得非常困难:

http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.39.1946&rep=rep1&type=pdf

我还没有看到Collberg的具体方法应用于产品代码,尤其是C或c++源代码。

DashO Java混淆器似乎使用了类似的想法。 http://www.cs.arizona.edu/~collberg/Teaching/620/2008/Assignments/tools/DashO/


有一件事到目前为止还没有被提及:

您可以在自己的端(服务器端,例如由REST API调用)运行部分代码。这样,逆向工程师就完全无法访问代码。

当然,这只适用于

延迟 交通量 计算和I/O功率 隐私问题

不会阻止服务器端执行(部分)您的代码。