Changes

Jump to navigation Jump to search
587 bytes added ,  03:34, 7 June 2019
→‎Data Structure: add more cmd format details
Line 236: Line 236:  
"'''<ContentID>.cmd'''" - (The Content ID is a u32, initially: '''00000001''' when the title is first installed. Changing by an increment of +'''0x1''' for each time the 3DS adds/removes '.app' files) This file contains data taken from the title's [[TMD]]. See the below table for the format of the cleartext .cmd file. The [[Title Database|Title.db]] contains the Content ID for the '.cmd' file, but does not contain a hash of the '.cmd' file. In addition it is also encrypted with a console-unique [[AES|keyslot]]. This acts as part of the DRM for installed titles, along with the [[Title Database|title.db]].
 
"'''<ContentID>.cmd'''" - (The Content ID is a u32, initially: '''00000001''' when the title is first installed. Changing by an increment of +'''0x1''' for each time the 3DS adds/removes '.app' files) This file contains data taken from the title's [[TMD]]. See the below table for the format of the cleartext .cmd file. The [[Title Database|Title.db]] contains the Content ID for the '.cmd' file, but does not contain a hash of the '.cmd' file. In addition it is also encrypted with a console-unique [[AES|keyslot]]. This acts as part of the DRM for installed titles, along with the [[Title Database|title.db]].
   −
The below AES-MACs(including the last 0x10-bytes of the header) are only used for SD titles, and for NAND [[Title_list|download-play]] titles. For other titles, these MACs are set to all-zero.
+
The below AES-CMACs(including the last 0x10-bytes of the header) are only used for SD titles, for NAND [[Title_list|download-play]] titles, and non-system DSiWare titles. For other titles, these MACs are set to all-zero.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 250: Line 250:  
| 0x4
 
| 0x4
 
| 0x4
 
| 0x4
| Number of entries? Usually the same as the following u32.
+
| Number of AES-CMACs and Content IDs in the first list. The method to determine this is explained below.
 
|-
 
|-
 
| 0x8
 
| 0x8
 
| 0x4
 
| 0x4
| Number of AESMACs? Usually the same as the preceding u32.
+
| Number of Content IDs in the second list
 
|-
 
|-
 
| 0xC
 
| 0xC
Line 262: Line 262:  
| 0x10
 
| 0x10
 
| 0x10
 
| 0x10
| AESMAC over contents?
+
| AES-CMAC over first 0x10
 
|-
 
|-
 
| 0x20
 
| 0x20
| 0x4*(No. of entries)
+
| 0x4 * (No. of entries)
| List of contentIDs in (usually) descending order
+
| List of installed Content IDs in order of Content Index, with missing contents replaced with 0xFFFFFFFF
 
|-
 
|-
| 0x20 + 0x4*(No. of entries)
+
| 0x20 + 0x4 * (No. of entries)
| 0x4*(No. of entries)
+
| 0x4 * (No. of entries)
| List of contentIDs in (usually) ascending order
+
| List of installed Content IDs in order of ID name
 
|-
 
|-
| 0x20+0x8*(No. of entries)
+
| 0x20 + 0x8 * (No. of entries)
| 0x10*(No. of entries)
+
| 0x10 * (No. of entries)
| These are AESMACs, one for each content.
+
| AES-CMACs for each content in the first list, generated using the process below
 
|}
 
|}
   −
Entries format:
+
The number of AES-CMACs depends on the highest Content Index installed. For example, a title with 5 contents, but only 1 and 3 are installed, will still result in 3 AES-CMACs, with the 2nd one being unused.
{| class="wikitable" border="1"
+
 
|-
+
For SD contents, each AES-CMAC is generated by combining the NCCH header without the signature (0x100-0x1FF), the Content Index and Content ID at the end, both as u32. Then calculate the SHA256 of the data and generate the AES-CMAC using the [[AES Registers#Keyslots|SD/NAND AES-CMAC key]].
!  Start
+
 
!  Size
+
For TWLNAND contents, the process is currently unknown.
!  Description
+
 
|-
  −
| 0x0
  −
| 0x4
  −
| ContentID
  −
|-
  −
| 0x4
  −
| 0x8
  −
| Unknown
  −
|}
      
'''"00000001.sav"''' - This is the title's encrypted [[Savegames|savegame]]. Renaming these savegames causes home-menu to hang while launching titles, modifying these saves results in the same corruption errors as other savegames.
 
'''"00000001.sav"''' - This is the title's encrypted [[Savegames|savegame]]. Renaming these savegames causes home-menu to hang while launching titles, modifying these saves results in the same corruption errors as other savegames.
46

edits

Navigation menu