SdatArchive
Reads and writes Nintendo DS SDAT (Sound Data Archive) container files.
SDAT binary layout (all fields little-endian):
Main header – 0x40 bytes 0x00 magic "SDAT" 0x04 BOM FE FF 0x06 version 01 00 0x08 total size (u32) 0x0C header size 40 00 0x0E numBlocks (u16) 2–4 0x10 symbOffset (u32, 0 if absent) 0x14 symbLength (u32, 0 if absent) 0x18 infoOffset (u32) 0x1C infoLength (u32) 0x20 fatOffset (u32) 0x24 fatLength (u32) 0x28 fileOffset (u32) 0x2C fileLength (u32) 0x30 reserved 16 zero bytes
SYMB block – optional 0x00 magic "SYMB", 0x04 block size 0x08 8 × u32 record-slot offsets (relative to SYMB block start) slot 0=SSEQ, 2=SBNK, 3=SWAR, 7=STRM (others unused) Each slot: u32 nEntries, nEntries × u32 string offsets (rel. to SYMB start; 0=unnamed) Each string: null-terminated ASCII
INFO block – required 0x00 magic "INFO", 0x04 block size 0x08 8 × u32 record-slot offsets (relative to INFO block start) Each slot: u32 nEntries, nEntries × u32 entry offsets (rel. to INFO start; 0=deleted) SSEQ entry (12 bytes): u16 fileId, u16 unk, u16 bank, u8 vol, u8 chanPri, u8 plrPri, u8 players, u82 SBNK entry (12 bytes): u16 fileId, u16 unk, u164 wars SWAR entry (4 bytes): u16 fileId, u16 unk STRM entry (12 bytes): u16 fileId, u16 unk, u8 vol, u8 prio, u8 players, u85
FAT block – required magic "FAT " (0x46415420) 0x08 u32 nEntries; each entry 16 bytes: u32 absOffset, u32 length, 8 reserved
FILE block – required magic "FILE", 0x08 u32 nFiles, 4 reserved, raw file data