CNMT: Difference between revisions

Liam (talk | contribs)
Update header and extended header - next is extended data
Liam (talk | contribs)
Update all of Patch Extended Data and add SystemUpdate extended data
Line 25: Line 25:
| 0x8
| 0x8
| 0x4
| 0x4
| [[Title_list|Version]]
| Version
|-
|-
| 0xC
| 0xC
Line 73: Line 73:
| 0x0
| 0x0
| 0x4
| 0x4
| Extended Header Size
| Extended Data Size
|}
|}


Line 156: Line 156:
|}
|}


== Content records ==
== Content Records ==


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 185: Line 185:
|}
|}


== Meta records ==
== Content Meta Records ==


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 216: Line 216:
This is used for SystemUpdate, see here: [[NCM_services#ReadEntryMetaRecords]].
This is used for SystemUpdate, see here: [[NCM_services#ReadEntryMetaRecords]].


== Extended data ==
== SystemUpdate Extended Data ==
 
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0
| 0x4
| Version
|-
| 0x4
| 0x4
| Variation Count
|-
| 0x8
| 0x4
| Firmware Variation
|-
| 0xC
| 0x1C * Variation Count
| Unused
|}


Patch-type cnmt files include an extended data section.
== Patch Extended Data ==


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 227: Line 250:
|-
|-
| 0x0
| 0x0
| 4
| 0x4
| Number of previous cnmt entries.
| History Count
|-
|-
| 0x4
| 0x4
| 4
| 0x4
| Number of previous delta entries.
| Delta History Count
|-
|-
| 0x8
| 0x8
| 4
| 0x4
| Number of delta info entries.
| Delta Count
|-
|-
| 0xC
| 0xC
| 4
| 0x4
| Number of delta application info entries.
| Fragment Set Count
|-
|-
| 0x10
| 0x10
| 4
| 0x4
| Number of previous content entries.
| History Content Count
|-
|-
| 0x14
| 0x14
| 4
| 0x4
| Number of delta content entries.
| Delta Content Count
|-
|-
| 0x18
| 0x18
| 4
| 0x4
| Unused?
| Unused
|-
|-
| 0x1C
| 0x1C
| 0x38*X
| 0x38 * History Count
| Previous cnmt entries
| History Headers
|-
|
| 0x28*X
| Previous delta entries
|-
|
| 0x28*X
| Delta info entries
|-
|
| 0x34*X
| Delta application info entries
|-
|-
|  
|  
| 0x18*X
| 0x28 * Delta History Count
| Previous content entries
| Delta Histories
|-
|-
|  
|  
| 0x38*X
| 0x28 * Delta Count
| Delta content entries. (Standard content records)
| Delta Headers
|-
|-
|  
|  
| 4
| 0x34 * Fragment Set Count
| Unknown
| Fragment Sets
|-
|-
|  
|  
| 4
| 0x18 * History Content Count
| Unknown
| History Content Records (Content Records without the Hash entry)
|-
|-
|  
|  
| 4
| 0x38 * Delta Content Count
| Unknown
| Delta Content Records
|-
|}
|}


== Previous cnmt records ==
=== History Header ===
 
Each entry is 0x38 bytes:


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 303: Line 311:
|-
|-
| 0x0
| 0x0
| 8
| 0x8
| Title ID
| Title ID
|-
|-
| 0x8
| 0x8
| 4
| 0x4
| Title version
| Version
|-
|-
| 0xC
| 0xC
| 1
| 0x1
| Type (see [[NCM_services#Title_Types|Title Types]])
| [[NCM_services#Title_Types|Title Types]]
|-
|-
| 0xD
| 0xD
| 3
| 0x1
| Unused?
| Attributes
|-
| 0xE
| 0x2
| Unused
|-
|-
| 0x10
| 0x10
| 32
| 0x20
| Hash
| Digest
|-
|-
| 0x30
| 0x30
| 2
| 0x2
| Unknown
| Content Info Count
|-
|-
| 0x32
| 0x32
| 2
| 0x6
| Unused?
| Unused
|-
| 0x34
| 4
| Unused?
|-
|}
|}


This contains information on previous metadata files.
=== Delta History ===
 
== Previous delta records ==
 
Each entry is 0x28 bytes:


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 349: Line 352:
|-
|-
| 0x0
| 0x0
| 8
| 0x8
| Old title ID
| Source Title ID
|-
|-
| 0x8
| 0x8
| 8
| 0x8
| New title ID
| Destination Title ID
|-
|-
| 0x10
| 0x10
| 4
| 0x4
| Old title version
| Source Version
|-
|-
| 0x14
| 0x14
| 4
| 0x4
| New title version
| Destination Version
|-
|-
| 0x18
| 0x18
| 8
| 0x8
| Size
| Download Size
|-
|-
| 0x20
| 0x20
| 8
| 0x8
| Unused?
| Unused
|-
|}
|}


This contains information on previous delta patches.
=== Delta Header ===
 
== Delta info records ==
 
Each entry is 0x28 bytes:


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 387: Line 385:
|-
|-
| 0x0
| 0x0
| 8
| 0x8
| Old title ID
| Source Title ID
|-
|-
| 0x8
| 0x8
| 8
| 8
| New title ID
| Destination Title ID
|-
|-
| 0x10
| 0x10
| 4
| 0x4
| Old title version
| Source Version
|-
|-
| 0x14
| 0x14
| 4
| 0x4
| New title version
| Destination Version
|-
|-
| 0x18
| 0x18
| 8
| 0x2
| Some sort of index?
| Fragment Set Count
|-
| 0x1A
| 0x6
| Unused
|-
|-
| 0x20
| 0x20
| 8
| 0x2
| Some sort of index?
| Content Info Count
|-
|-
| 0x22
| 0x6
| Unused
|}
|}


This contains information on the current delta patch.
=== Fragment Set ===
 
== Delta application info records ==
 
Each entry is 0x34 bytes:


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 425: Line 426:
|-
|-
| 0x0
| 0x0
| 16
| 0x10
| Old NcaId
| Source Content ID
|-
|-
| 0x10
| 0x10
| 16
| 0x10
| New NcaId
| Destination Content ID
|-
|-
| 0x20
| 0x20
| 6
| 0x6
| Old size
| Source Size
|-
|-
| 0x26
| 0x26
| 2
| 0x6
| Upper 2 bytes of the new size
| Destination Size
|-
| 0x28
| 4
| Lower 4 bytes of the new size
|-
|-
| 0x2C
| 0x2C
| 2
| 0x2
| Unknown
| Fragment Indicator Count
|-
|-
| 0x2E
| 0x2E
| 1
| 0x1
| Type (see [[NCM_services#Title_Types|Title Types]])
| [[NCM_services#Title_Types|Title Types]]
|-
|-
| 0x2F
| 0x2F
| 1
| 0x1
| ? bit0 set = don't install?
| Update Type (0=ApplyAsDelta, 1=Overwrite, 2=Create)
|-
|-
| 0x30
| 0x30
| 4
| 0x4
| Unused?
| Unused
|-
|}
|}


This contains information on how to apply deltas to the previous patch.
=== Fragment Indicator ===
 
== Previous content records ==
 
Each entry is 0x18 bytes:


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 475: Line 467:
|-
|-
| 0x0
| 0x0
| 16
| 0x2
| NcaId
| Content Info Index
|-
| 0x10
| 6
| Size
|-
| 0x16
| 1
| Type (see [[NCM_services#Title_Types|Title Types]])
|-
| 0x17
| 1
|  
|-
|-
| 0x2
| 0x2
| Fragment Index
|}
|}
This contains information on previous title content from earlier patches.