Windows PE文件各个节(Section)分析

PE(Portable Executable),即可移植的执行体。所有Windows下可执行文件,均使用PE文件结构。

PE文件通常包括以下节(Section)

.textbss/BSS

BSS段(bss segment)通常是指用来存放程序中未初始化的全局变量的一块内存区域。BSS是英文Block Started by Symbol的简称。BSS段属于静态内存分配。

.text/CODE 
代码段(text segment)通常是指用来存放程序执行代码的一块内存区域。这部分区域的大小在程序运行前就已经确定,并且内存区域属于只读。在代码段中,也有可能包含一些只读的常数变量,例如字符串常量等。需要注意的是,borland这里叫做code,而不是text 。

.rdata 
只读数据段。 
The .rdata section is used for at least two things. First, in Microsoft linker-produced EXEs, the .rdata section holds the debug directory, which is only present in EXE files. 
The other useful portion of an .rdata section is the description string. If you specified a DESCRIPTION entry in your program’s DEF file, the specified description string appears in the .rdata section.

.data 
数据段(data segment)通常是指用来存放程序中已初始化的全局变量的一块内存区域。数据段属于静态内存分配。

.idata 
The .idata section contains information about functions (and data) that the module imports from other DLLs. 
导入段。包含程序需要的所有DLL文件信息。

.edata 
The .edata section is a list of the functions and data that the PE file exports for other modules. 
导出段。包含所有提供给其他程序使用的函数和数据。

.rsrc 
The .rsrc section contains all the resources for the module. 
资源数据段,程序用到什么资源数据都在这里。

.reloc 
The .reloc section holds a table of base relocations. A base relocation is an adjustment to an instruction or initialized variable value that’s needed if the loader couldn’t load the file where the linker assumed it would. If the loader is able to load the image at the linker’s preferred base address, the loader completely ignores the relocation information in this section. 
重定位段。如果加载PE文件失败,将基于此段进行重新调整。

参考文献 
1.https://msdn.microsoft.com/en-us/library/ms809762.aspx
————————————————
版权声明:本文为CSDN博主「Eric_Fan0」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/fw72fw72/article/details/68486917

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值