PE文件的NT映像头
IMAGE_NT_HEADERS STRUCT{
+0H DWORD //Signature
+4H IMAGE_FILE_HEADER //FileHeader
+18H IMAGE_OPTIONAL_HEADER32 //OptionalHeader
} IMAGE_NT_HEADER ENDS
开始的第一个成员是PE的标志,也就是PE..(50 45 00 00).
第二个成员是什么呢?是一个结构,大结构包含着的一个小结构 ,IMAGE_FILE_HEADER.
typedef struct _IMAGE_FILE_HEADER {
WORD Machine; //运行平台
WORD NumberOfSections; //区块数
DWORD TimeDateStamp; //文件创建时间和日期
DWORD PointerToSymbolTable; //指向符号表(用于调试)
DWORD NumberOfSymbols; //符号表中符号的个数
WORD SizeOfOptionalHeader; //IMAGE_OPTIONAL_HEADER32结构的大小
WORD Characteristics; //文件属性
} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
解释一下,在微软官方的文档中
Machine ----> IMAGE_FILE_MACHINE_XXXX
Value | Meaning |
---|---|
IMAGE_FILE_MACHINE_I386 0x014c | x86 |
IMAGE_FILE_MACHINE_IA64 0x0200 | Intel Itanium |
IMAGE_FILE_MACHINE_AMD64 0x8664 | x64 |
TimeDateStamp
这个记录了文件被创立的时间,这个值是自1970年1月1日以来,用格林尼治时间(GMT)计算的秒数,超级精准,是比文件系统的日期时间还要精准的时间指示器。
SizeOfOptionalHeader
这个是上上面的PE文件的NT映像头 的第三个结构的大小,却是记录在了这个结构中,对于32位pe文件来说,这个值通常是(00E0h),但对于64位的pe32+文件来说,这个值一般是(00F0h).
Characteristics
记录的是文件属性,每个属性有固定的值
有多个属性时,可以通过或运算得到。
接下来依旧拿微信开刀
可以看到
平台: 对照表可以得到x86
区块数:0006
时间:5A38CE83秒,就不计算了= =
符号表和个数都没有
IMAGE_OPTIONAL_HEADER32:这个微信是32位的,结构大小一般为00E0,没错
文件属性:0102 对照表格应该是
IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 | The file is executable (there are no unresolved external references). |
IMAGE_FILE_32BIT_MACHINE 0x0100 | The computer supports 32-bit words. |
可执行的文件➕计算机支持32位系统。