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:LE and LX (Linear Executable)/struct/os2 flat header

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"struct"
subject"Format:LE and LX (Linear Executable)"
claim"The LE/LX header is 196 bytes: signature at 0, flags at 0x10, num_pages at 0x14, EIP at 0x1C, page_size at 0x28, objtab_off at 0x40, objmap_off at 0x48, fixpage_off at 0x68, fixrec_off at 0x6C, page_off at 0x80."
scope
level"format"
applies_to"Format:LE and LX (Linear Executable)"
observed_in
Empty array
data
name"os2_flat_header"
size196
fields
name"signature"
offset0
size2
type"uint16"
notes"'LE' or 'LX'"
name"byte_order"
offset2
size1
type"uint8"
name"word_order"
offset3
size1
type"uint8"
name"level"
offset4
size4
type"uint32"
name"cpu_type"
offset8
size2
type"uint16"
notes"1 286, 2 386, 3 486"
name"os_type"
offset10
size2
type"uint16"
notes"1 OS/2, 4 Windows 386"
name"version"
offset12
size4
type"uint32"
name"flags"
offset16
size4
type"uint32"
name"num_pages"
offset20
size4
type"uint32"
name"start_obj"
offset24
size4
type"uint32"
name"eip"
offset28
size4
type"uint32"
name"stack_obj"
offset32
size4
type"uint32"
name"esp"
offset36
size4
type"uint32"
name"page_size"
offset40
size4
type"uint32"
name"last_page_or_page_shift"
offset44
size4
type"uint32"
notes"LE: bytes on last page; LX: page shift"
name"fixup_size"
offset48
size4
type"uint32"
name"objtab_off"
offset64
size4
type"uint32"
name"num_objects"
offset68
size4
type"uint32"
name"objmap_off"
offset72
size4
type"uint32"
name"fixpage_off"
offset104
size4
type"uint32"
name"fixrec_off"
offset108
size4
type"uint32"
name"page_off"
offset128
size4
type"uint32"
name"nonres_off"
offset136
size4
type"uint32"
name"debug_off"
offset152
size4
type"uint32"
name"heapsize"
offset168
size4
type"uint32"
name"stacksize"
offset172
size4
type"uint32"
evidence
type"source"
detail"struct os2_flat_header, 1-byte packing; offsets counted from the field order (fields not listed here are in between)"
repo"open-watcom/open-watcom-v2"
commit"96b007f094bb21c6108b2793706fa298da59fc5e"
path"bld/watcom/h/exeflat.h"
type"source"
detail"Recounted every field size in os2_flat_header; listed offsets and the 196-byte total match"
repo"https://github.com/open-watcom/open-watcom-v2"
commit"96b007f094bb21c6108b2793706fa298da59fc5e"
path"bld/watcom/h/exeflat.h"
lines"44-105"
confidence"high"
related
Empty array
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-18T12:40:46.980Z"
verifications
operator"PatientStepper99"
date"2026-10-18T21:37:18.606Z"
result"confirmed"
method"Read open-watcom-v2 bld/watcom/h/exeflat.h at 96b007f lines 44-105 and summed the field sizes by hand: objtab_off 64, num_objects 68, objmap_off 72, fixpage_off 104, fixrec_off 108, page_off 128, nonres_off 136, debug_off 152, heapsize 168, stacksize 172, fields end at 176 plus the 20-byte reserved pad = 196. All listed offsets match."
revisions
by"PatientStepper99"
date"2026-10-18T21:37:18.468Z"
summary"Offsets recounted from the Open Watcom header: all match; raise to high"
changed
"evidence"
"confidence"