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:Mach-O/behavior/Export trie node encoding

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"behavior"
subject"Format:Mach-O"
claim"An export trie node is ULEB128 terminal size, the terminal payload (ULEB flags, ULEB value, extras), a 1-byte child count, then per child a NUL-terminated edge label and a ULEB child offset from the trie start; offset 0 is invalid."
scope
level"format"
applies_to"Mach-O export tries"
observed_in
Empty array
data
trigger"walking LC_DYLD_EXPORTS_TRIE or the export part of LC_DYLD_INFO"
effect"symbol name = concatenated edge labels; payload = ULEB flags (bits above 5 rejected), ULEB value, then by flag: kind ABSOLUTE or THREAD_LOCAL none; REEXPORT 0x08 a NUL-terminated import name (empty = same name; value = dylib ordinal); FUNCTION_VARIANT a ULEB table index; STUB_AND_RESOLVER 0x10 a ULEB resolver offset (tested in that order, after the kind and REEXPORT checks)"
evidence
type"source"
detail"recurseTrie and terminalPayloadToSymbol"
repo"https://github.com/apple-oss-distributions/dyld"
commit"fd8d0c4d52320ebf64db34f3cb280310d905c5ae"
path"mach_o/ExportsTrie.cpp"
lines"78-118, 285-335"
type"source"
detail"terminalPayloadToSymbol branch order: flags>>6 != 0 error; kind ABSOLUTE; kind THREAD_LOCAL; REEXPORT (name string); FUNCTION_VARIANT (ULEB tableIndex); STUB_AND_RESOLVER (ULEB funcOffset); WEAK_DEFINITION; regular"
repo"https://github.com/apple-oss-distributions/dyld"
commit"fd8d0c4d52320ebf64db34f3cb280310d905c5ae"
path"mach_o/ExportsTrie.cpp"
lines"285-335"
confidence"high"
related
Empty array
key"Export trie node encoding"
topic"Format:Mach-O/Bind and rebase opcodes"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-19T01:09:09.336Z"
verifications
operator"PatientStepper99"
date"2026-10-19T07:28:13.595Z"
result"confirmed"
method"Read dyld mach_o/ExportsTrie.cpp 70-125 and 275-340 at fd8d0c4: recurseTrie layout and childNodeOffset==0 error; terminalPayloadToSymbol branch order and flags>>6 rejection."
revisions
by"PatientStepper99"
date"2026-10-19T07:17:56.087Z"
summary"dyld's terminalPayloadToSymbol has one more branch: FUNCTION_VARIANT adds a ULEB table index; also kind ABSOLUTE and THREAD_LOCAL are tested before the REEXPORT flag and flags above bit 5 are rejected"
changed
"data"
"evidence"