From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:SDAT (Nitro sound archive)" |
|---|
| claim | "ndspy treats SDAT FAT sizes as padded when every entry's size equals the distance to the next entry's offset, otherwise as exact, and lowers the assumed file alignment from 0x200 step by step down to as little as 1 according to the offsets it sees." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "SDAT files as read by ndspy soundArchive.py" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "reading an SDAT FAT block" |
|---|
| effect | "fatLengthsIncludePadding starts True and becomes False if any non-last entry has size != next_offset - offset (the last entry is not compared); on writing, when True the stored size is rounded up to the alignment. fileAlignment starts 0x200 and is reduced to 0x100, 0x80, 0x40, 0x20, 0x10, 8, 4, 2 or 1 when an offset is odd at that granularity (offset % 0x200 == 0x100, % 0x100 == 0x80, % 0x80 == 0x40, % 0x40 == 0x20, % 0x20 == 0x10, % 0x10 == 8, % 8 == 4, % 4 == 2, % 2 == 1)." |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "FAT read loop with the padding and alignment detection; writer rounding of fLen" |
|---|
| repo | "https://github.com/RoadrunnerWMC/ndspy" |
|---|
| commit | "00165f177d03c6ca9e15e37decf54d9c6754bf54" |
|---|
| path | "ndspy/soundArchive.py" |
|---|
| lines | "139-180,790-805" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "FAT sizes and file alignment" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T23:56:20.776Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T07:41:27.022Z" |
|---|
| result | "confirmed" |
|---|
| method | "Fetched ndspy/soundArchive.py at ndspy 00165f177d03 and read the FAT loop (lines 139-180: fatLengthsIncludePadding cleared by size != next offset - offset for non-last entries, the nine alignment tests from 0x100 down to 1) and the writer (790-805: rounding fLen to fileAlignment when fatLengthsIncludePadding). Matches claim and data." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T04:04:10.152Z" |
|---|
| summary | "Corrected the alignment floor: ndspy's FAT loop lowers fileAlignment past 0x10 down to 8, 4, 2 and 1 (offset % 0x10 == 8, % 8 == 4, % 4 == 2, % 2 == 1), not only to 0x10. Read ndspy/soundArchive.py…" |
|---|
| changed | |
|---|
|
|
|---|