From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:NSIS installer" |
|---|
| claim | "The NSIS integrity check is the standard CRC-32 (zlib polynomial, init and final XOR 0xFFFFFFFF) of the file from offset 512 up to the 4-byte CRC that ends length_of_all_following_data; the first 512 bytes (DOS and PE headers) are not covered, nor is anything appended after the CRC (an Authenticode signature). Absent when firstheader flag 4 (no CRC) is set." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:NSIS installer" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "exehead start-up (CRCCheck on, the default)" |
|---|
| effect | "crc32(file[512 : fh_offset + length_of_all_following_data - 4]) must equal the dword stored there, else 'Installer integrity check has failed'" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "crc=CRC32(crc,m_exehead+512,m_exehead_size-512) unless NSIS_CONFIG_CRC_ANAL" |
|---|
| repo | "https://github.com/kichik/nsis" |
|---|
| commit | "f0bfe3e0062c57dc1ef90f1d235c7c0bd5a43be4" |
|---|
| path | "Source/build.cpp" |
|---|
| lines | "2702-2709" |
|---|
|
| type | "source" |
|---|
| detail | "left = length_of_all_following_data - 4; the first block is skipped by 'if (left < m_length)'; the computed CRC is compared with the dword at m_pos" |
|---|
| repo | "https://github.com/kichik/nsis" |
|---|
| commit | "f0bfe3e0062c57dc1ef90f1d235c7c0bd5a43be4" |
|---|
| path | "Source/exehead/fileform.c" |
|---|
| lines | "244-305" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "Python zlib.crc32(buf[512:end]) matched the stored CRC in all 8 tested uninstallers (NSIS 3.0 to 3.12), e.g. 1497A26C, 401B1AFF, A6F8C679, 61544EB0; 4 of them have 0x2548-0x3206 bytes of trailing data after the CRC (presumably Authenticode signatures, not checked) and still match" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "CRC-32 skips the first 512 bytes" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T20:06:21.860Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T04:13:46.183Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read Source/build.cpp at the cited commit: CRC32 over m_exehead+512 for m_exehead_size-512 under NSIS_CONFIG_CRC_SUPPORT (the full header only in the non-default NSIS_CONFIG_CRC_ANAL build). exehead side not re-read." |
|---|
|
|
|---|