C++ - 将 exe 转换为源代码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14134305/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 18:02:06  来源:igfitidea点击:

C++ - converting an exe to source code

c++visual-c++exenetbeans-7

提问by user1926152

I have an appilication (.exe) i had created the code in Netbeans using c++ and generated this .exe is there a way to generate the corresponding code related to this .exe

我有一个应用程序 (.exe) 我已经使用 c++ 在 Netbeans 中创建了代码并生成了这个 .exe 有没有办法生成与这个 .exe 相关的相应代码

Please provide an appropriate link to decompilers i am not able to figure those out.

请提供指向反编译器的适当链接,我无法弄清楚。

回答by Dietrich Epp

Not really.

并不真地。

You can use a disassembler, or a decompiler, but it will not look like the original source code and it will require a lot of work to understand what is going on (variable names will be lost, for example).

您可以使用disassemblerdecompiler,但它看起来不像原始源代码,并且需要大量工作才能了解发生了什么(例如,变量名称将丢失)。

You will get the best output if optimizations were disabled and debugging info was included when the source code was compiled. Even then you might get something impossible to read.

如果在编译源代码时禁用优化并包含调试信息,您将获得最佳输出。即便如此,你也可能会得到一些无法阅读的东西。

回答by Hyman

No, there is no direct way.

不,没有直接的方法。

Once source is compiled and specifically optimized any reference to it is in practice lost. You can disassemble it though, but you won't see any high level code.

一旦源代码被编译并专门优化,任何对它的引用实际上都会丢失。你可以反汇编它,但你不会看到任何高级代码。

回答by Gaurav

Use Hex-Rays Decompiler http://www.hex-rays.com/products/decompiler/index.shtmlIt converts executable programs into a human readable C-like pseudocode text

使用 Hex-Rays Decompiler http://www.hex-rays.com/products/decompiler/index.shtml它将可执行程序转换为人类可读的类 C 伪代码文本