From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "magic" |
|---|
| subject | "Format:DOS MZ executable" |
|---|
| claim | "DOS and Windows executables (MZ, NE, LE/LX, PE) start with the bytes 4D 5A ('MZ'). Only 2 bytes: it matches every DOS/Windows executable family and also random data (1 in 65536), so check e_lfanew at 0x3C and the signature it points to (PE, NE, LE, LX) before naming the format." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:DOS MZ executable" |
|---|
| observed_in | |
|---|
|
|---|
| data | | bytes | "4D 5A" |
|---|
| offset | "0" |
|---|
| meaning | "MS-DOS executable header; the dword at 0x3C points to a PE/NE/LE header in Windows-era files" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "e_magic is the first field" |
|---|
| repo | "https://github.com/erocarrera/pefile" |
|---|
| commit | "58186a92164842cf758822e067bc79c59b3c80d9" |
|---|
| path | "pefile.py" |
|---|
| lines | "2402-2424" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "MZ" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T10:17:23.690Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T06:46:40.693Z" |
|---|
| summary | "State that the 2-byte MZ magic is short and common to all DOS/Windows executables, so alone it identifies nothing finer than the family." |
|---|
| changed | |
|---|
|
|
|---|