在COFF文件格式中,重定位信息部分的意义是什么?

发布于 2024-07-06 03:01:50 字数 138 浏览 6 评论 0原文

我正在阅读有关 COFF 文件格式的信息,它通常用于创建可执行文件格式(它也有一些变体)。

在阅读时,我遇到了格式的重定位部分。 如何使用此重定位节来创建可执行文件。

如果您向我指出一些对我有帮助的链接,这将非常有用。

I am reading about COFF file formats, which is commonly used to create an executable file format (it has some variants also).

While reading, I came across the relocation section of the format. How is this relocation section used to create an executable file.

It would be very useful if you point me to some links which will help me.

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

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

发布评论

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

评论(3

哥,最终变帅啦 2024-07-13 03:01:50

实际上,COFF 有两种类型的重定位信息:

  1. COFF 重定位记录
  2. 可执行映像中的重定位部分。

它们有相似但不同的目的。 如果可执行映像加载到与其首选地址不同的地址,则可执行文件中的重定位信息会标识加载时需要修复的内容。

当目标文件中的某个部分被分配给可执行映像中的偏移量时,COFF 重定位记录标识在链接时需要修复的内容。

Actually, with COFF there are 2 types of relocation information:

  1. COFF Relocation records
  2. The relocation section in an executable image.

They have similar, but different purposes. The relocation information in an executable identifies things that need to be fixed up, at load time, should the executable image be loaded at a different addresses from its preferred address.

COFF Relocation records identify things that need to be fixed up, at link time, when a section in an object file is assigned to an offset in an executable image.

千纸鹤 2024-07-13 03:01:50

重定位用于将可执行代码放置在进程中自己的内存空间中。 例如,如果您尝试加载两个都请求相同基地址(即内存中的同一位置)的 dll,则必须将其中一个 dll 重新定位到另一个地址。
NTCore 是一个用于探索可移植可执行 (PE) 文件(COFF 现在的名称)的有用站点。 这里是另一个网站很好地解释了搬迁。

Relocation is used to place executable code in its own memory space in a process. For example, if you try to load two dlls that both request the same base address (ie, the same place in memory), then one of the dlls will have to be relocated to another address.
NTCore is a useful site for exploring Portable Executable (PE) files, which is what COFF is now called. Here is another site that explains relocation pretty well.

标点 2024-07-13 03:01:50

重定位的一个意外附加用途是在运行时对二进制文件进行(去)混淆,而无需额外的解包代码。 请参阅本文

An unintended addition use of relocation is (de-)obfuscating binaries at run time with no additional unpacking code. See this paper.

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