如何获取 Windows 可执行文件的源代码?

发布于 2024-08-29 02:48:39 字数 72 浏览 5 评论 0原文

我有一些旧的 Windows 可执行文件。如何使用 Visual Studio 2010 编辑它们?查看exe源代码的方法有哪些?

I've got some old Windows executable files. How can I edit them with Visual Studio 2010? What are the ways to see an exe's source code?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

画▽骨i 2024-09-05 02:48:39

您无法从 exe 获取 C++ 源代码,只能通过反射获取某些版本的 C# 源代码。

You can't get the C++ source from an exe, and you can only get some version of the C# source via reflection.

假扮的天使 2024-09-05 02:48:39

如果程序是用 C# 编写的,您可以使用 几乎原始形式的源代码“noreferrer”">.NET 反射器。您将无法看到注释和局部变量名称,但它非常可读。

如果它是用 C++ 编写的,那就没那么容易了……即使您可以将代码反编译为有效的 C++,它也不太可能与原始源代码相似,因为内联函数和优化很难逆转。

请注意,通过逆向工程和修改源代码,您可能会违反程序的使用条款,除非您自己编写程序或获得了作者的许可。

If the program was written in C# you can get the source code in almost its original form using .NET Reflector. You won't be able to see comments and local variable names, but it is very readable.

If it was written C++ it's not so easy... even if you could decompile the code into valid C++ it is unlikely that it will resemble the original source because of inlined functions and optimizations which are hard to reverse.

Please note that by reverse engineering and modifying the source code you might breaking the terms of use of the programs unless you wrote them yourself or have permission from the author.

書生途 2024-09-05 02:48:39

如果是本机代码,则可以反汇编它。但你不会看到程序员编写的原始代码。您将看到编译器生成的代码。该代码可能经过优化,尽管它在语义上是等效的,但它比普通的 ASM 更难阅读。

如果是字节码(MSIL或javabytecode),有反编译器可以生成相当好的源代码。对于.net,这将是反射器。

If it is native code, you can disassemble it. But you won't see the original code as written by the programmer. You will see the code produced by the compiler. This code is possibly optimized and although it is semantically equivalent, it can be much harder to read than normal ASM.

If it is bytecode (MSIL or javabytecode), there are decompiler which can product pretty good sourcecode. For .net, this would be reflector.

秋千易 2024-09-05 02:48:39

我会(并且已经)使用 IDA Pro 来反编译可执行文件。它创建半完整代码,您可以反编译为汇编或 C。

如果您有调试符号的副本,请在反编译之前将它们加载到 IDA 中,它将能够命名许多函数、参数等。

I would (and have) used IDA Pro to decompile executables. It creates semi-complete code, you can decompile to assembly or C.

If you have a copy of the debug symbols around, load those into IDA before decompiling and it will be able to name many of the functions, parameters, etc.

病毒体 2024-09-05 02:48:39

恐怕你对此无能为力,因为你将无法以可读的格式查看它,这几乎是故意的,它会显示解释的机器代码,不会像平常那样有格式或注释进入.cs/.c 文件。

这几乎是一个碰运气的场景。

已经有人在另一个网站上询问过此问题

There's nothing you can do about it i'm afraid as you won't be able to view it in a readable format, it's pretty much intentional and it'll show the interpreted machine code, there would be no formatting or comments as you normally get in .cs/.c files.

It's pretty much a hit and miss scenario.

Someone has already asked about it on another website

暗藏城府 2024-09-05 02:48:39

对于以任何语言编写的任何 *.Exe 文件。您可以使用 hiew 查看源代码(否则黑客视图)。您可以在 www.hiew.ru 下载它。这将是演示版本,但仍然可以查看代码。

此后,请按照下列步骤操作:

  1. 按 alt+f2 导航到该文件。

  2. 按 Enter 键查看其汇编/C++ 代码。

For Any *.Exe file written in any language .You can view the source code with hiew (otherwise Hackers view). You can download it at www.hiew.ru. It will be the demo version but still can view the code.

After this follow these steps:

  1. Press alt+f2 to navigate to the file.

  2. Press enter to see its assembly / c++ code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文