可移植性可执行文件(Portable Executable,缩写为PE)是一种用于可执行文件、目标文件和动态链接库的文件格式,主要使用在32位和64位的Windows操作系统上。PE文件格式封装了Windows操作系统加载可执行程序代码时所必需的一些信息,包括动态链接库、API导入和导出表、资源管理数据和线程局部存储数据。常见的 PE 文件有 EXE、DLL、OCX、SYS、COM。
PE格式是由Unix中的COFF(Common Object File Format,如 .obj)格式修改而来的。在Windows开发环境中,PE格式也称为 PE/COFF 格式,开头为 DOS 头部。
# [CMD] dumpbin /headers {YourDLL} # [RESULT] PE signature found
File Type: DLL
FILE HEADER VALUES 8664 machine (x64) 6 number of sections 63EB2369 time date stamp Tue Feb 14 14:00:09 2023 0 file pointer to symbol table 0 number of symbols F0 size of optional header 2022 characteristics Executable Application can handle large (>2GB) addresses DLL
OPTIONAL HEADER VALUES 20B magic # (PE32+) 14.29 linker version 13E400 size of code 95000 size of initialized data 0 size of uninitialized data 1382E8 entry point (00000001801382E8) _DllMainCRTStartup 1000 base of code 180000000 image base (0000000180000000 to 00000001801D7FFF) 1000 section alignment 200 file alignment 6.00 operating system version 0.00 image version 6.00 subsystem version 0 Win32 version 1D8000 size of image 400 size of headers 0 checksum 2 subsystem (Windows GUI) 160 DLL characteristics High Entropy Virtual Addresses Dynamic base NX compatible 100000 size of stack reserve 1000 size of stack commit 100000 size of heap reserve 1000 size of heap commit 0 loader flags 10 number of directories 1AC7D0 [ D628] RVA [size] of Export Directory 1B9DF8 [ 2A8] RVA [size] of Import Directory 0 [ 0] RVA [size] of Resource Directory 1C4000 [ E328] RVA [size] of Exception Directory 0 [ 0] RVA [size] of Certificates Directory 1D4000 [ 3C94] RVA [size] of Base Relocation Directory 190060 [ 70] RVA [size] of Debug Directory 0 [ 0] RVA [size] of Architecture Directory 0 [ 0] RVA [size] of Global Pointer Directory 190280 [ 28] RVA [size] of Thread Storage Directory 1900D0 [ 138] RVA [size] of Load Configuration Directory 0 [ 0] RVA [size] of Bound Import Directory 140000 [ 8E0] RVA [size] of Import Address Table Directory 0 [ 0] RVA [size] of Delay Import Directory 0 [ 0] RVA [size] of COM Descriptor Directory 0 [ 0] RVA [size] of Reserved Directory
SECTION HEADER #1 .text name 13E25F virtual size 1000 virtual address (0000000180001000 to 000000018013F25E) 13E400 size of raw data 400 file pointer to raw data (00000400 to 0013E7FF) 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers 60000020 flags Code Execute Read
SECTION HEADER #2 .rdata name 7C576 virtual size 140000 virtual address (0000000180140000 to 00000001801BC575) 7C600 size of raw data 13E800 file pointer to raw data (0013E800 to 001BADFF) 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers 40000040 flags Initialized Data Read Only
SECTION HEADER #3 .data name 6500 virtual size 1BD000 virtual address (00000001801BD000 to 00000001801C34FF) 4200 size of raw data 1BAE00 file pointer to raw data (001BAE00 to 001BEFFF) 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers C0000040 flags Initialized Data Read Write
SECTION HEADER #4 .pdata name E328 virtual size 1C4000 virtual address (00000001801C4000 to 00000001801D2327) E400 size of raw data 1BF000 file pointer to raw data (001BF000 to 001CD3FF) 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers 40000040 flags Initialized Data Read Only
SECTION HEADER #5 .xbld name E3 virtual size 1D3000 virtual address (00000001801D3000 to 00000001801D30E2) 200 size of raw data 1CD400 file pointer to raw data (001CD400 to 001CD5FF) 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers C2000040 flags Initialized Data Discardable Read Write
SECTION HEADER #6 .reloc name 3C94 virtual size 1D4000 virtual address (00000001801D4000 to 00000001801D7C93) 3E00 size of raw data 1CD600 file pointer to raw data (001CD600 to 001D13FF) 0 file pointer to relocation table 0 file pointer to line numbers 0 number of relocations 0 number of line numbers 42000040 flags Initialized Data Discardable Read Only