Title metadata: Difference between revisions
| mNo edit summary |  Re-wrote page | ||
| Line 1: | Line 1: | ||
| [[Category:File formats]] | [[Category:File formats]] | ||
| '''Title metadata''' is a format used to store information about a title ( | '''Title metadata''' is a format used to store information about a title (installed title, DLC, etc.) and all its installed contents, including which contents they consist of and their SHA256 hashes. | ||
| [http://git.daifukkat.su/?p=3dshax.git Code is available] by trap15 to parse the available information from the 3DS format of TMDs. | [http://git.daifukkat.su/?p=3dshax.git Code is available] by trap15 to parse the available information from the 3DS format of TMDs. | ||
| Line 6: | Line 6: | ||
| == Structure == | == Structure == | ||
| All the data in the file represented in Big Endian. | All the data in the file represented in Big Endian.   | ||
| {| class="wikitable" | {| class="wikitable" | ||
| | align="center" style="background:#f0f0f0;"|'''Offset''' | | align="center" style="background:#f0f0f0;"|'''Offset''' | ||
| | align="center" style="background:#f0f0f0;"|'''Size''' | | align="center" style="background:#f0f0f0;"|'''Size''' | ||
| | align="center" style="background:#f0f0f0;"|'''Description''' | | align="center" style="background:#f0f0f0;"|'''Description''' | ||
| |- | |- | ||
| |  | | 0x0||Y||Signature Data | ||
| |- | |- | ||
| |  | | Y ||0xC4||Header | ||
| |- | |- | ||
| |  | | 0xC4 + Y||0x24*64||Content Info Records. | ||
| |- | |- | ||
| |  | | 0x9C4 + Y||0x30*ContentCount||Content Chunk Records. | ||
| |} | |||
| === Signature Data === | |||
| The total size of this section is referred to as "Y" in the overall TMD structure. The signature is of the header of the TMD. | |||
| {| class="wikitable" | |||
| | align="center" style="background:#f0f0f0;"|'''Offset''' | |||
| | align="center" style="background:#f0f0f0;"|'''Size''' | |||
| | align="center" style="background:#f0f0f0;"|'''Description''' | |||
| |- | |- | ||
| |  | | 0x0||0x4||Signature Type | ||
| |- | |- | ||
| |  | | 0x4 ||X||Signature | ||
| |- | |- | ||
| |  | | 0x4 + X|| ||Padding Aligning the signature data to 0x40 bytes | ||
| |} | |||
| ==== Signature Type ==== | |||
| {| class="wikitable" | |||
| |- | |- | ||
| ! Value | |||
| ! Signature Method | |||
| ! Signature Size (X) | |||
| |- | |- | ||
| |  | | 0x010000 | ||
| | RSA_4096 SHA1 | |||
| | 0x200 | |||
| |- | |- | ||
| |  | | 0x010001 | ||
| | RSA_2048 SHA1 | |||
| | 0x100 | |||
| |- | |- | ||
| |  | | 0x010002 | ||
| | Elliptic Curve | |||
| | 0x40 | |||
| |- | |- | ||
| |  | | 0x010003 | ||
| | RSA_4096 SHA256 | |||
| | 0x200 | |||
| |- | |- | ||
| |  | | 0x010004 | ||
| | RSA_2048 SHA256 | |||
| | 0x100 | |||
| |} | |||
| === Header === | |||
| {| class="wikitable" | |||
| | align="center" style="background:#f0f0f0;"|'''Offset''' | |||
| | align="center" style="background:#f0f0f0;"|'''Size''' | |||
| | align="center" style="background:#f0f0f0;"|'''Description''' | |||
| |- | |||
| | 0x0||0x40||Signature Issuer | |||
| |- | |||
| | 0x40||0x1||Version | |||
| |- | |||
| | 0x41||0x1||ca_crl_version | |||
| |- | |||
| | 0x42||0x1||signer_crl_version  | |||
| |- | |||
| | 0x43||0x1||Reserved | |||
| |- | |||
| | 0x44||0x8||System Version | |||
| |- | |||
| | 0x4C||0x8||Title ID | |||
| |- | |- | ||
| |  | | 0x54||0x4||Title Type | ||
| |- | |- | ||
| |  | | 0x58||0x2||Group ID | ||
| |- | |- | ||
| |  | | 0x5A||0x3C||Reserved | ||
| |- | |- | ||
| |  | | 0x98||0x4||Access Rights | ||
| |- | |- | ||
| |  | | 0x9C||0x2||Title Version | ||
| |- | |- | ||
| |  | | 0x9E||0x02||Content Count | ||
| |- | |- | ||
| |  | | 0xA0||0x2||Boot Content | ||
| |- | |- | ||
| |  | | 0xA2||0x2||Padding | ||
| |- | |- | ||
| |  | | 0xA4||0x20||SHA-256 Hash of the Content Info Records | ||
| |} | |} | ||
| === Content  | === Content Info Records === | ||
| There are 64 of these records, usually only the first is used. | |||
| {| class="wikitable" | {| class="wikitable" | ||
| |- | |- | ||
| Line 81: | Line 128: | ||
| === Content chunk records === | === Content chunk records === | ||
| There is one of these for each content contained in this title. (Determined by "Content Count" in the TMD Header). | |||
| {| class="wikitable" | {| class="wikitable" | ||
| |- | |- | ||
| Line 104: | Line 153: | ||
| |- | |- | ||
| | 0x10 | | 0x10 | ||
| |  | | 0x20 | ||
| | SHA-256 hash | | SHA-256 hash | ||
| |} | |} | ||
| === Content Index === | ==== Content Index ==== | ||
| This indicates the content type: | This indicates the content type: | ||
| Line 126: | Line 175: | ||
| |} | |} | ||
| === Content Type flags === | ==== Content Type flags ==== | ||
| {| class="wikitable" | {| class="wikitable" | ||
| |- | |- | ||