Difference between revisions of "Nintendo DS Cart Whitelist"

From DSiBrew
Jump to navigation Jump to search
(Undo revision 2455 by Zbrahead91 (talk))
(→‎NDHT entry: hash1 is definitely something with the main binary)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Description ==
+
The '''Nintendo DS Cart Whitelist''' is a system title (HNHA / 0003000f484e4841) on DSi and 3DS TWL_MODE that contains a list of whitelisted DS carts. Other carts can be loaded if they have a valid RSA signature, which is how newer DS games load on DSi systems.
If i remember correctly, HNHA.bin is a file stored in the DSi (NAND fs ?), that contains a list of white listed DS games.
 
  
== Basic HNHA.bin File Structure ==
+
== Format ==
 +
Newer versions of the file contain 3 sections: NDHT, NDHX, and NDHI. Older versions only contain NDHT.
  
The file consists in one header, a list of Titles and a footer.
+
=== Header ===
 
+
Each section starts with a 136 byte header.
=== Header Structure ===
 
The header is 136 bytes.
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|- style="background-color: #ddd;"
 
|- style="background-color: #ddd;"
Line 16: Line 14:
 
| 0x00
 
| 0x00
 
| 4
 
| 4
| An ID (NDHT)
+
| Section type (NDHT, NDHX, NDHI)
 
|-
 
|-
 
| 0x04
 
| 0x04
 
| 0x80
 
| 0x80
| Unknown
+
| RSA signature of the entire section below this point.
 
|-
 
|-
 
| 0x84
 
| 0x84
 
| 4
 
| 4
| Number of titles in file
+
| Number of entries
 
|}
 
|}
  
=== Title Structure ===
+
=== NDHT entry ===
A title is 48 bytes.
+
NDHT entries correspond to titles and are 48 bytes. The NDHT section is always first.
 +
 
 
{| class="wikitable"
 
{| class="wikitable"
 
|- style="background-color: #ddd;"
 
|- style="background-color: #ddd;"
Line 37: Line 36:
 
| 0x00
 
| 0x00
 
| 4
 
| 4
| The title ID
+
| ROM serial
 
|-
 
|-
 
| 0x04
 
| 0x04
 
| 4
 
| 4
| The title version
+
| ROM revision
 
|-
 
|-
 
| 0x08
 
| 0x08
 
| 20
 
| 20
| The first SHA-1 sum
+
| hash1 (HMAC covering parts of the main binary)
 
|-
 
|-
 
| 0x1C
 
| 0x1C
 
| 20
 
| 20
| The second SHA-1 sum
+
| hash2 (overlay?)
 
|}
 
|}
  
=== Footer Structure ===
+
=== NDHT footer ===
The footer is 24 bytes.
+
The NDHT footer is 24 bytes.
 
{| class="wikitable"
 
{| class="wikitable"
 
|- style="background-color: #ddd;"
 
|- style="background-color: #ddd;"
Line 63: Line 62:
 
| 24
 
| 24
 
| Unknown
 
| Unknown
 +
|}
 +
 +
=== NDHX entry ===
 +
{| class="wikitable"
 +
|- style="background-color: #ddd;"
 +
! Start
 +
! Length
 +
! Description
 +
|-
 +
| 0x00
 +
| 4
 +
| ROM serial
 +
|-
 +
| 0x04
 +
| 4
 +
| ROM revision
 +
|-
 +
| 0x08
 +
| 20
 +
| hash3
 +
|}
 +
 +
=== NDHI entry ===
 +
{| class="wikitable"
 +
|- style="background-color: #ddd;"
 +
! Start
 +
! Length
 +
! Description
 +
|-
 +
| 0x00
 +
| 4
 +
| ROM serial
 +
|-
 +
| 0x04
 +
| 4
 +
| ROM revision
 +
|-
 +
| 0x08
 +
| 64
 +
| 8 HMAC region struct
 +
 +
{| class="wikitable"
 +
! Start
 +
! Length
 +
! Description
 +
|-
 +
| 0x0
 +
| 4
 +
| Unknown (offset?)
 +
|-
 +
| 0x4
 +
| 4
 +
| Unknown (length?)
 +
|}
 +
 +
|-
 +
| 0x48
 +
| 20
 +
| Expected HMAC
 
|}
 
|}

Latest revision as of 03:02, 26 September 2022

The Nintendo DS Cart Whitelist is a system title (HNHA / 0003000f484e4841) on DSi and 3DS TWL_MODE that contains a list of whitelisted DS carts. Other carts can be loaded if they have a valid RSA signature, which is how newer DS games load on DSi systems.

Format

Newer versions of the file contain 3 sections: NDHT, NDHX, and NDHI. Older versions only contain NDHT.

Header

Each section starts with a 136 byte header.

Start Length Description
0x00 4 Section type (NDHT, NDHX, NDHI)
0x04 0x80 RSA signature of the entire section below this point.
0x84 4 Number of entries

NDHT entry

NDHT entries correspond to titles and are 48 bytes. The NDHT section is always first.

Start Length Description
0x00 4 ROM serial
0x04 4 ROM revision
0x08 20 hash1 (HMAC covering parts of the main binary)
0x1C 20 hash2 (overlay?)

NDHT footer

The NDHT footer is 24 bytes.

Start Length Description
0x00 24 Unknown

NDHX entry

Start Length Description
0x00 4 ROM serial
0x04 4 ROM revision
0x08 20 hash3

NDHI entry

Start Length Description
0x00 4 ROM serial
0x04 4 ROM revision
0x08 64 8 HMAC region struct
Start Length Description
0x0 4 Unknown (offset?)
0x4 4 Unknown (length?)
0x48 20 Expected HMAC