.rdata 和 .idata 段有什么区别?

问题描述 投票:0回答:2

我在IDA中注意到,我分析的PE文件不仅有

.rdata
部分,还有
.idata
。有什么区别?

windows reverse-engineering portable-executable
2个回答
58
投票

总结典型的段名称:

.text: Code 
.data: Initialized data
.bss: Uninitialized data
.rdata: Const/read-only (and initialized) data
.edata: Export descriptors
.idata: Import descriptors
.pdata: Exception handling/stack walking data
.reloc: Relocation table (for code instructions with absolute addressing when
          the module could not be loaded at its preferred base address)
.rsrc: Resources (icon, bitmap, dialog, ...)
.tls: __declspec(thread) data (Fails with dynamically loaded DLLs -> hard to find bugs)

正如 Martin Rosenau 提到的,段名称只是典型的。真正的段类型在段标头中指定,或者通过使用段中存储的数据来定义。


8
投票

事实上,Windows 会忽略段的名称。

有些链接器使用不同的段名称,甚至可以将导入描述符、导出描述符、资源等存储在“.text”段中,而不是使用单独的段。

但是,为此类元数据创建单独的部分似乎更简单,因此大多数链接器将使用单独的部分。

这意味着:“.idata”、“.rdata”、“.rsrc”等节包含程序数据(尽管它们的名称以“data”结尾),但它们包含由程序使用的元信息操作系统。例如,“.rsrc”部分保存有关在资源管理器中查看可执行文件时显示的图标的信息。

“.idata”包含程序所需的所有 DLL 文件的信息。

© www.soinside.com 2019 - 2024. All rights reserved.