Difference between revisions of "Title metadata"

From DSiBrew
Jump to navigation Jump to search
(Improve formatting)
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''Title metadata''', or '''TMD''' for short, is a format used to store information about a title (DSiWare, etc.) and all its installed contents, including which contents they consist of and their SHA1 hashes. The format between Wii and DSi Title metadata ''appears'' to be identical.
+
'''Title metadata''', or '''TMD''' for short, is a format used to store information about a title ([[DSiWare]], etc.) and all its installed contents, including which contents they consist of and their {{Wikipedia|SHA-1}} hashes. The format between Wii and DSi Title metadata ''appears'' to be identical; this includes {{Wikipedia|endianness}}, so byteswaps are often needed on the DSi.
  
 
Many operations are done in terms of 64-byte blocks, which means you will often see padding out to the nearest 64-byte boundary at the end of a field.
 
Many operations are done in terms of 64-byte blocks, which means you will often see padding out to the nearest 64-byte boundary at the end of a field.
 +
 +
Example of a Nintendo DSi TMD: http://nus.cdn.t.shop.nintendowifi.net/ccs/download/0003000f484e4c4a/tmd ("HNLJ", or Japanese [[Version Data]].)
 +
 +
The certificate chain at the end of the file seems to always/usually have a size in bytes of 1,792 and a {{Wikipedia|SHA-256}} of <code>03CE2468F00D1AAEA52D7193A2312B0FE87ECE72D43381C3B6BD4C57E700CDD7</code>.
  
 
== Structure ==
 
== Structure ==
 +
 
=== Header ===
 
=== Header ===
 +
 
{| class="wikitable"
 
{| class="wikitable"
 
|- style="background-color: #ddd;"
 
|- style="background-color: #ddd;"
Line 41: Line 47:
 
| 0x183
 
| 0x183
 
| 1
 
| 1
| Padding modulo 64
+
| Padding modulo 4
 
|-
 
|-
 
| 0x184
 
| 0x184
 
| 8
 
| 8
| System Version
+
| System Version; probably always 0
 
|-
 
|-
 
| 0x18C
 
| 0x18C

Latest revision as of 05:28, 20 December 2022

Title metadata, or TMD for short, is a format used to store information about a title (DSiWare, etc.) and all its installed contents, including which contents they consist of and their SHA-1 hashes. The format between Wii and DSi Title metadata appears to be identical; this includes endianness, so byteswaps are often needed on the DSi.

Many operations are done in terms of 64-byte blocks, which means you will often see padding out to the nearest 64-byte boundary at the end of a field.

Example of a Nintendo DSi TMD: http://nus.cdn.t.shop.nintendowifi.net/ccs/download/0003000f484e4c4a/tmd ("HNLJ", or Japanese Version Data.)

The certificate chain at the end of the file seems to always/usually have a size in bytes of 1,792 and a SHA-256 of 03CE2468F00D1AAEA52D7193A2312B0FE87ECE72D43381C3B6BD4C57E700CDD7.

Structure

Header

Start Length Description
0x000 4 Signature type
0x004 256 Signature
0x104 60 Padding modulo 64
0x140 64 Issuer
0x180 1 Version
0x181 1 ca_crl_version
0x182 1 signer_crl_version
0x183 1 Padding modulo 4
0x184 8 System Version; probably always 0
0x18C 8 Title ID
0x194 4 Title type
0x198 2 Group ID
0x19A 62 reserved
0x1D8 4 Access rights
0x1DC 2 Title version
0x1DE 2 Number of contents (nbr_cont)
0x1E0 2 boot index
0x1E2 2 Padding modulo 64
0x1E4 36*nbr_cont Contents

Content

Start Length Description
0x00 4 Content ID
0x04 2 Index
0x06 2 Type
0x08 8 Size
0x10 20 SHA1 hash

Certificates

Start Length Description
0x000 4 Signature type
0x004 256 Signature
0x104 32 Issuer
0x124 4 Tag
0x128 64 Name
0x168 Key