title: Portable executable DOS header length
body: <p>I've been studying this image for building a portable executable: <a href="https://i.imgur.com/LIImg.jpg" rel="nofollow">https://i.imgur.com/LIImg.jpg</a></p>
  
  <p>The image/walkthrough says the PE header starts at 0x40 (64 in decimal).  However, the hexadecimal dump says the DOS header is 32 bytes long. Is it being packed at 4 bytes for each field?  </p>
  
  <p>Looking at the IMAGE_DOS_HEADER in WinNT.h, it doesn't seem to fit either.  It has 16 2-byte fields, one 4-length 2-byte array, one 10-length 2-byte array, and the 4-byte pointer to the PE location.  Any way you look at that it doesn't add up to 64...</p>