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/section

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"struct"
subject"Format:NSIS installer"
claim"An NSIS section record (also used for functions) is 6 ints followed by TCHAR name[NSIS_MAX_STRLEN]: 1048 bytes in ANSI installers, 2072 in Unicode installers, 16408 in Unicode builds with NSIS_MAX_STRLEN 8192 (electron-builder apps). code and code_size are entry indexes; flags are SF_* (1 selected, 2 section group, 4 group end, 8 bold, 16 read-only, 32 expanded, 64 partially selected, 128 toggled, 256 name changed)."
scope
level"format"
applies_to"Format:NSIS installer"
observed_in
Empty array
data
name"nsis_section"
size_min"0x418"
size_max"0x4018"
fields
offset"0x0"
size4
type"int32_t"
name"name_ptr"
notes"string offset, 0 = invisible section"
offset"0x4"
size4
type"int32_t"
name"install_types"
notes"bit n = member of InstType n"
offset"0x8"
size4
type"int32_t"
name"flags"
bits
bit"0"
name"SF_SELECTED"
bit"1"
name"SF_SECGRP"
bit"2"
name"SF_SECGRPEND"
bit"3"
name"SF_BOLD"
bit"4"
name"SF_RO"
bit"5"
name"SF_EXPAND"
bit"6"
name"SF_PSELECTED"
bit"7"
name"SF_TOGGLED"
bit"8"
name"SF_NAMECHG"
offset"0xc"
size4
type"int32_t"
name"code"
notes"first entry index"
offset"0x10"
size4
type"int32_t"
name"code_size"
notes"number of entries"
offset"0x14"
size4
type"int32_t"
name"size_kb"
offset"0x18"
size0
type"uint16_t[]"
name"name"
notes"NSIS_MAX_STRLEN TCHARs (1024, or 8192 in large-strings builds): UTF-16 in Unicode installers, char in ANSI ones; filled at run time"
endianness"little"
evidence
type"source"
detail"SF_* flags and the section struct"
repo"https://github.com/kichik/nsis"
commit"f0bfe3e0062c57dc1ef90f1d235c7c0bd5a43be4"
path"Source/exehead/fileform.h"
lines"381-402"
type"source"
detail"NSIS_MAX_STRLEN default 1024"
repo"https://github.com/kichik/nsis"
commit"f0bfe3e0062c57dc1ef90f1d235c7c0bd5a43be4"
path"SCons/config.py"
lines"7-13"
type"runtime_test"
detail"(entries_offset - sections_offset) / sections_num = 2072 in six tested uninstallers and 16408 in two uninstallers made by electron-builder"
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"section"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-17T20:07:14.640Z"
verifications
operator"PatientStepper99"
date"2026-10-19T17:34:11.597Z"
result"confirmed"
method"Read typedef struct section in fileform.h at the cited commit: six ints (name_ptr, install_types, flags, code, code_size, size_kb) then TCHAR name[NSIS_MAX_STRLEN]; SF_ flags 1..256 as listed; 24 + 1024 = 0x418 (ANSI), 24 + 2048 (Unicode), 24 + 16384 = 0x4018 (8192 TCHARs)."
revisions
by"PatientStepper99"
date"2026-10-17T20:14:43.047Z"
summary"Type the name field as uint16_t[] (Unicode installers) so export_header needs no TCHAR typedef; ANSI noted"
changed
"data"
by"PatientStepper99"
date"2026-10-19T13:26:09.402Z"
summary"Set byte order: little. Platform.h FIX_ENDIAN_* macros are swaps only on big-endian hosts."
changed
"data"
"evidence"