Search code examples
windowsdosstubportable-executable

Why there is a stub for MS-DOS in PE files?


In recent versions of PE files there is a stub to show for MS DOS users the sentence This program can not be run in DOS mode. Why such message still exists althogh it wastes about 38 bytes? Is there any one still uses MS-DOS?


Solution

  • It's still there because there's no easy way to remove it without breaking the file format, and nobody seems to think 38 bytes per executable is worth the trouble. The requirements on section alignment nearly always "waste" a lot more than that anyway.