The original DOS executable file format. These formats can be identified by the letters "MZ" at the beginning of the file in ASCII. Later formats may contain an MZ
DOS stub header. [2]
Introduced with
Windows NT, they are
fat binaries consisting of a DOS-specific and a Windows-specific part. The DOS-specific part (dubbed
DOS stub) is a legitimate 16-bit DOS program. Microsoft C++ linker, by default, uses a minimal DOS stub that prints the following message: "This program cannot be run in DOS mode."[2][4][5] Windows ignores the DOS stub and executes the Windows-specific portion that starts with the "PE\0\0" ASCII sequence (letters "PE" and two null bytes).[2] With some linkers, it is possible to specify a custom DOS stub.[2][4][6] Indeed, there are a few dual programs, such as
regedit in
Windows 95[7] and old versions of
WinZIP self extractors.
64-bit Portable Executable (PE32+)
Introduced by 64-bit versions of Windows, this is a PE file with wider fields. In most cases, code can be written to simply work as either a 32 or 64-bit PE file.[8] This file also includes a DOS stub.[6]
Other
There are other EXE formats, including but not limited to W3 (a collection of LE files, only used in WIN386.EXE), W4 (a compressed collection of LE files, only used in VMM32.VXD), DL, MP, P2, P3 (last three used by
Phar Lap extenders).[9]
^
abEllermann, Frank (2014-01-22).
"dostub.exe". Purl.net. Retrieved 2014-01-24.
^"Using Registry Editor in Real Mode". Support.
Microsoft. 2006-11-15. Archived from
the original on 2014-01-15. Retrieved 2014-01-10. Windows 95 includes a Registry Editor program (Regedit.exe) that runs in both the real-mode MS-DOS environment and in the protected-mode Windows environment. When you need to modify the registry without starting Windows 95, use Registry Editor in real mode. Note that the switches listed in this article only work in real-mode.