typedefstruct _IMAGE_DOS_HEADER {// DOS .EXE header WORD e_magic; // Magic number WORD e_cblp; // Bytes on last page of file WORD e_cp; // Pages in file WORD e_crlc; // Relocations WORD e_cparhdr; // Size of header in paragraphs WORD e_minalloc; // Minimum extra paragraphs needed WORD e_maxalloc; // Maximum extra paragraphs needed WORD e_ss; // Initial (relative) SS value WORD e_sp; // Initial SP value WORD e_csum; // Checksum WORD e_ip; // Initial IP value WORD e_cs; // Initial (relative) CS value WORD e_lfarlc; // File address of relocation table WORD e_ovno; // Overlay number WORD e_res[4]; // Reserved words WORD e_oemid; // OEM identifier (for e_oeminfo) WORD e_oeminfo; // OEM information; e_oemid specific WORD e_res2[10]; // Reserved words DWORD e_lfanew; // File address of new exe header 0x3c } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
DOS 头目前已经没有什么作用了,保留的目的是为了向下兼容 16 位程序
0x3c 地址的数据是 0x000000d8,(windows 中,高地址在前。)这里指向的是数据存储的起点,但不是程序入口。这里指向的是 PE