代码混淆?
所以,我对复活节彩蛋很感兴趣……这可以追溯到我作为复活节彩蛋档案发现社区的一部分的时候。
不过,我也做了很多开源编程。
我想知道的是,您认为系统地、有条理地混淆代码的最佳方法是什么。
首选 PHP/Python/C/C++ 中的示例,但如果方法解释得当,其他语言也可以。
So, I have a penchant for Easter Eggs... this dates back to me being part of the found community of the Easter Egg Archive.
However, I also do a lot of open source programming.
What I want to know is, what do you think is the best way to SYSTEMATICALLY and METHODICALLY obfuscate code.
Examples in PHP/Python/C/C++ preferred, but in other languages is fine, if the methodology is explained properly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
对于系统且有条理的代码混淆,Perl 是无可比拟的。 如果您想要编译为二进制文件的东西,总有 APL。
如果您的目标是 .NET 框架,请将复活节彩蛋源代码作为 binhex 字符串放入资源文件中。 然后,您可以让初始化例程之一获取它,对其进行解码并将其编译到内存中。 您可以使用反射来调用它。
如果您需要编译到内存和调用生成的程序集的技术方面的帮助,我可以为您提供我编写的库和使用它的示例程序。
您可以使用此技术来加载插件,这是合法的事情,并且在初始化程序中是合理的。
For systematic and methodical obfuscation of code, you cannot beat Perl. If you want something that compiles to a binary, there is always APL.
If you are targeting the .NET framework, put your easter egg source code in a resource file as a binhex string. Then you can have one of your initialisaing routines fetch it, decode it and compile it into memory. You can invoke it using reflection.
If you need help with the technical aspects of compiling into memory and calling into the resultant assembly I can give you I library I wrote and a sample program that uses it.
You can use this technology to load plug-ins, which is a legit thing to do and reasonable in an initialiser.
一些明显的方法:
Some obvious methods:
问题是如何在显而易见的情况下(开源)创建看似非混淆的代码,而不使其看起来执行其他功能。
The question is how to create seemingly non-obfuscated code in plain sight (open source) without it appearing to perform another function.
本着重命名符号的精神:通过使用相同的名称命名不同的变量来过度使用范围和可见性规则。
In the spirit of renaming symbols: overuse scope and visibility rules by naming different variables with the same name.
在这种情况下,您应该使用/编写一个“混淆器”。 一个为您完成工作的程序。
Salamander Obfuscator 可用于混淆 .Net 程序,但它更多的是为了防止反编译,因此不完全是您所需要的。
学习混淆的好地方C 是国际混淆 C 代码大赛
In that case, you should use/write an "obfuscator". A program that does the job for you.
The Salamander Obfuscator can be used to obfuscate .Net programs, but it is more to prevent decompilation, thus not exactly what you need.
A good place to learn about obfuscation in C is International Obfuscated C Code Contest
我可以保证结果将是完全不可读的,你甚至无法阅读它;)
I can guarantee the result will be so utterly unreadable that you won't even be able to read it ;)