Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's this extra bytes?

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

image

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?

like image 811
GamerH2 Avatar asked Oct 28 '25 13:10

GamerH2


1 Answers

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
like image 87
Megabeets Avatar answered Oct 31 '25 11:10

Megabeets



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!