Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Fact:NSIS installer/struct/header (32-bit target)

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"struct"
subject"Format:NSIS installer"
claim"The decompressed NSIS main header of a 32-bit target (default configuration, NSIS 2.x and 3.x) is 300 bytes: flags, 8 block descriptors {offset, count} for pages, sections, entries, strings, langtables, ctlcolors, bgfont and data (offsets relative to the header start), InstallDirRegKey, colors, langtable_size, 10 callback entry indexes, 33 install types, the install directory and three uninstaller strings. The pages block follows immediately, so pages_offset is 0x12C. 64-bit targets (amd64/arm64 stubs) widen each block offset to int64, giving 332 bytes."
scope
level"format"
applies_to"Format:NSIS installer"
observed_in
Empty array
data
name"nsis_header"
size"0x12C"
abi"ilp32"
fields
offset"0x0"
size4
type"uint32_t"
name"flags"
notes"CH_FLAGS_*: 1 SHOWDETAILS, 2 NEVERSHOW, 4 PROGRESS_COLORED, 8 SILENT, 16 SILENT_LOG, 32 AUTO_CLOSE, 64 DIR_NO_SHOW, 128 NO_ROOT_DIR, 256 COMP_ONLY_ON_CUSTOM, 512 NO_CUSTOM"
offset"0x4"
size4
type"int32_t"
name"pages_offset"
offset"0x8"
size4
type"int32_t"
name"pages_num"
offset"0xc"
size4
type"int32_t"
name"sections_offset"
offset"0x10"
size4
type"int32_t"
name"sections_num"
offset"0x14"
size4
type"int32_t"
name"entries_offset"
offset"0x18"
size4
type"int32_t"
name"entries_num"
offset"0x1c"
size4
type"int32_t"
name"strings_offset"
offset"0x20"
size4
type"int32_t"
name"strings_num"
notes"0"
offset"0x24"
size4
type"int32_t"
name"langtables_offset"
offset"0x28"
size4
type"int32_t"
name"langtables_num"
offset"0x2c"
size4
type"int32_t"
name"ctlcolors_offset"
offset"0x30"
size4
type"int32_t"
name"ctlcolors_num"
offset"0x34"
size4
type"int32_t"
name"bgfont_offset"
offset"0x38"
size4
type"int32_t"
name"bgfont_num"
offset"0x3c"
size4
type"int32_t"
name"data_offset"
notes"0 in the file, set at run time"
offset"0x40"
size4
type"int32_t"
name"data_num"
offset"0x44"
size4
type"int32_t"
name"install_reg_rootkey"
offset"0x48"
size4
type"int32_t"
name"install_reg_key_ptr"
offset"0x4c"
size4
type"int32_t"
name"install_reg_value_ptr"
offset"0x50"
size4
type"int32_t"
name"bg_color1"
offset"0x54"
size4
type"int32_t"
name"bg_color2"
offset"0x58"
size4
type"int32_t"
name"bg_textcolor"
offset"0x5c"
size4
type"int32_t"
name"lb_bg"
offset"0x60"
size4
type"int32_t"
name"lb_fg"
offset"0x64"
size4
type"int32_t"
name"langtable_size"
notes"10 + 4 * number of language strings"
offset"0x68"
size4
type"int32_t"
name"license_bg"
offset"0x6c"
size4
type"int32_t"
name"code_onInit"
notes"entry index, -1 = none"
offset"0x70"
size4
type"int32_t"
name"code_onInstSuccess"
offset"0x74"
size4
type"int32_t"
name"code_onInstFailed"
offset"0x78"
size4
type"int32_t"
name"code_onUserAbort"
offset"0x7c"
size4
type"int32_t"
name"code_onGUIInit"
offset"0x80"
size4
type"int32_t"
name"code_onGUIEnd"
offset"0x84"
size4
type"int32_t"
name"code_onMouseOverSection"
offset"0x88"
size4
type"int32_t"
name"code_onVerifyInstDir"
offset"0x8c"
size4
type"int32_t"
name"code_onSelChange"
offset"0x90"
size4
type"int32_t"
name"code_onRebootFailed"
offset"0x94"
size132
type"int32_t[33]"
name"install_types"
notes"string offsets of the InstType names"
offset"0x118"
size4
type"int32_t"
name"install_directory_ptr"
offset"0x11c"
size4
type"int32_t"
name"install_directory_auto_append"
offset"0x120"
size4
type"int32_t"
name"str_uninstchild"
notes"uninstallers: $TEMP\Un.exe"
offset"0x124"
size4
type"int32_t"
name"str_uninstcmd"
notes"uninstallers: "$TEMP\Un.exe" $0 _?=$INSTDIR\"
offset"0x128"
size4
type"int32_t"
name"str_wininit"
notes"$WINDIR\wininit.ini"
endianness"little"
evidence
type"source"
detail"CH_FLAGS_*, struct block_header, NB_* block enum, header struct (all members present in the default configuration)"
repo"https://github.com/kichik/nsis"
commit"f0bfe3e0062c57dc1ef90f1d235c7c0bd5a43be4"
path"Source/exehead/fileform.h"
lines"248-356"
type"source"
detail"block_header_writer writes an int64 offset for 64-bit targets"
repo"https://github.com/kichik/nsis"
commit"f0bfe3e0062c57dc1ef90f1d235c7c0bd5a43be4"
path"Source/fileform.cpp"
lines"36-60"
type"runtime_test"
detail"pages_offset = 0x12C in all 8 tested uninstallers; langtable_size 258 (62 strings) in NSIS 3.12, 254 in a 2026 snapshot build; uninstaller string fields decode to $TEMP\Un.exe, "$TEMP\Un.exe" $0 _?=$INSTDIR\ and $WINDIR\wininit.ini"
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
Empty array
key"header (32-bit target)"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-17T20:07:14.556Z"
verifications
operator"PatientStepper99"
date"2026-10-19T17:34:11.329Z"
result"confirmed"
method"Read struct header and the block enum in fileform.h at the cited commit: flags, 8 blocks of {offset, num} (pages, sections, entries, strings, langtables, ctlcolors, bgfont, data), rootkey, two ptrs, 3 bg colours, lb_bg/lb_fg, langtable_size, license_bg, 10 code_on* ints, install_types[NSIS_MAX_INST_TYPES+1], install dir ptr and auto-append, 3 uninstaller strings. Summed offsets 0x44, 0x50, 0x5C, 0x64, 0x68, 0x6C, 0x94, 0x118, 0x120, size 0x12C = 300. Layout members are all #ifdef-gated by build options (default config assumed, as the fact states)."
revisions
by"PatientStepper99"
date"2026-10-19T13:26:09.165Z"
summary"Set byte order: little. Platform.h FIX_ENDIAN_* macros are swaps only on big-endian hosts."
changed
"data"
"evidence"