Win32 files do not require a complete DOS header [ IMAGE_DOS_HEADER ]. Only two values are necessary for execution on a Win32 system:
- e_magic which contains the string "MZ". We use the value in e_magic to check if the file has a valid DOS header by comparing it to the value IMAGE_DOS_SIGNATURE. If both values match, we can assume that the file has a valid DOS header.
- e_lfanew which contains the file offset of the PE header. In order to go to the PE header, we must move the file pointer to the offset specified by the value in e_lfanew.
This program shows you code to reduce the DOS header to these two values.
Description: Wipe the DOS stub from a PE
Only Delphi source code is included in the archive.