问题描述
我使用Microsoft Visual C ++ 2010 Express写我的程序。当我想分发我的程序时,我用'Release'配置编译它,并且我设置链接器不添加调试信息。所以我的问题是,我的可执行文件是安全的,任何人都可以反编译它,看到源代码?如果不安全,我该如何防止它被反编译?
I use Microsoft Visual C++ 2010 Express to write my programs. When i want to distribute my program I compile it with 'Release' configuration and also I set the linker to not add debug information. So my question is, Is my executable safe or anyone can decompile it and see the source code? If it is unsafe, how can I prevent it from being decompiled?
推荐答案
所有程序都可以反编译到某种程度。但是,您的源代码中的大量有用信息在编译期间将被删除。反编译器生成的源代码是对原始代码的模仿。
All programs can be decompiled to a degree. However, the vast bulk of the useful information in your source code is removed during compilation. The source code that a decompiler produces is a pale imitation of the original.
反编译后,变量名称,函数名称,类名称等将不可用。所以最好的反编译器可以做的是转动你的函数,看起来像这样:
The variable names, function names, class names etc. will not be available after decompilation. So the best that a decompiler can do is to turn your functions that look like this:
double CalculateWidgetStrength(int WidgetType, int WidgetFrobishness);
变成无意义的代码,如下所示:
into rather meaningless code like this:
double Function85(int p1, int p2);
即使成功做到这一点,反编译器也很难。
And even succeeding in doing that much accurately can be very hard for a decompiler.
这篇关于保护C ++程序免受反编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!