From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "signature" |
|---|
| subject | "Format:DOS MZ executable" |
|---|
| claim | "LLVM lld-link writes its own DOS stub at 0x40: the Microsoft stub code with the string 'This program cannot be run in DOS mode.$' without CR CR LF, padded with two zero bytes, and puts the PE header at e_lfanew 0x78. Its DOS header starts 4D 5A 78 00 01 00 00 00 04 00." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:DOS MZ executable" |
|---|
| observed_in | | "Format:PE (Portable Executable)" |
|
|---|
|
|---|
| data | | name | "MZ_stub_lld" |
|---|
| pattern | "0E 1F BA 0E 00 B4 09 CD 21 B8 01 4C CD 21 54 68 69 73 20 70 72 6F 67 72 61 6D 20 63 61 6E 6E 6F 74 20 62 65 20 72 75 6E 20 69 6E 20 44 4F 53 20 6D 6F 64 65 2E 24 00 00" |
|---|
| matches | "lld-link DOS stub; MZ header at match - 0x40" |
|---|
| offset | -64 |
|---|
| multiple | true |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "dosProgram[] bytes and the DOS header lld writes (AddressOfNewExeHeader = dosStubSize); main branch fetched 2026-10-17" |
|---|
| repo | "https://github.com/llvm/llvm-project" |
|---|
| commit | "aa673fae32d57e8d9bd65dabc48eb361439aa55f" |
|---|
| path | "lld/COFF/Writer.cpp" |
|---|
| lines | "50-80, 1855-1870" |
|---|
|
| type | "byte_pattern" |
|---|
| detail | "228 of about 8000 PE files on a Windows 11 machine had this stub, all with e_lfanew 0x78 and linker version 14.0" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "lld-link DOS stub" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T10:17:23.829Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T11:18:09.914Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read lld/COFF/Writer.cpp at aa673fae lines 50-80 and 1838-1864: dosProgram[] bytes 0e 1f ba 0e 00 b4 09 cd 21 b8 01 4c cd 21 'This program cannot be run in DOS mode.$' 00 00 (56 bytes) equal the pattern; dosStubSize = sizeof(dos_header 64) + 56 = 0x78 = AddressOfNewExeHeader; UsedBytesInTheLastPage = 0x78, FileSizeInPages = 1." |
|---|
|
|
|---|