Title metadata: Difference between revisions
 Copied over from http://daifukkat.su/  | 
				 Added table with offsets similar to WiiBrew, DSiBrew, entries. Signature throws off values?  | 
				||
| Line 1: | Line 1: | ||
'''Title metadata''' is a format used to store information about a title (a single standalone game, channel, etc.) and all its installed contents, including which contents they consist of and their SHA1 hashes.  | |||
[http://git.daifukkat.su/?p=3dshax.git Code is available] by trap15 to parse the available information from the 3DS format of TMDs.  | |||
== Structure ==  | |||
=== Header ===  | |||
{| class="wikitable"  | |||
|- style="background-color: #ddd;"  | |||
! Start  | |||
! Length  | |||
! Description  | |||
|-  | |||
| 0x000  | |||
| 4  | |||
| Signature type  | |||
|-  | |||
| 0x004  | |||
| *  | |||
| 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 64  | |||
|-  | |||
| 0x184  | |||
| 8  | |||
| System Version  | |||
|-  | |||
| 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  | |||
|-  | |||
| 0x1E0  | |||
| 64  | |||
| Content Records  | |||
|-  | |||
| 0x220  | |||
| 40  | |||
| Padding modulo 64  | |||
|-  | |||
| 0x248  | |||
| 4  | |||
| Boot content  | |||
|-  | |||
| 0x252  | |||
| 4  | |||
| Banner content  | |||
|-  | |||
| 0x256  | |||
| 4  | |||
| Banner size  | |||
|-  | |||
| 0x260  | |||
| 32  | |||
| Hash  | |||
|}  | |||
=== Content Records ===  | |||
{| class="wikitable"  | |||
|-  | |||
! Start  | |||
! Length  | |||
! Description  | |||
|-  | |||
| 0x00  | |||
| 4  | |||
| Content ID  | |||
|-  | |||
| 0x04  | |||
| 32  | |||
| SHA-256 Hash  | |||
|}  | |||
=== Certificates ===  | |||
{| class="wikitable"  | |||
|-  | |||
! Start  | |||
! Length  | |||
! Description  | |||
|-  | |||
| 0x000  | |||
| 4  | |||
| Signature type  | |||
|-  | |||
| 0x004  | |||
| *  | |||
| Signature  | |||
|-  | |||
| 0x104  | |||
| 64  | |||
| Issuer  | |||
|-  | |||
| 0x124  | |||
| 4  | |||
| Tag  | |||
|-  | |||
| 0x128  | |||
| 64  | |||
| Name  | |||
|-  | |||
| 0x168  | |||
|   | |||
| Key  | |||
|}  | |||
== Example code application ==  | |||
<source lang="c">  | |||
  typedef struct {  |   typedef struct {  | ||
          u32 cid;         // content id  |           u32 cid;         // content id  | ||
| Line 47: | Line 197: | ||
          u8 key[...];  |           u8 key[...];  | ||
  } certificate;  |   } certificate;  | ||
</source>  | |||