反汇编用 Delphi 编写的 DLL——如何开始?

发布于 2024-08-23 06:45:57 字数 56 浏览 10 评论 0原文

有什么方法可以将我的 .dll 文件再次反汇编为机器代码吗? 为此我需要什么申请以及可以收回多少?

Is there any way to disassemble my .dll file again into machine code?
What applications do I need for this and how much could be recovered?

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

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

发布评论

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

评论(4

草莓酥 2024-08-30 06:45:57

查看PE File Explorer,这个工具太神奇了,是用Delphi构建的,并且对Delphi有特殊支持应用程序。

您可以分析、反汇编、编辑资源

PE Explorer 是功能最丰富的
内部检查程序
您自己的软件的工作原理,以及
更重要的是,第三方Windows
应用程序和库
你没有源代码。一旦你
已选择您想要的文件
检查,PE Explorer 将分析
文件并显示 PE 的摘要
标头信息以及所有
PE 文件中包含的资源。
从这里,该工具允许您
探索其中的具体元素
一个可执行文件。

替代文本
(来源:pe-explorer.com

Check PE File Explorer, this tool is amazing, is built with Delphi, and has special support for Delphi applications.

You can analyze, disassemble, edit the resources

PE Explorer is the most feature-packed
program for inspecting the inner
workings of your own software, and
more importantly, third party Windows
applications and libraries for which
you do not have source code. Once you
have selected the file you wish to
examine, PE Explorer will analyze the
file and display a summary of the PE
header information, and all of the
resources contained in the PE file.
From here, the tool allows you to
explore the specific elements within
an executable file.

alt text
(source: pe-explorer.com)

污味仙女 2024-08-30 06:45:57

您需要一个反汇编程序,例如 IDA Pro。他们也有一个免费版本。您将获得机器代码(程序集),并且您应该能够找出对 Windows API 进行的函数调用。

You need a disassembler, like IDA Pro. They have a free edition too. You'll get back machine code (assembly), and you should be able to pick out the function calls made to the Windows API.

断肠人 2024-08-30 06:45:57

如果您丢失了源文件并且您实际上只需要“恢复工作”,那么您不妨开始重新编码它,因为您不会从反编译器中获得任何有用的东西。自 Ms-DOS COM 文件时代以来,我一直无法从反编译器中获得任何可重新编译的内容(不要与 Windows COM 混淆!)。

用高级语言编写的现代文件运行优化编译器根本不包含重建源代码所需的所有内容。

示例,这只是冰山一角:

  • Delphi 的优化链接器将跳过未使用的代码。有没有注意到,当您想在一行代码上放置一个断点时,当程序启动时,断点会被忽略,因为代码已经被优化了?
  • Delphi 的优化编译器可以选择对您的代码执行各种操作:
    • 它可以内联过程(因此它们不再是您编写它们的位置,而是进行调用的位置)。
    • 它可以展开“for”循环(因此,如果您有“for i:=1 to 10 do something”,那么现在您会得到“something; Something; Something;...”。
    • 局部变量得到优化,地址得到重用。
  • 数据结构与当今的规则一致,因此您的一个字 + 1 个字节结构可能在内存中具有 4 或 8 个字节,而不是您期望的 3 个字节。
  • DLL 不是 DCU A。 3 行 DLL 实际上可能从这些“uses”子句中导入数千行代码。

If you lost the source file and you really only need to "get your work back", then you might as well start re-coding it because you're not going to get anything useful out of decompiler. I haven't been able to get anything re-compilable out of a decompiler since the days of Ms-DOS COM files (not to be confused with Windows COM!).

A modern file, written in an high level language, ran throw an optimizing compiler simply doesn't include everything that's needed to reconstruct the source code.

Examples, and it's just the top of the iceberg:

  • Delphi's optimizing linker will SKIP code that's not used. Ever noticed when you want to place an brakepoint on a line of code and when the program starts the brakepoint is ignored because the code has been optimized-out?
  • Delphi's optimizing compiler has the option of doing all sorts of things with your code:
    • It can inline procedures (so they're no longer where you wrote them, they're where the call is made).
    • It can unwind "for" loops (so where you had an "for i:=1 to 10 do something" you now have "something; something; something;...".
    • Local variables get optimized, addresses get reused.
  • Data structures are aligned to whatever the rule of the day is. So your one word + 1 byte structures might have 4 or 8 bytes in memory, not 3 as you might expect.
  • Code gets imported from other libraries. An DLL is not an DCU. A 3 lines DLL might actually import thousands of lines of code from those "uses" clauses.
习ぎ惯性依靠 2024-08-30 06:45:57

您将无法获得比汇编代码更多的信息,因为 Delphi 是本机语言,与 Java 或 .Net 语言不同,在后者中您可以获得更多信息。

You won't be able to get more than assembly code, because Delphi is native unlike Java or .Net Languages, where you can get a whole bunch more of information.

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