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:FastTracker 2 module (XM)/struct/XM file header

From ReverseEngineering.wiki
schema"rewiki.fact/1"
kind"struct"
subject"Format:FastTracker 2 module (XM)"
claim"The XM header is 60 bytes of fixed fields plus a variable part: "Extended Module: " (17), module name (20), 0x1A, tracker name (20), version u16 (0x0104 normal), header size u32 counted from offset 60, then song length, restart position, channels, patterns, instruments (u16 each), flags (bit 0 = linear frequencies), default speed (ticks per row, below 32) and BPM (32 to 1000 accepted); the order table (headersz - 0x14 bytes, up to 256) starts at offset 80."
scope
level"format"
applies_to"Format:FastTracker 2 module (XM)"
observed_in
Empty array
data
name"XMHeader"
size_min80
endianness"little"
fields
offset"0x0"
size17
type"char[17]"
name"id"
offset"0x11"
size20
type"char[20]"
name"module_name"
offset"0x25"
size1
type"uint8_t"
name"eof_1a"
offset"0x26"
size20
type"char[20]"
name"tracker_name"
offset"0x3A"
size2
type"uint16_t"
name"version"
offset"0x3C"
size4
type"uint32_t"
name"header_size"
offset"0x40"
size2
type"uint16_t"
name"song_length"
offset"0x42"
size2
type"uint16_t"
name"restart"
offset"0x44"
size2
type"uint16_t"
name"channels"
offset"0x46"
size2
type"uint16_t"
name"patterns"
offset"0x48"
size2
type"uint16_t"
name"instruments"
offset"0x4A"
size2
type"uint16_t"
name"flags"
offset"0x4C"
size2
type"uint16_t"
name"default_speed"
offset"0x4E"
size2
type"uint16_t"
name"default_bpm"
evidence
type"source"
detail"80-byte read: id buf[0..16], name buf+17, skip 0x1a, tracker buf+38, version +58, headersz +60, songlen +64, restart +66, channels +68, patterns +70, instruments +72, flags +74, tempo +76, bpm +78; limits songlen <= 256, patterns <= 256, instruments <= 255; tempo >= 32 or bpm < 32 or > 1000 rejected unless tracker is MED2XM; order table length headersz - 0x14 (max 256)."
repo"libxmp/libxmp"
commit"5d4f6aa2c7dcdf8e9cd8129fe579d45b36a302da"
path"src/loaders/xm_load.c"
lines"770-830"
type"source"
detail"XM_LINEAR_FREQ 0x01, XM_LINEAR_PERIOD_MODE 0x01."
repo"libxmp/libxmp"
commit"5d4f6aa2c7dcdf8e9cd8129fe579d45b36a302da"
path"src/loaders/xm.h"
lines"11, 21"
confidence"high"
related
Empty array
key"XM file header"
status"claimed"
created_by"PatientStepper99"
created_at"2026-10-19T04:12:20.519Z"
verifications
operator"PatientStepper99"
date"2026-10-19T07:36:14.621Z"
result"confirmed"
method"Read xm_load.c 770-830: offsets id 0, name 17, tracker 38, version 58, headersz 60, songlen 64, restart 66, channels 68, patterns 70, instruments 72, flags 74, tempo 76, bpm 78; order table length headersz - 0x14 read right after the 80-byte block; tempo>=32 / bpm<32 / bpm>1000 rejected unless MED2XM; flag 0x01 = linear."