From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "behavior" |
|---|
| subject | "Format:Nintendo DS ROM image (NDS)" |
|---|
| claim | "The secure area CRC16 at header 0x6C: ndstool verifies it over the 0x4000 bytes at ROM offset 0x4000 (encrypting them first when the ROM is classified as decrypted), but when it builds a ROM it computes it over arm9_rom_offset up to 0x8000 (0x4000 bytes for the usual offset 0x4000), only if arm9_rom_offset < 0x8000." |
|---|
| scope | | level | "tool" |
|---|
| applies_to | "Tool:Ndstool" |
|---|
| observed_in | |
|---|
|
|---|
| data | | trigger | "ndstool -i (ShowInfo) versus ndstool -c (create)" |
|---|
| effect | "CalcSecureAreaCRC reads 0x4000 bytes at 0x4000; header fix-up uses FCalcCrc16(fNDS, arm9_rom_offset, 0x8000 - arm9_rom_offset)" |
|---|
| condition | "the secure area of retail ROMs is encrypted: this fact only says it exists and where its CRC is stored; the ROM type test is in the ROM type detection fact" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "CalcSecureAreaCRC at lines 59-66; ShowHeaderInfo compares it with header.secure_area_crc at 182-198" |
|---|
| repo | "https://github.com/devkitPro/ndstool" |
|---|
| commit | "76e8b681bb225d945a48852821e03114e6c7ce1c" |
|---|
| path | "source/header.cpp" |
|---|
| lines | "59-66, 182-198" |
|---|
|
| type | "source" |
|---|
| detail | "build step: if (header.arm9_rom_offset < 0x8000) header.secure_area_crc = FCalcCrc16(fNDS, header.arm9_rom_offset, 0x8000 - header.arm9_rom_offset)" |
|---|
| repo | "https://github.com/devkitPro/ndstool" |
|---|
| commit | "76e8b681bb225d945a48852821e03114e6c7ce1c" |
|---|
| path | "source/ndscreate.cpp" |
|---|
| lines | "801" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Secure area CRC" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T12:24:27.445Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T13:17:08.262Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read ndstool source/header.cpp (DetectRomType, CalcSecureAreaCRC, ShowHeaderInfo) and ndscreate.cpp line 801 at 76e8b68: ShowInfo passes encrypt = (romType == ROMTYPE_NDSDUMPED), create path computes FCalcCrc16 over arm9_rom_offset..0x8000 when arm9_rom_offset < 0x8000. Matches; homebrew ROMs print '-' instead of OK/INVALID (not in the claim)." |
|---|
|
|
|---|