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:REL relocatable module/struct/OSModuleHeader

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"struct"
subject"Format:REL relocatable module"
claim"A REL starts with OSModuleHeader: OSModuleInfo (id, next, prev, numSections, sectionInfoOffset, nameOffset, nameSize, version) then bssSize, relOffset, impOffset, impSize, the prolog/epilog/unresolved/bss section bytes and prolog/epilog/unresolved offsets (0x40 bytes for version 1), align and bssAlign (version 2, 0x48 bytes) and fixSize (version 3, 0x4C bytes). Big endian."
scope
level"format"
applies_to"Format:REL relocatable module"
observed_in
Empty array
data
name"OSModuleHeader"
size76
fields
offset0
size4
type"u32"
name"id"
notes"module number; 0 is the main DOL"
offset4
size4
type"u32"
name"next"
notes"run-time list link, 0 in the file"
offset8
size4
type"u32"
name"prev"
offset12
size4
type"u32"
name"numSections"
offset16
size4
type"u32"
name"sectionInfoOffset"
offset20
size4
type"u32"
name"nameOffset"
notes"into the string table set by OSSetStringTable"
offset24
size4
type"u32"
name"nameSize"
offset28
size4
type"u32"
name"version"
notes"1, 2 or 3; OSLink refuses > 3"
offset32
size4
type"u32"
name"bssSize"
offset36
size4
type"u32"
name"relOffset"
offset40
size4
type"u32"
name"impOffset"
offset44
size4
type"u32"
name"impSize"
notes"bytes"
offset48
size1
type"u8"
name"prologSection"
offset49
size1
type"u8"
name"epilogSection"
offset50
size1
type"u8"
name"unresolvedSection"
offset51
size1
type"u8"
name"bssSection"
notes"set at run time"
offset52
size4
type"u32"
name"prolog"
offset56
size4
type"u32"
name"epilog"
offset60
size4
type"u32"
name"unresolved"
offset64
size4
type"u32"
name"align"
notes"version >= 2 (header is 0x40 bytes in version 1)"
offset68
size4
type"u32"
name"bssAlign"
notes"version >= 2"
offset72
size4
type"u32"
name"fixSize"
notes"version 3 (header 0x48 bytes in version 2)"
endianness"big"
evidence
type"source"
detail"OSModuleInfo and OSModuleHeader with OS_MODULE_VERSION 1/2/3 fields"
repo"https://github.com/zeldaret/tww"
commit"8b93b372dc8e841f12ddfb7e0215626f62b05417"
path"include/dolphin/os/OSLink.h"
lines"10, 40-77"
type"source"
detail"Link() rejects version > OS_MODULE_VERSION and checks align/bssAlign for version >= 2, adjusts fixSize for version >= 3"
repo"https://github.com/zeldaret/tww"
commit"8b93b372dc8e841f12ddfb7e0215626f62b05417"
path"src/dolphin/os/OSLink.c"
lines"224-245"
type"runtime_test"
detail"test_rel.py on the code page builds a version-3 REL with a 0x4C-byte header and parses it back"
confidence"high"
related
Empty array
key"OSModuleHeader"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-17T18:21:16.627Z"
verifications
Empty array
revisions
by"PatientStepper99"
date"2026-10-19T16:38:41.792Z"
summary"data.endianness big added (stated only in prose); variants by version are already in the field notes and match OSLink.h."
changed
"data"