如何检查程序(.exe)是用什么语言编写的。如何查看代码?
我有一个 .exe 文件,我需要知道该程序是用什么语言开发的。还有查看代码的技巧(基于该 .exe 文件)吗?我使用了 Reflector,现在我知道它不是 .NET
I've got an .exe file and I need to know in what language the program has been developed. And also is there a trick to view the code (basing on that .exe file) ? I used the Reflector and now I know it is not .NET
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我以前遇到过这个问题。我刚刚在记事本中打开了 .exe 文件。我找到了编译器名称和版本。希望这对某人有帮助..
I come across this problem before. I just opened .exe file in notepad. I found compiler name and version. Hope this helps someone..
我将不得不反驳每个人所说的“将高级语言编译为低级 .EXE 通常是一个单向过程”的说法。因为并非所有可执行文件都被编译为原始程序集。
因为情况并非总是如此。 C#(.net) 就是一个很好的例子,其中文件被编译为 IL,而不是原始程序集。在 IL 的情况下,您可以反汇编为源代码(即使进程在内存中运行,例如从全局程序集缓存中提取)
如果文件直接编译为原始程序集,则通常会在文件中显示原始语言的一些指示语法/结构。尽管这更多的是编译器的副产品,而不是语言本身的副产品。
I am going to have to contradict everyone stating anything along the lines of "Compilation of a high-level language into a low-level .EXE is typically a one-way process". As not all executable's are compiled to raw assembly.
As this is not always the case. A good example is C#(.net), where the file is compiled to IL rather than raw assembly. In the case of IL you can disassemble to source (even wile the process is running in memory, such as pulling from the Global Assembly Cache)
If the file was compiled straight to raw assembly then there is usually some indication of the original language in the syntax/structure. Though this is more so a byproduct of the compiler then the language it self.
一般来说这是不可能的。可以想象,每种语言都可以编译自己版本的“你好,世界!”将给定平台(或可执行格式)定位到相同的可执行文件(逐字节)。
不,请参阅上文。不过,您可以尝试您选择的反编译器。
Generally speaking this is impossible. Every language could conceivably compile their version of "Hello, world!" targeting a given platform (or executable format) to the same executable (byte for byte).
No, see above. However you can try a decompiler of your choice.
将高级语言编译为低级 .EXE 通常是一个单向过程 - 一旦该过程完成,几乎不可能从可执行文件中可靠地提取有关原始语言的有意义的信息。您可能会很幸运,在二进制文件中找到一些可识别的线索,或者当然会找到一个附带文件(如 .pdb),它可以提供有关原始语言的线索。
然而,.EXE 包含(通常)汇编语言,有时可以将其反编译回程序的高级表示形式。请注意,这永远不会为您提供指令准确的源文件 - 结果可能非常“冗长”并且难以理解,仅仅是因为编译器首先做了什么 - 这变成了高级将“概念性”复杂语言转化为低级指令流,丢弃 CPU 执行代码不需要的大部分上下文线索。
Compilation of a high-level language into a low-level .EXE is typically a one-way process - it's almost impossible to reliably extract meaningful information from the executable regarding the original language once the process is complete. You might get lucky and find some identifiable cues left in the binary, or of course find an accompanying file (like a .pdb) which yields clues as to the original language.
However, what the .EXE contains is (typically) assembly language, and this can sometimes be decompiled back into a high-level representation of the program. Note that this is never going to give you an instruction-accurate source file - the result is likely to be very 'wordy' and difficult to follow, simply because of what the compiler did in the first place - which was turn a high-level 'conceptual' complex language into a stream of low-level instructions, throwing away most of the contextual cues which aren't needed for the CPU to execute the code.