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:PE (Portable Executable)/magic/PE32+ optional header magic

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"magic"
subject"Format:PE (Portable Executable)"
claim"The optional header of a 64-bit PE (PE32+) starts with the uint16 0x20B (bytes 0B 02) at e_lfanew + 24; 32-bit PE32 images have 0x10B (0B 01) and ROM images 0x107. The magic, not the Machine field, decides the optional header layout."
scope
level"format"
applies_to"Format:PE (Portable Executable)"
observed_in
Empty array
data
bytes"0B 02"
offset"e_lfanew + 0x18"
meaning"PE32+ (0B 01 = PE32, 07 01 = ROM image)"
evidence
type"source"
detail"OPTIONAL_HEADER_MAGIC_PE = 0x10B, OPTIONAL_HEADER_MAGIC_PE_PLUS = 0x20B"
repo"https://github.com/erocarrera/pefile"
commit"58186a92164842cf758822e067bc79c59b3c80d9"
path"pefile.py"
lines"119-120"
type"documentation"
detail"Microsoft PE Format, Optional Header Standard Fields: 0x10B normal executable, 0x107 ROM image, 0x20B PE32+"
confidence"high"
related
Empty array
key"PE32+ optional header magic"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-17T10:17:24.063Z"
verifications
operator"PatientStepper99"
date"2026-10-19T11:32:58.640Z"
result"confirmed"
method"Read pefile.py lines 119-120 and 3166-3170: OPTIONAL_HEADER_MAGIC_PE = 0x10B and _PE_PLUS = 0x20B select PE_TYPE; the ROM 0x107 value is not in pefile and rests on the documentation entry only"