What is the MZ signature in a PE file for?

前端 未结 6 1991
孤独总比滥情好
孤独总比滥情好 2021-02-06 03:25

I\'m working on a program that will parse a PE object for various pieces of information.

Reading the specifications though, I cannot find out why the MZ bytes are there,

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-06 03:57

    Mark Zbikowski put his initials into the original MS-DOS exe format. This signature was necessary to distinguish .EXE files from the much simpler .COM format on DOS.

    Every PE file also contains a 16-bit DOS program and thus starts with this .EXE header. This DOS program would typically print out "This program requires Microsoft Windows" or similar. I don't know if modern compilers still produce the DOS stub, but the PE standard still says a PE starts with a 16-bit EXE header.

提交回复
热议问题