是否可以反编译 C++ 可执行文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50145627/
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
Is it possible to decompile a C++ executable file
提问by T. Lang
I lost the source code to an executable file but still have the actual file. Is there any way to retrieve the original C++ code?
我丢失了可执行文件的源代码,但仍有实际文件。有没有办法检索原始的C++代码?
采纳答案by James Whyte
Duplicate of this question here.
Yes, it is possible, however when it comes to peeking function bodies and the like, you might have a little less luck. Operating systems like Kali Linux specialize in de-compilation and reverse engineering, so maybe look into a VM of that. And of course, windows has a lot of applications you can use as well to check the application code.
是的,这是可能的,但是当涉及到窥视函数体等时,你的运气可能会差一点。像 Kali Linux 这样的操作系统专门从事反编译和逆向工程,所以也许可以研究一下虚拟机。当然,Windows 有很多应用程序也可以用来检查应用程序代码。
Look over the other question for specific app suggestions. :)
查看其他问题以获取特定应用程序建议。:)
- Edit : You will most likely have lost all your logic and function bodies, but you might be able to recover the overall structure. It's your EXE so you might be more familiar with how it was all connected up.
- 编辑:您很可能已经丢失了所有逻辑和函数体,但您可能能够恢复整体结构。这是您的 EXE,因此您可能更熟悉它是如何连接的。
回答by Alks
Short answer NO.
简答否。
Long answer, because C++ doesn't use some intermediate code like C# or Java you cannot decompile the app in some readable format. But if you can read assembly maybe you can save some time.
答案很长,因为 C++ 不使用 C# 或 Java 之类的中间代码,因此您无法以某种可读格式反编译应用程序。但是,如果您可以阅读汇编,也许可以节省一些时间。
回答by Milk
You cannot get the original source code but you can decompile the binary into source code using tools given in this similar question: Is there a C++ decompiler?
您无法获得原始源代码,但可以使用以下类似问题中提供的工具将二进制文件反编译为源代码:是否有 C++ 反编译器?
The output source code will not look like the original as the compiler will have optimised the original source when generating the executable.
输出源代码看起来不像原始代码,因为编译器在生成可执行文件时会优化原始源代码。