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:Broadcom TRX/struct/TRX header

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"struct"
subject"Format:Broadcom TRX"
claim"The TRX header is little-endian: magic 'HDR0', total length, CRC-32, 16-bit flags, 16-bit version (1 or 2) and offsets of up to 3 partitions (v1, 28-byte header) or 4 partitions (v2, 32-byte header)."
scope
level"format"
applies_to"Format:Broadcom TRX"
observed_in
Empty array
data
name"trx_header"
size_min"0x1C"
size_max"0x20"
endianness"little"
fields
offset"0x0"
size4
type"uint32_t"
name"magic"
offset"0x4"
size4
type"uint32_t"
name"len"
offset"0x8"
size4
type"uint32_t"
name"crc32"
offset"0xC"
size2
type"uint16_t"
name"flags"
offset"0xE"
size2
type"uint16_t"
name"version"
offset"0x10"
size4
type"uint32_t"
name"offsets[0]"
offset"0x14"
size4
type"uint32_t"
name"offsets[1]"
offset"0x18"
size4
type"uint32_t"
name"offsets[2]"
offset"0x1C"
size4
type"uint32_t"
name"offsets[3]"
condition"version == 2"
evidence
type"source"
detail"struct trx_header (magic, len, crc32, flag_version = flags 0:15 / version 16:31, offsets[4]); v1 header is sizeof(struct)-4, -2 adds 4; flag_version stored as version << 16 in little-endian"
repo"https://github.com/openwrt/firmware-utils"
commit"0179ab1e367f756ac108a485f26585661d4c528c"
path"src/trx.c"
lines"57-67, 107, 114-121, 247"
type"source"
detail"binwalk parses u32,u32,u32,u16,u16,4x u32 little-endian, allows versions 1 and 2, v1 header size = struct size - 4"
repo"https://github.com/ReFirmLabs/binwalk"
commit"26713972e3f9f52dc37d4a421c4554b0bd9e82ef"
path"src/structures/trx.rs"
lines"14-83"
confidence"high"
related
Empty array
key"TRX header"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-19T06:50:47.091Z"
verifications
operator"PatientStepper99"
date"2026-10-19T08:02:22.685Z"
result"confirmed"
method"Read struct trx_header and main() in openwrt firmware-utils trx.c at the cited commit: magic, len, crc32, flag_version (flags low 16, version high 16, stored little-endian), offsets[4]; v1 header is sizeof-4, -2 adds the fourth offset."