Difference between revisions of "CNMT"
Jump to navigation
Jump to search
(→Meta records: broken link) |
m |
||
(6 intermediate revisions by the same user not shown) | |||
Line 12: | Line 12: | ||
* "Delta_{lower-case hex titleID}.cnmt" | * "Delta_{lower-case hex titleID}.cnmt" | ||
− | + | == Header == | |
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 20: | Line 20: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | 0x8 |
| Title ID | | Title ID | ||
|- | |- | ||
| 0x8 | | 0x8 | ||
− | | | + | | 0x4 |
− | | | + | | Version |
|- | |- | ||
| 0xC | | 0xC | ||
− | | | + | | 0x1 |
− | | | + | | [[NCM_services#Title_Types|Meta Type]] |
|- | |- | ||
| 0xD | | 0xD | ||
− | | | + | | 0x1 |
− | | | + | | Unused |
|- | |- | ||
| 0xE | | 0xE | ||
− | | | + | | 0x2 |
− | | | + | | Extended Header Size |
|- | |- | ||
| 0x10 | | 0x10 | ||
− | | | + | | 0x2 |
− | | | + | | Content Count |
|- | |- | ||
| 0x12 | | 0x12 | ||
− | | | + | | 0x2 |
− | | | + | | Content Meta Count |
|- | |- | ||
| 0x14 | | 0x14 | ||
− | | | + | | 0x1 |
− | | | + | | Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) |
+ | |- | ||
+ | | 0x15 | ||
+ | | 0x3 | ||
+ | | Unused | ||
+ | |- | ||
+ | | 0x18 | ||
+ | | 0x4 | ||
+ | | Required Download System Version | ||
+ | |- | ||
+ | | 0x1C | ||
+ | | 0x4 | ||
+ | | Unused | ||
|} | |} | ||
− | + | == SystemUpdate Extended Header == | |
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! Offset | ||
+ | ! Size | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x0 | ||
+ | | 0x4 | ||
+ | | Extended Data Size | ||
+ | |} | ||
− | + | == Application Extended Header == | |
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! Offset | ||
+ | ! Size | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x0 | ||
+ | | 0x8 | ||
+ | | Patch ID | ||
+ | |- | ||
+ | | 0x8 | ||
+ | | 0x4 | ||
+ | | Required System Version | ||
+ | |- | ||
+ | | 0xC | ||
+ | | 0x4 | ||
+ | | Unused | ||
+ | |} | ||
− | + | == Patch Extended Header == | |
− | |||
− | |||
− | |||
− | == | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 67: | Line 103: | ||
! Description | ! Description | ||
|- | |- | ||
− | | | + | | 0x0 |
− | | | + | | 0x8 |
− | | | + | | Application ID |
+ | |- | ||
+ | | 0x8 | ||
+ | | 0x4 | ||
+ | | Required System Version | ||
+ | |- | ||
+ | | 0xC | ||
+ | | 0x4 | ||
+ | | Extended Data Size | ||
|- | |- | ||
− | | | + | | 0x10 |
− | | | + | | 0x8 |
− | | | + | | Unused |
|} | |} | ||
− | == | + | == AddOnContent Extended Header == |
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 83: | Line 127: | ||
! Description | ! Description | ||
|- | |- | ||
− | | | + | | 0x0 |
− | | | + | | 0x8 |
− | | | + | | Application ID |
+ | |- | ||
+ | | 0x8 | ||
+ | | 0x4 | ||
+ | | Required Application Version | ||
|- | |- | ||
− | | | + | | 0xC |
− | | | + | | 0x4 |
− | | | + | | Unused |
|} | |} | ||
− | == | + | == Delta Extended Header == |
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
Line 99: | Line 147: | ||
! Description | ! Description | ||
|- | |- | ||
− | | | + | | 0x0 |
− | | | + | | 0x8 |
− | | Application | + | | Application ID |
+ | |- | ||
+ | | 0x8 | ||
+ | | 0x4 | ||
+ | | Extended Data Size | ||
|- | |- | ||
− | | | + | | 0xC |
− | | | + | | 0x4 |
− | | | + | | Unused |
|} | |} | ||
− | == Content | + | == Content Records == |
− | |||
− | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 119: | Line 169: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | 0x20 |
| Hash | | Hash | ||
|- | |- | ||
| 0x20 | | 0x20 | ||
− | | | + | | 0x10 |
− | | | + | | Content ID |
|- | |- | ||
| 0x30 | | 0x30 | ||
− | | | + | | 0x6 |
− | | Size | + | | Size |
|- | |- | ||
| 0x36 | | 0x36 | ||
− | | | + | | 0x1 |
− | | Type (0=Meta, 1=Program, 2=Data, 3=Control, 4=[[Internet_Browser|HtmlDocument]], 5=[[Internet_Browser|LegalInformation]], 6=[[NCA_Format|DeltaFragment]]) | + | | 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 |
− | | | + | | Id Offset |
|} | |} | ||
− | == Meta | + | == Content Meta Records == |
− | |||
− | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 150: | Line 198: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | 0x8 |
| Title ID | | Title ID | ||
|- | |- | ||
| 0x8 | | 0x8 | ||
− | | | + | | 0x4 |
− | | | + | | Version |
|- | |- | ||
| 0xC | | 0xC | ||
− | | | + | | 0x1 |
− | | | + | | [[NCM_services#Title_Types|Meta Type]] |
|- | |- | ||
| 0xD | | 0xD | ||
− | | | + | | 0x1 |
− | | | + | | Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) |
|- | |- | ||
| 0xE | | 0xE | ||
− | | | + | | 0x2 |
− | | Unused | + | | Unused |
|} | |} | ||
This is used for SystemUpdate, see here: [[NCM_services#ReadEntryMetaRecords]]. | This is used for SystemUpdate, see here: [[NCM_services#ReadEntryMetaRecords]]. | ||
− | == Extended | + | == SystemUpdate Extended Data == |
− | Patch | + | {| class="wikitable" border="1" |
+ | |- | ||
+ | ! Offset | ||
+ | ! Size | ||
+ | ! Description | ||
+ | |- | ||
+ | | 0x0 | ||
+ | | 0x4 | ||
+ | | Version | ||
+ | |- | ||
+ | | 0x4 | ||
+ | | 0x4 | ||
+ | | Variation Count | ||
+ | |- | ||
+ | | 0x8 | ||
+ | | 0x4 | ||
+ | | Firmware Variation | ||
+ | |- | ||
+ | | 0xC | ||
+ | | 0x1C * Variation Count | ||
+ | | Unused | ||
+ | |} | ||
+ | |||
+ | == Patch Extended Data == | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 183: | Line 254: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | 0x4 |
− | | | + | | History Count |
|- | |- | ||
| 0x4 | | 0x4 | ||
− | | | + | | 0x4 |
− | | | + | | Delta History Count |
|- | |- | ||
| 0x8 | | 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 |
− | | Unused | + | | Unused |
|- | |- | ||
| 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#Content_Records|History Content Records (Content Records without the Hash entry)]] |
|- | |- | ||
| | | | ||
− | | 0x38* | + | | 0x38 * Delta Content Count |
− | + | | [[CNMT#Content_Records|Delta Content Records]] | |
− | |||
− | | | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
+ | | | ||
+ | | 0x4 * Fragment Indicator Count (Fragment Set) | ||
+ | | [[CNMT#Fragment_Indicator|Fragment Indicators]] | ||
|} | |} | ||
− | == | + | === History Header === |
− | |||
− | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 259: | Line 319: | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
− | | | + | | 0x10 |
− | | | + | | [[CNMT#Content_Meta_Records|Content Meta Record]] |
− | |||
− | |||
− | |||
− | | | ||
|- | |- | ||
| 0xC | | 0xC | ||
− | | | + | | 0x1 |
− | | | + | | [[NCM_services#Title_Types|Meta Type]] |
|- | |- | ||
| 0xD | | 0xD | ||
− | | | + | | 0x1 |
− | | Unused | + | | Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) |
+ | |- | ||
+ | | 0xE | ||
+ | | 0x2 | ||
+ | | Unused | ||
|- | |- | ||
| 0x10 | | 0x10 | ||
− | | | + | | 0x20 |
− | | | + | | Digest |
|- | |- | ||
| 0x30 | | 0x30 | ||
− | | | + | | 0x2 |
− | | | + | | Content Info Count |
|- | |- | ||
| 0x32 | | 0x32 | ||
− | | | + | | 0x6 |
− | | Unused | + | | Unused |
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
− | + | === Delta History === | |
− | |||
− | == | ||
− | |||
− | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 305: | Line 356: | ||
|- | |- | ||
| 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 |
− | | Unused | + | | Unused |
− | |||
|} | |} | ||
− | + | === Delta Header === | |
− | |||
− | == Delta | ||
− | |||
− | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 343: | Line 389: | ||
|- | |- | ||
| 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 | ||
+ | | Unused | ||
|- | |- | ||
| 0x20 | | 0x20 | ||
− | | | + | | 0x2 |
− | | | + | | Content Info Count |
|- | |- | ||
+ | | 0x22 | ||
+ | | 0x6 | ||
+ | | Unused | ||
|} | |} | ||
− | + | === Fragment Set === | |
− | |||
− | == | ||
− | |||
− | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
Line 381: | Line 430: | ||
|- | |- | ||
| 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 ( | + | | 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 |
− | | Unused | + | | Unused |
− | |||
|} | |} | ||
− | + | === 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 431: | Line 488: | ||
|- | |- | ||
| 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 |
− | | | + | | Unused |
|- | |- | ||
− | | | + | | 0x20 |
− | | | + | | 0x34 * Fragment Set Count |
− | | | + | | [[CNMT#Fragment_Set|Fragment Sets]] |
|- | |- | ||
+ | | | ||
+ | | 0x4 * Fragment Indicator Count (Fragment Set) | ||
+ | | [[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 17:09, 22 May 2019
This is the metadata file that ends in ".cnmt{.nca}"
or "meta0.ncd"
. This seems to replace the TMD format.
There's at least 9 different filenames used for ".cnmt":
- "Application_{lower-case hex titleID}.cnmt"
- "Patch_{lower-case hex titleID}.cnmt"
- "AddOnContent_{lower-case hex titleID}.cnmt"
- "SystemUpdate_{hex titleID}.cnmt"
- "SystemData_{lower-case hex titleID}.cnmt"
- "SystemProgram_{lower-case hex titleID}.cnmt"
- "BootImagePackage_{lower-case hex titleID}.cnmt"
- "BootImagePackageSafe_{lower-case hex titleID}.cnmt"
- "Delta_{lower-case hex titleID}.cnmt"
Header
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Title ID |
0x8 | 0x4 | Version |
0xC | 0x1 | Meta Type |
0xD | 0x1 | Unused |
0xE | 0x2 | Extended Header Size |
0x10 | 0x2 | Content Count |
0x12 | 0x2 | Content Meta Count |
0x14 | 0x1 | Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) |
0x15 | 0x3 | Unused |
0x18 | 0x4 | Required Download System Version |
0x1C | 0x4 | Unused |
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 | Unused |
Patch Extended Header
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Application ID |
0x8 | 0x4 | Required System Version |
0xC | 0x4 | Extended Data Size |
0x10 | 0x8 | Unused |
AddOnContent Extended Header
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Application ID |
0x8 | 0x4 | Required Application Version |
0xC | 0x4 | Unused |
Delta Extended Header
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Application ID |
0x8 | 0x4 | Extended Data Size |
0xC | 0x4 | Unused |
Content Records
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 Records
Offset | Size | Description |
---|---|---|
0x0 | 0x8 | Title ID |
0x8 | 0x4 | Version |
0xC | 0x1 | Meta Type |
0xD | 0x1 | Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) |
0xE | 0x2 | Unused |
This is used for SystemUpdate, see here: NCM_services#ReadEntryMetaRecords.
SystemUpdate Extended Data
Offset | Size | Description |
---|---|---|
0x0 | 0x4 | Version |
0x4 | 0x4 | Variation Count |
0x8 | 0x4 | Firmware Variation |
0xC | 0x1C * Variation Count | Unused |
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 | Unused |
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 Records (Content Records without the Hash entry) | |
0x38 * Delta Content Count | Delta Content Records | |
0x4 * Fragment Indicator Count (Fragment Set) | Fragment Indicators |
History Header
Offset | Size | Description |
---|---|---|
0x0 | 0x10 | Content Meta Record |
0xC | 0x1 | Meta Type |
0xD | 0x1 | Attributes (0=None, 1=IncludesExFatDriver, 2=Rebootless) |
0xE | 0x2 | Unused |
0x10 | 0x20 | Digest |
0x30 | 0x2 | Content Info Count |
0x32 | 0x6 | Unused |
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 | Unused |
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 | Unused |
0x20 | 0x2 | Content Info Count |
0x22 | 0x6 | Unused |
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 | 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 | Unused |
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 | Unused |
0x20 | 0x34 * Fragment Set Count | Fragment Sets |
0x4 * Fragment Indicator Count (Fragment Set) | Fragment Indicators |
Digest
Always found at the end of the file.
Offset | Size | Description |
---|---|---|
0x0 | 0x20 | Digest |