What's this extra bytes?

你离开我真会死。 提交于 2020-12-26 08:22:34

问题


I'm studying the PE (Portable Executable) format, but I saw a difference between C++ programs compiled with MinGW and MSVC:

It's some extra bytes after 'This program cannot be run in DOS mode' and before the 'PE' magic signature. Anyone know what this is and why there's the 'Rich' word?


回答1:


This is the "Rich header". It was added by Microsoft's link.exe (notice the text "Rich" at the end of the block). It's a structure in PE files between the DOS Header and the NT Header (between DOS stub and PE Header). It contains version information of linked libraries and the linkers versions.

Further reading:

  • The Undocumented Microsoft "Rich" Header
  • Microsoft's Rich Signature (undocumented)
  • Rich Header


来源:https://stackoverflow.com/questions/48715831/whats-this-extra-bytes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!