Difference between revisions of "CNMT"
Jump to navigation
Jump to search
(Update header and extended header - next is extended data) |
|||
(11 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
This is the metadata file that ends in <code>".cnmt{.nca}"</code> or <code>"meta0.ncd"</code>. This seems to replace the TMD format. | This is the metadata file that ends in <code>".cnmt{.nca}"</code> or <code>"meta0.ncd"</code>. This seems to replace the TMD format. | ||
− | + | The official name for CNMT is "PackagedContentMeta". | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Header == | == Header == | ||
Line 21: | Line 12: | ||
| 0x0 | | 0x0 | ||
| 0x8 | | 0x8 | ||
− | | | + | | ID |
|- | |- | ||
| 0x8 | | 0x8 | ||
| 0x4 | | 0x4 | ||
− | + | | Version | |
|- | |- | ||
| 0xC | | 0xC | ||
| 0x1 | | 0x1 | ||
− | | [[NCM_services# | + | | [[NCM_services#ContentMetaType|Content Meta Type]] |
|- | |- | ||
| 0xD | | 0xD | ||
| 0x1 | | 0x1 | ||
− | | | + | | Reserved |
|- | |- | ||
| 0xE | | 0xE | ||
Line 49: | Line 40: | ||
| 0x14 | | 0x14 | ||
| 0x1 | | 0x1 | ||
− | | Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) | + | | Content Meta Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) |
|- | |- | ||
| 0x15 | | 0x15 | ||
| 0x3 | | 0x3 | ||
− | | | + | | Reserved |
|- | |- | ||
| 0x18 | | 0x18 | ||
Line 61: | Line 52: | ||
| 0x1C | | 0x1C | ||
| 0x4 | | 0x4 | ||
− | | | + | | Reserved |
|} | |} | ||
Line 73: | Line 64: | ||
| 0x0 | | 0x0 | ||
| 0x4 | | 0x4 | ||
− | | Extended | + | | Extended Data Size |
|} | |} | ||
Line 90: | Line 81: | ||
| 0x4 | | 0x4 | ||
| Required System Version | | Required System Version | ||
+ | |- | ||
+ | | 0xC | ||
+ | | 0x4 | ||
+ | | Required Application Version | ||
|} | |} | ||
Line 113: | Line 108: | ||
| 0x10 | | 0x10 | ||
| 0x8 | | 0x8 | ||
− | | | + | | Reserved |
|} | |} | ||
Line 133: | Line 128: | ||
| 0xC | | 0xC | ||
| 0x4 | | 0x4 | ||
− | | | + | | Reserved |
|} | |} | ||
Line 153: | Line 148: | ||
| 0xC | | 0xC | ||
| 0x4 | | 0x4 | ||
− | | | + | | Reserved |
|} | |} | ||
− | == Content | + | == Packaged Content Info == |
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 178: | Line 173: | ||
| 0x36 | | 0x36 | ||
| 0x1 | | 0x1 | ||
− | | | + | | Content Type (0=Meta, 1=Program, 2=Data, 3=Control, 4=[[Internet_Browser|HtmlDocument]], 5=[[Internet_Browser|LegalInformation]], 6=[[NCA_Format|DeltaFragment]]) |
|- | |- | ||
| 0x37 | | 0x37 | ||
| 0x1 | | 0x1 | ||
− | | | + | | ID Offset |
|} | |} | ||
− | == Meta | + | == Content Meta Info == |
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 195: | Line 190: | ||
| 0x0 | | 0x0 | ||
| 0x8 | | 0x8 | ||
− | | | + | | ID |
|- | |- | ||
| 0x8 | | 0x8 | ||
Line 203: | Line 198: | ||
| 0xC | | 0xC | ||
| 0x1 | | 0x1 | ||
− | | [[NCM_services#Title_Types|Meta Type]] | + | | [[NCM_services#Title_Types|Content Meta Type]] |
|- | |- | ||
| 0xD | | 0xD | ||
| 0x1 | | 0x1 | ||
− | | Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) | + | | Content Meta Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) |
|- | |- | ||
| 0xE | | 0xE | ||
| 0x2 | | 0x2 | ||
− | | | + | | Reserved |
|} | |} | ||
This is used for SystemUpdate, see here: [[NCM_services#ReadEntryMetaRecords]]. | This is used for SystemUpdate, see here: [[NCM_services#ReadEntryMetaRecords]]. | ||
− | == Extended | + | == SystemUpdate Extended Data == |
− | + | If the Version field is 1, the format is: | |
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! Offset | ||
+ | ! Size | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x0 | ||
+ | | 0x4 | ||
+ | | Version | ||
+ | |- | ||
+ | | 0x4 | ||
+ | | 0x4 | ||
+ | | Variation Count | ||
+ | |- | ||
+ | | 0x8 | ||
+ | | 0x20 * Variation Count | ||
+ | | [[CNMT#Firmware_Variation_Info_(Version_1)|Firmware Variation Info (Version 1)]] | ||
+ | |} | ||
+ | If the Version field is 2, the format is: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 227: | Line 241: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | 0x4 |
− | | | + | | Version |
|- | |- | ||
| 0x4 | | 0x4 | ||
− | | | + | | 0x4 |
− | | | + | | Variation Count |
|- | |- | ||
| 0x8 | | 0x8 | ||
− | | | + | | 0x4 * Variation Count |
− | | | + | | Firmware Variation ID |
+ | |- | ||
+ | | | ||
+ | | 0x20 * Variation Count | ||
+ | | [[CNMT#Firmware_Variation_Info_(Version_2)|Firmware Variation Info (Version 2)]] | ||
+ | |- | ||
+ | | | ||
+ | | 0x10 * Meta Count (From [[CNMT#Firmware_Variation_Info_(Version_2)|Firmware Variation Info (Version 2)]]) | ||
+ | | [[CNMT#Content_Meta_Info|Content Meta Info]] (If Refer To Base is False) | ||
+ | |} | ||
+ | |||
+ | === Firmware Variation Info (Version 1) === | ||
+ | |||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! Offset | ||
+ | ! Size | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x0 | ||
+ | | 0x4 | ||
+ | | Firmware Variation ID | ||
+ | |- | ||
+ | | 0x4 | ||
+ | | 0x1C | ||
+ | | Reserved | ||
+ | |} | ||
+ | |||
+ | === Firmware Variation Info (Version 2) === | ||
+ | |||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! Offset | ||
+ | ! Size | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x0 | ||
+ | | 0x1 | ||
+ | | Refer To Base (0=False, 1=True) | ||
+ | |- | ||
+ | | 0x1 | ||
+ | | 0x3 | ||
+ | | Reserved | ||
+ | |- | ||
+ | | 0x4 | ||
+ | | 0x4 | ||
+ | | Meta Count | ||
+ | |- | ||
+ | | 0x8 | ||
+ | | 0x18 | ||
+ | | Reserved | ||
+ | |} | ||
+ | |||
+ | == Patch Extended Data == | ||
+ | |||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! Offset | ||
+ | ! Size | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x0 | ||
+ | | 0x4 | ||
+ | | History Count | ||
+ | |- | ||
+ | | 0x4 | ||
+ | | 0x4 | ||
+ | | Delta History Count | ||
+ | |- | ||
+ | | 0x8 | ||
+ | | 0x4 | ||
+ | | Delta Count | ||
|- | |- | ||
| 0xC | | 0xC | ||
− | | | + | | 0x4 |
− | | | + | | Fragment Set Count |
|- | |- | ||
| 0x10 | | 0x10 | ||
− | | | + | | 0x4 |
− | | | + | | History Content Count |
|- | |- | ||
| 0x14 | | 0x14 | ||
− | | | + | | 0x4 |
− | | | + | | Delta Content Count |
|- | |- | ||
| 0x18 | | 0x18 | ||
− | | | + | | 0x4 |
− | | | + | | Reserved |
|- | |- | ||
| 0x1C | | 0x1C | ||
− | | 0x38* | + | | 0x38 * History Count |
− | | | + | | [[CNMT#History_Header|History Headers]] |
|- | |- | ||
| | | | ||
− | | 0x28* | + | | 0x28 * Delta History Count |
− | | | + | | [[CNMT#Delta_History|Delta Histories]] |
|- | |- | ||
| | | | ||
− | | 0x28* | + | | 0x28 * Delta Count |
− | | Delta | + | | [[CNMT#Delta_Header|Delta Headers]] |
|- | |- | ||
| | | | ||
− | | 0x34* | + | | 0x34 * Fragment Set Count |
− | | | + | | [[CNMT#Fragment_Set|Fragment Sets]] |
|- | |- | ||
| | | | ||
− | | 0x18* | + | | 0x18 * History Content Count |
− | | | + | | [[CNMT#Packaged_Content_Info|History Content Info]] (Packaged Content Info without the Hash entry) |
|- | |- | ||
| | | | ||
− | | 0x38* | + | | 0x38 * Delta Content Count |
− | + | | [[CNMT#Packaged_Content_Info|Delta Packaged Content Info]] | |
− | |||
− | | | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
+ | | | ||
+ | | 0x4 * Fragment Indicator Count (From [[CNMT#Fragment_Set|Fragment Sets]]) | ||
+ | | [[CNMT#Fragment_Indicator|Fragment Indicators]] | ||
|} | |} | ||
− | == | + | === History Header === |
− | |||
− | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 303: | Line 377: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | 0x10 |
− | | | + | | Content Meta Key (Slightly different Content Meta Info) |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| 0x10 | | 0x10 | ||
− | | | + | | 0x20 |
− | | | + | | Digest |
|- | |- | ||
| 0x30 | | 0x30 | ||
− | | | + | | 0x2 |
− | | | + | | Content Info Count |
|- | |- | ||
| 0x32 | | 0x32 | ||
− | | | + | | 0x6 |
− | | | + | | Reserved |
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | + | === Delta History === | |
− | |||
− | == | ||
− | |||
− | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 349: | Line 402: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | 0x8 |
− | | | + | | Source Patch ID |
|- | |- | ||
| 0x8 | | 0x8 | ||
− | | | + | | 0x8 |
− | | | + | | Destination Patch ID |
|- | |- | ||
| 0x10 | | 0x10 | ||
− | | | + | | 0x4 |
− | | | + | | Source Version |
|- | |- | ||
| 0x14 | | 0x14 | ||
− | | | + | | 0x4 |
− | | | + | | Destination Version |
|- | |- | ||
| 0x18 | | 0x18 | ||
− | | | + | | 0x8 |
− | | Size | + | | Download Size |
|- | |- | ||
| 0x20 | | 0x20 | ||
− | | | + | | 0x8 |
− | | | + | | Reserved |
− | |||
|} | |} | ||
− | + | === Delta Header === | |
− | |||
− | == Delta | ||
− | |||
− | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 387: | Line 435: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | 0x8 |
− | | | + | | Source Patch ID |
|- | |- | ||
| 0x8 | | 0x8 | ||
| 8 | | 8 | ||
− | | | + | | Destination Patch ID |
|- | |- | ||
| 0x10 | | 0x10 | ||
− | | | + | | 0x4 |
− | | | + | | Source Version |
|- | |- | ||
| 0x14 | | 0x14 | ||
− | | | + | | 0x4 |
− | | | + | | Destination Version |
|- | |- | ||
| 0x18 | | 0x18 | ||
− | | | + | | 0x2 |
− | | | + | | Fragment Set Count |
+ | |- | ||
+ | | 0x1A | ||
+ | | 0x6 | ||
+ | | Reserved | ||
|- | |- | ||
| 0x20 | | 0x20 | ||
− | | | + | | 0x2 |
− | | | + | | Content Info Count |
|- | |- | ||
+ | | 0x22 | ||
+ | | 0x6 | ||
+ | | Reserved | ||
|} | |} | ||
− | + | === Fragment Set === | |
− | |||
− | == | ||
− | |||
− | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 425: | Line 476: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | 0x10 |
− | | | + | | Source Content ID |
|- | |- | ||
| 0x10 | | 0x10 | ||
− | | | + | | 0x10 |
− | | | + | | Destination Content ID |
|- | |- | ||
| 0x20 | | 0x20 | ||
− | | | + | | 0x6 |
− | | | + | | Source Size |
|- | |- | ||
| 0x26 | | 0x26 | ||
− | | | + | | 0x6 |
− | | | + | | Destination Size |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
| 0x2C | | 0x2C | ||
− | | | + | | 0x2 |
− | | | + | | Fragment Indicator Count |
|- | |- | ||
| 0x2E | | 0x2E | ||
− | | | + | | 0x1 |
− | | Type ( | + | | Fragment Target Content Type (0=Meta, 1=Program, 2=Data, 3=Control, 4=[[Internet_Browser|HtmlDocument]], 5=[[Internet_Browser|LegalInformation]], 6=[[NCA_Format|DeltaFragment]]) |
|- | |- | ||
| 0x2F | | 0x2F | ||
− | | | + | | 0x1 |
− | | | + | | Update Type (0=ApplyAsDelta, 1=Overwrite, 2=Create) |
|- | |- | ||
| 0x30 | | 0x30 | ||
− | | | + | | 0x4 |
− | | | + | | Reserved |
− | |||
|} | |} | ||
− | + | === Fragment Indicator === | |
− | == | + | {| class="wikitable" border="1" |
+ | |- | ||
+ | ! Offset | ||
+ | ! Size | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x0 | ||
+ | | 0x2 | ||
+ | | Content Info Index | ||
+ | |- | ||
+ | | 0x2 | ||
+ | | 0x2 | ||
+ | | Fragment Index | ||
+ | |} | ||
− | + | == Delta Extended Data == | |
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 475: | Line 534: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | 0x8 |
− | | | + | | Source Patch ID |
+ | |- | ||
+ | | 0x8 | ||
+ | | 0x8 | ||
+ | | Destination Patch ID | ||
|- | |- | ||
| 0x10 | | 0x10 | ||
− | | | + | | 0x4 |
− | | | + | | Source Version |
+ | |- | ||
+ | | 0x14 | ||
+ | | 0x4 | ||
+ | | Destination Version | ||
+ | |- | ||
+ | | 0x18 | ||
+ | | 0x2 | ||
+ | | Fragment Set Count | ||
|- | |- | ||
− | | | + | | 0x1A |
− | | | + | | 0x6 |
− | | | + | | Reserved |
|- | |- | ||
− | | | + | | 0x20 |
− | | | + | | 0x34 * Fragment Set Count |
− | | | + | | [[CNMT#Fragment_Set|Fragment Sets]] |
|- | |- | ||
+ | | | ||
+ | | 0x4 * Fragment Indicator Count (From [[CNMT#Fragment_Set|Fragment Sets]]) | ||
+ | | [[CNMT#Fragment_Indicator|Fragment Indicators]] | ||
|} | |} | ||
− | + | == Digest == | |
+ | |||
+ | Always found at the end of the file. | ||
+ | |||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! Offset | ||
+ | ! Size | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x0 | ||
+ | | 0x20 | ||
+ | | Digest | ||
+ | |} |
Revision as of 01:18, 18 July 2020
This is the metadata file that ends in ".cnmt{.nca}"
or "meta0.ncd"
. This seems to replace the TMD format.
The official name for CNMT is "PackagedContentMeta".
Header
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | ID |
0x8 | 0x4 | Version |
0xC | 0x1 | Content Meta Type |
0xD | 0x1 | Reserved |
0xE | 0x2 | Extended Header Size |
0x10 | 0x2 | Content Count |
0x12 | 0x2 | Content Meta Count |
0x14 | 0x1 | Content Meta Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) |
0x15 | 0x3 | Reserved |
0x18 | 0x4 | Required Download System Version |
0x1C | 0x4 | Reserved |
SystemUpdate Extended Header
Offset | Size | Description |
---|---|---|
0x0 | 0x4 | Extended Data Size |
Application Extended Header
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Patch ID |
0x8 | 0x4 | Required System Version |
0xC | 0x4 | Required Application Version |
Patch Extended Header
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Application ID |
0x8 | 0x4 | Required System Version |
0xC | 0x4 | Extended Data Size |
0x10 | 0x8 | Reserved |
AddOnContent Extended Header
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Application ID |
0x8 | 0x4 | Required Application Version |
0xC | 0x4 | Reserved |
Delta Extended Header
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Application ID |
0x8 | 0x4 | Extended Data Size |
0xC | 0x4 | Reserved |
Packaged Content Info
Offset | Size | Description |
---|---|---|
0x0 | 0x20 | Hash |
0x20 | 0x10 | Content ID |
0x30 | 0x6 | Size |
0x36 | 0x1 | Content Type (0=Meta, 1=Program, 2=Data, 3=Control, 4=HtmlDocument, 5=LegalInformation, 6=DeltaFragment) |
0x37 | 0x1 | ID Offset |
Content Meta Info
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | ID |
0x8 | 0x4 | Version |
0xC | 0x1 | Content Meta Type |
0xD | 0x1 | Content Meta Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) |
0xE | 0x2 | Reserved |
This is used for SystemUpdate, see here: NCM_services#ReadEntryMetaRecords.
SystemUpdate Extended Data
If the Version field is 1, the format is:
Offset | Size | Description |
---|---|---|
0x0 | 0x4 | Version |
0x4 | 0x4 | Variation Count |
0x8 | 0x20 * Variation Count | Firmware Variation Info (Version 1) |
If the Version field is 2, the format is:
Offset | Size | Description |
---|---|---|
0x0 | 0x4 | Version |
0x4 | 0x4 | Variation Count |
0x8 | 0x4 * Variation Count | Firmware Variation ID |
0x20 * Variation Count | Firmware Variation Info (Version 2) | |
0x10 * Meta Count (From Firmware Variation Info (Version 2)) | Content Meta Info (If Refer To Base is False) |
Firmware Variation Info (Version 1)
Offset | Size | Description |
---|---|---|
0x0 | 0x4 | Firmware Variation ID |
0x4 | 0x1C | Reserved |
Firmware Variation Info (Version 2)
Offset | Size | Description |
---|---|---|
0x0 | 0x1 | Refer To Base (0=False, 1=True) |
0x1 | 0x3 | Reserved |
0x4 | 0x4 | Meta Count |
0x8 | 0x18 | Reserved |
Patch Extended Data
Offset | Size | Description |
---|---|---|
0x0 | 0x4 | History Count |
0x4 | 0x4 | Delta History Count |
0x8 | 0x4 | Delta Count |
0xC | 0x4 | Fragment Set Count |
0x10 | 0x4 | History Content Count |
0x14 | 0x4 | Delta Content Count |
0x18 | 0x4 | Reserved |
0x1C | 0x38 * History Count | History Headers |
0x28 * Delta History Count | Delta Histories | |
0x28 * Delta Count | Delta Headers | |
0x34 * Fragment Set Count | Fragment Sets | |
0x18 * History Content Count | History Content Info (Packaged Content Info without the Hash entry) | |
0x38 * Delta Content Count | Delta Packaged Content Info | |
0x4 * Fragment Indicator Count (From Fragment Sets) | Fragment Indicators |
History Header
Offset | Size | Description |
---|---|---|
0x0 | 0x10 | Content Meta Key (Slightly different Content Meta Info) |
0x10 | 0x20 | Digest |
0x30 | 0x2 | Content Info Count |
0x32 | 0x6 | Reserved |
Delta History
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Source Patch ID |
0x8 | 0x8 | Destination Patch ID |
0x10 | 0x4 | Source Version |
0x14 | 0x4 | Destination Version |
0x18 | 0x8 | Download Size |
0x20 | 0x8 | Reserved |
Delta Header
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Source Patch ID |
0x8 | 8 | Destination Patch ID |
0x10 | 0x4 | Source Version |
0x14 | 0x4 | Destination Version |
0x18 | 0x2 | Fragment Set Count |
0x1A | 0x6 | Reserved |
0x20 | 0x2 | Content Info Count |
0x22 | 0x6 | Reserved |
Fragment Set
Offset | Size | Description |
---|---|---|
0x0 | 0x10 | Source Content ID |
0x10 | 0x10 | Destination Content ID |
0x20 | 0x6 | Source Size |
0x26 | 0x6 | Destination Size |
0x2C | 0x2 | Fragment Indicator Count |
0x2E | 0x1 | Fragment Target Content Type (0=Meta, 1=Program, 2=Data, 3=Control, 4=HtmlDocument, 5=LegalInformation, 6=DeltaFragment) |
0x2F | 0x1 | Update Type (0=ApplyAsDelta, 1=Overwrite, 2=Create) |
0x30 | 0x4 | Reserved |
Fragment Indicator
Offset | Size | Description |
---|---|---|
0x0 | 0x2 | Content Info Index |
0x2 | 0x2 | Fragment Index |
Delta Extended Data
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Source Patch ID |
0x8 | 0x8 | Destination Patch ID |
0x10 | 0x4 | Source Version |
0x14 | 0x4 | Destination Version |
0x18 | 0x2 | Fragment Set Count |
0x1A | 0x6 | Reserved |
0x20 | 0x34 * Fragment Set Count | Fragment Sets |
0x4 * Fragment Indicator Count (From Fragment Sets) | Fragment Indicators |
Digest
Always found at the end of the file.
Offset | Size | Description |
---|---|---|
0x0 | 0x20 | Digest |