From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:NSIS installer" |
|---|
| claim | "The NSIS firstheader is 28 bytes, little endian: flags (1 uninstaller, 2 silent, 4 no CRC, 8 force CRC), 0xDEADBEEF, "NullsoftInst", length_of_header (the UNCOMPRESSED size of the header and its blocks) and length_of_all_following_data (firstheader start to the end of the trailing CRC, both included)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:NSIS installer" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "firstheader" |
|---|
| size | "0x1C" |
|---|
| fields | | offset | "0x0" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "flags" |
|---|
| bits | | bit | "0" |
|---|
| name | "FH_FLAGS_UNINSTALL" |
|---|
|
| bit | "1" |
|---|
| name | "FH_FLAGS_SILENT" |
|---|
|
| bit | "2" |
|---|
| name | "FH_FLAGS_NO_CRC" |
|---|
|
| bit | "3" |
|---|
| name | "FH_FLAGS_FORCE_CRC" |
|---|
|
|
|---|
| notes | "bits above 3 must be 0" |
|---|
|
| offset | "0x4" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "siginfo" |
|---|
| notes | "0xDEADBEEF" |
|---|
|
| offset | "0x8" |
|---|
| size | 12 |
|---|
| type | "char[12]" |
|---|
| name | "nsinst" |
|---|
| notes | "NullsoftInst" |
|---|
|
| offset | "0x14" |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "length_of_header" |
|---|
| notes | "uncompressed header size" |
|---|
|
| offset | "0x18" |
|---|
| size | 4 |
|---|
| type | "int32_t" |
|---|
| name | "length_of_all_following_data" |
|---|
| notes | "from the firstheader start to the end of the CRC" |
|---|
|
|
|---|
| endianness | "little" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "struct firstheader" |
|---|
| repo | "https://github.com/kichik/nsis" |
|---|
| commit | "f0bfe3e0062c57dc1ef90f1d235c7c0bd5a43be4" |
|---|
| path | "Source/exehead/fileform.h" |
|---|
| lines | "215-246" |
|---|
|
| type | "source" |
|---|
| detail | "fh.length_of_header = uncompressed header length; length_of_all_following_data includes sizeof(firstheader) and the CRC" |
|---|
| repo | "https://github.com/kichik/nsis" |
|---|
| commit | "f0bfe3e0062c57dc1ef90f1d235c7c0bd5a43be4" |
|---|
| path | "Source/build.cpp" |
|---|
| lines | "2711-2760" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "8 real uninstallers: length_of_header equals the decompressed header length (solid streams also repeat it as their first dword); firstheader offset + length_of_all_following_data lands exactly on the end of the CRC" |
|---|
|
| type | "source" |
|---|
| detail | "FIX_ENDIAN_* macros: no-op on little-endian hosts, SWAP_ENDIAN_* on big-endian ones" |
|---|
| repo | "https://github.com/kichik/nsis" |
|---|
| commit | "f0bfe3e0062c57dc1ef90f1d235c7c0bd5a43be4" |
|---|
| path | "Source/Platform.h" |
|---|
| lines | "146-156" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "firstheader" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T20:06:21.787Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T17:34:11.252Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read struct firstheader in fileform.h at the cited commit: int flags, int siginfo (FH_SIG 0xDEADBEEF), int nsinst[3] (FH_INT1-3 = 'Null','soft','Inst'), int length_of_header, int length_of_all_following_data = 28 bytes, packed; FH_FLAGS 1/2/4/8 (2, 4, 8 compile-time optional); FH_FLAGS_MASK 15; little endian per Platform.h." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T13:26:09.098Z" |
|---|
| summary | "Set byte order: little (claim already says little endian). Platform.h FIX_ENDIAN_* macros are swaps only on big-endian hosts." |
|---|
| changed | |
|---|
|
|
|---|