如果我从 PE 标头中删除重定位表地址会发生什么?

发布于 2024-12-21 19:51:37 字数 121 浏览 2 评论 0原文

我正在分析一些破解,其中一个将重定位表地址和大小更改为 0。破解者试图通过此实现什么目的?

为了提供更多信息,破解的目的是加载另一个 DLL,将加载表中以前的 Windows DLL 名称更改为自定义的 DLL。

I'm analyzing some cracks, and one of them changed the Relocation Table address and size to 0. What the cracker was trying to achieve with this?

To provide more information, the objective of the crack is load another DLL, changing the name of a previous windows DLL name in load table for a custom one.

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

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

发布评论

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

评论(3

拥抱我好吗 2024-12-28 19:51:37

删除重定位表可以保证DLL不能被重定位。
因此新代码(破解代码)不需要计算DLL中的任何地址,并且可以使用常量地址值。

通常重定位表实际上并不是必需的,因此可以将其删除以减小模块的大小,或者用一些数据替换它。

Deleting relocating table guarantees that DLL can't be relocated.
So new code (code of crack) don't need to calculate any address in DLL and can use constant address values.

Also often relocation table is not actually necessary, so it can be removed to reduce size of module, or to replace it with some data.

有木有妳兜一样 2024-12-28 19:51:37

根据可移植可执行文件规范,仅当库必须加载到其首选加载地址之外的另一个地址。因此,只要库加载到其首选地址(事实上,当映像不支持 ASLR 时就会发生这种情况),从目录中删除重定位表就不会产生任何影响。

According to the Portable Executable Specification, a relocation table is only needed when a library must be loaded at another address than its preferred load address. So, deleting the relocation table from the directory does not have any impact as long as the library is loaded at its preferred address (which is as matter of fact taking place when the image does NOT support ASLR).

溺孤伤于心 2024-12-28 19:51:37

要更改要加载的 DLL 的名称,通常只需更改导入表即可。剩下的只是猜测工作,不知道相关二进制文件的具体情况。

我认为重要的是要认识到并非所有“黑客”都知道他们到底在做什么,也许您正在分析一些根本不应该分析的东西。

也就是说,您可能出于以下几个原因想要删除重定位:

  • 在可执行文件中,重定位数据是无用的(并且可以安全地删除),除非它们支持 ASLR。
  • 可能是破解添加了需要重定位条目的代码。破解者没有添加这些内容,而是简单地完全删除了 reloc 表(可能还禁用了标头中的 ASLR),
  • 如果文件已打包,您通常会对解压的文件运行 PE 重建程序,以删除磁盘上无用的部分数据并清理 PE标头。默认情况下,大多数这些工具都会从 PE 中剥离重新定位数据。

To change the name of a DLL to load, you would normally just change the import table. The rest is just guess work, without knowing the specifics of the binaries in question.

I believe it's important to realize that not all 'crackers' know what exactly they're doing, maybe you're analyzing into something that shouldn't be analyzed at all.

That said, you might want to remove relocation for a few reasons:

  • in executables, relocation data is useless (and can be safely removed) unless they are ASLR-aware.
  • possibly the crack added code which would require relocation entries. Instead of adding these, the cracker simply removed the reloc table altogether (possibly also disabling ASLR in the header)
  • if the file was packed, you normally run a PE rebuilder on the unpacked file to remove useless section data on disk and clean up the PE header. By default most of these tools strip reloc data from the PE.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文