码迷,mamicode.com
首页 > 其他好文 > 详细

PE笔记之DOS头

时间:2014-10-09 20:18:47      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   os   ar   for   文件   sp   

IMAGE_DOS_HEADER STRUCT

{

+0h WORD e_magic    // Magic DOS signature MZ(4Dh 5Ah)     DOS可执行文件标记

+2h   WORD e_cblp    // Bytes on last page of file

+4h WORD e_cp    // Pages in file

+6h WORD e_crlc    // Relocations

+8h WORD e_cparhdr   // Size of header in paragraphs

+0ah WORD e_minalloc   // Minimun extra paragraphs needs

+0ch WORD e_maxalloc  // Maximun extra paragraphs needs

+0eh WORD e_ss            // intial(relative)SS value        DOS代码的初始化堆栈SS

+10h WORD e_sp     // intial SP value                       DOS代码的初始化堆栈指针SP

+12h WORD e_csum     // Checksum

+14h WORD e_ip     // intial IP value               DOS代码的初始化指令入口[指针IP]

+16h WORD e_cs     // intial(relative)CS value         DOS代码的初始堆栈入口

+18h WORD e_lfarlc     // File Address of relocation table

+1ah WORD e_ovno         // Overlay number

+1ch WORD e_res[4]      // Reserved words

+24h WORD e_oemid      // OEM identifier(for e_oeminfo)

+26h WORD      e_oeminfo   // OEM information;e_oemid specific

+29h WORD e_res2[10]   // Reserved words

+3ch DWORD   e_lfanew     //  Offset to start of PE header      指向PE文件头//http://www.cnblogs.com/zheh/p/4013184.html

} IMAGE_DOS_HEADER ENDS

 

  • DOS头是用来兼容MS-DOS操作系统的,目的是当这个文件在MS-DOS上运行时提示一段文字,大部分情况下是:This program cannot be run in DOS mode.还有一个目的,就是指明NT头在文件中的位置(NT头笔记:http://www.cnblogs.com/zheh/p/4013184.html)。

PE笔记之DOS头

标签:style   blog   http   io   os   ar   for   文件   sp   

原文地址:http://www.cnblogs.com/zheh/p/4013658.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!