Changes

Jump to navigation Jump to search
766 bytes added ,  12:07, 4 May 2017
no edit summary
Line 1: Line 1: −
The Nintendo 3DS utilizes a similar title-based organization as seen in the Wii and DSi platforms. The update server is located  [http://nus.cdn.c.shop.nintendowifi.net/ccs/download/ here]. When using SSL, the update/shop servers must be accessed via SSLv3.
+
The Nintendo 3DS utilizes a similar title-based organization as seen in the Wii and DSi platforms. The update server is located  [http://nus.cdn.c.shop.nintendowifi.net/ccs/download/ here].
    +
For a list of 3DS titles see the [[Title list]].                         
 +
                   
 
= Title IDs =
 
= Title IDs =
   Line 88: Line 90:  
|-  
 
|-  
 
|  Evaluation
 
|  Evaluation
|  0xF8000 -0xFFFFF
+
|  0xF8000 - 0xFEFFF (?)
 
|-  
 
|-  
 
|  Prototype*
 
|  Prototype*
 
|  0xFF000 - 0xFF3FF
 
|  0xFF000 - 0xFF3FF
 +
|-
 +
|  Developer
 +
|  0xFF400 - 0xFF7FF (?)
 
|}
 
|}
 
<nowiki>*</nowiki>On the home menu, titles with UIDs within the 'Prototype' range, appear on the home menu after install without the gift fanfare.
 
<nowiki>*</nowiki>On the home menu, titles with UIDs within the 'Prototype' range, appear on the home menu after install without the gift fanfare.
Line 135: Line 140:  
Titles are installed to either the NAND (System and Application) or to the SD Card (Application only), and their respective directory locations are:
 
Titles are installed to either the NAND (System and Application) or to the SD Card (Application only), and their respective directory locations are:
   −
'''[[Flash Filesystem|NAND]]:'''
+
{| class="wikitable" border="1" style="margin: auto;"
* nand/title - Title Data
+
|-
* nand/data/<ID0>/sysdata - Save Data
+
|
 +
! scope="col"| [[Flash Filesystem|NAND]]
 +
! scope="col"| [[SD Filesystem|SD]]
 +
|-
 +
! scope="row"| Title Data
 +
| nand/title
 +
| rowspan="2" | sdmc/Nintendo 3DS/<ID0>/<ID1>/title
 +
|-
 +
! scope="row"| Save Data
 +
| nand/data/<ID0>/sysdata
 +
|-
 +
|}
   −
'''[[SD Filesystem|SD Card]]:'''
+
ID0 is the first 0x10-bytes from a SHA256 [[nand/private/movable.sed|hash]] and ID1 is generated from the SD card CID.
* sdmc/Nintendo 3DS/<ID0>/<ID1>/title - Title Data/Save Data
     −
ID0 is the first 0x10-bytes from a SHA256 [[nand/private/movable.sed|hash]].
+
Title data stored on the SD Card is encrypted with the console-unique [[nand/private/movable.sed|keyslots]], whereas NAND title data is stored as cleartext.
 
  −
Title data stored on the SD Card is encrypted with the console-unique [[nand/private/movable.sed|keyslots]], however the NAND title data is stored as cleartext.
      
The base CTR for files stored under /title is likely based on the /title path, similar to extdata. This base CTR is unique per titleID and filename. The base CTR never changes after creation of each file.
 
The base CTR for files stored under /title is likely based on the /title path, similar to extdata. This base CTR is unique per titleID and filename. The base CTR never changes after creation of each file.
Line 150: Line 163:  
When a newer version of a title is installed, the new .app content, .tmd, and .cmd(and .ctx for NAND titles) are written to the /title directory, however the old files here are not yet deleted. Once installation of the title is [[AMNet:InstallTitlesFinish|finalized]], the info from [[Title_Database|import.db]] is moved to [[Title_Database|title.db]] so that the system uses the newer files instead, then the old /title files are deleted.
 
When a newer version of a title is installed, the new .app content, .tmd, and .cmd(and .ctx for NAND titles) are written to the /title directory, however the old files here are not yet deleted. Once installation of the title is [[AMNet:InstallTitlesFinish|finalized]], the info from [[Title_Database|import.db]] is moved to [[Title_Database|title.db]] so that the system uses the newer files instead, then the old /title files are deleted.
   −
And the title data is contained in this directory structure:
+
The title data is contained in this directory structure (note that [[Title list#0004008C - Add-on Content (DLC)|DLC]] titles are stored in a different way):
   −
'''NAND Directory Structure''':
+
{| class="wikitable" border="1" style="margin: auto;"
Title Data:
+
!
+
! scope="col"| NAND
 +
! scope="col"| SD (non-DLC)
 +
! scope="col"| SD (DLC)
 +
|-
 +
! scope="row"| Title Data:
 +
|
 
  <Title ID High>
 
  <Title ID High>
 
  └── <Title ID Low>
 
  └── <Title ID Low>
Line 163: Line 181:  
         └── cmd
 
         └── cmd
 
             └── <ContentID>.cmd
 
             └── <ContentID>.cmd
+
| rowspan="2" |
Save Data:
  −
  −
<SaveID0>
  −
└── <SaveID1>
  −
    └── 00000001.sav
  −
 
  −
'''SD Card Directory Structure''':
  −
Title Data/Save Data:
  −
   
  <Title ID High>
 
  <Title ID High>
 
  └── <Title ID Low>
 
  └── <Title ID Low>
Line 183: Line 192:  
     └── data
 
     └── data
 
         └── 00000001.sav
 
         └── 00000001.sav
 
+
| rowspan="2" |
The structure differs for [[Title list#0004008C - Add-on Content (DLC)|DLC]] Titles:
  −
 
   
  0004008C
 
  0004008C
 
  └── <Title ID Low>
 
  └── <Title ID Low>
Line 195: Line 202:  
         └── cmd
 
         └── cmd
 
             └── <ContentID>.cmd
 
             └── <ContentID>.cmd
   
+
 
For a list of 3DS titles see the [[Title list]].                          
+
|-
                   
+
! scope="row"|  Save Data:
"'''<ContentID>.tmd'''" - (The Content ID is a u32, initially: '''00000000''' when the title is first installed. Changing by an increment of +'''0x1''' for each title update the 3DS installs) This is the Title Metadata associated with the title, it is encrypted with a console-unique [[AES|keyslot]]. The decrypted TMD is available on Nintendo's CDN server at "http://nus.cdn.c.shop.nintendowifi.net/ccs/download/TitleIDhere/tmd". Though CDN version of the title TMD has a certificate chain attached at the end of the TMD, so removing it will give you the 1:1 decrypted TMD. After installation the "<ContentID>.tmd" is redundant, because important title data is extracted and imported into the [[Title Database|title.db]] and ".cmd" files, but is however kept as a reference.
+
|
 +
<SaveID0>
 +
└── <SaveID1>
 +
    └── 00000001.sav
 +
|}
 +
 
 +
"'''<ContentID>.tmd'''" - (The Content ID is a u32, initially: '''00000000''' when the title is first installed. Changing by an increment of +'''0x1''' for each title update the 3DS installs) This is the [[Title metadata]] associated with the title, it is encrypted with a console-unique [[AES|keyslot]]. The decrypted TMD is available on Nintendo's CDN server at "http://nus.cdn.c.shop.nintendowifi.net/ccs/download/TitleIDhere/tmd.OptionallyTitleVersionHere". Though CDN version of the title TMD has a certificate chain attached at the end of the TMD, so removing it will give you the 1:1 decrypted TMD. After installation the "<ContentID>.tmd" is redundant, because important title data is extracted and imported into the [[Title Database|title.db]] and ".cmd" files, but is however kept as a reference.
      −
"'''<ContentID>.app'''" - (The Content ID is a u32, taken from the title's [[TMD]]) These files are [[NCCH]] files, where the entire file is encrypted with a console-unique [[AES|keyslot]](this is on top of the encryption of the NCCH contents). There can be more than one NCCH in this directory, as seen with .[[CCI]] files, the game executable ([[CXI]]) can be accompanied with additional non-executable NCCH files ([[NCCH#CFA|CFA]]) such as the electronic manual and DLP Child containers. Determining the function of the encrypted NCCH, is done by finding the Content Index of the "XXXXXXXX.app" file in the title's TMD(see above for retrieving decrypted TMD), interpreting the Content Index is as follows*:
+
"'''<ContentID>.app'''" - (The Content ID is a u32, taken from the title's [[TMD]]) These files are [[NCCH]] files, where the entire file is encrypted with a console-unique [[AES|keyslot]](this is on top of the encryption of the NCCH contents). There can be more than one NCCH in this directory, as seen with .[[CCI]] files, the game executable ([[CXI]]) can be accompanied with additional non-executable NCCH files ([[NCCH#CFA|CFA]]) such as the electronic manual and DLP Child containers. Determining the function of the encrypted NCCH, is done by finding the Content Index of the "XXXXXXXX.app" file in the title's TMD(see above for retrieving decrypted TMD), interpreting the Content Index is as follows (does not apply to DLC content):
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 217: Line 230:  
|  DLP Child Container (.[[NCCH#CFA|CFA]])
 
|  DLP Child Container (.[[NCCH#CFA|CFA]])
 
|}
 
|}
*The above table does not apply to DLC content.
      
Unlike the TMD, a decrypted version of the NCCH files cannot be retrieved from Nintendo's CDN, the NCCH files do exist on Nintendo's CDN but are [[AES|encrypted]]. Decrypting CDN versions of content, requires the title's [[CommonETicket|ticket]], and the common key specified by an index in the  [[CommonETicket|ticket]]. Of course editing/deleting ".app" files will have an effect. Deleting/renaming the manual ".app' will cause the manual not to load when clicked on. And deleting/renaming the executable ".app" will cause the application to not load, and the 3D Banner does not show(The banner is loaded each time from the game's executable NCCH when the home menu loads, it is not cached like the icon and name).
 
Unlike the TMD, a decrypted version of the NCCH files cannot be retrieved from Nintendo's CDN, the NCCH files do exist on Nintendo's CDN but are [[AES|encrypted]]. Decrypting CDN versions of content, requires the title's [[CommonETicket|ticket]], and the common key specified by an index in the  [[CommonETicket|ticket]]. Of course editing/deleting ".app" files will have an effect. Deleting/renaming the manual ".app' will cause the manual not to load when clicked on. And deleting/renaming the executable ".app" will cause the application to not load, and the 3D Banner does not show(The banner is loaded each time from the game's executable NCCH when the home menu loads, it is not cached like the icon and name).
Line 237: Line 249:  
|-
 
|-
 
| 0x4
 
| 0x4
| 0x1C
+
| 0x4
| For NAND titles' .cmd these 2 words are usually value 1, the rest of the header is all-zero. The last 0x10-bytes of this header is an AES MAC?
+
| Number of entries? Usually the same as the following u32.
 +
|-
 +
| 0x8
 +
| 0x4
 +
| Number of AESMACs? Usually the same as the preceding u32.
 +
|-
 +
| 0xC
 +
| 0x4
 +
| Unknown, usually (always?) 1.
 +
|-
 +
| 0x10
 +
| 0x10
 +
| AESMAC over contents?
 
|-
 
|-
 
| 0x20
 
| 0x20
| 0x8*(No. of entries)
+
| 0x4*(No. of entries)
| Entries for each content begin here with size 0x8.
+
| List of contentIDs in (usually) descending order
 +
|-
 +
| 0x20 + 0x4*(No. of entries)
 +
| 0x4*(No. of entries)
 +
| List of contentIDs in (usually) ascending order
 
|-
 
|-
 
| 0x20+0x8*(No. of entries)
 
| 0x20+0x8*(No. of entries)
 
| 0x10*(No. of entries)
 
| 0x10*(No. of entries)
| These are MACs, one for each content.
+
| These are AESMACs, one for each content.
 
|}
 
|}
   Line 273: Line 301:  
=== DLC Titles ===
 
=== DLC Titles ===
   −
DLC titles have a different directory structure to most installed titles. This is because all DLC content for a given title is installed under the same Title ID, but DLC add-ons are usually separate purchases, hense the structure altered so any combination of DLC content can be installed. DLC titles can receive 'updates', this is usually in the form of more DLC content and/or DLC bug fixes. Individual DLC content can only be managed from with-in the application using the DLC.
+
DLC titles have a different directory structure to most installed titles. This is because all DLC content for a given title is installed under the same Title ID, but DLC add-ons are usually separate purchases, hence the structure altered so any combination of DLC content can be installed. DLC titles can receive 'updates', this is usually in the form of more DLC content and/or DLC bug fixes. Individual DLC content can only be managed from with-in the application using the DLC.
    
'''"00000000"''' - This extra directory only found in DLC titles, contains the DLC [[NCCH]] content.
 
'''"00000000"''' - This extra directory only found in DLC titles, contains the DLC [[NCCH]] content.
Line 281: Line 309:       −
"'''<ContentID>.cmd'''" - This contains entries for all '''installed''' DLC [[NCCH]] content, and is updated(<ContentID> will change) every time DLC content is installed/removed.
+
"'''<ContentID>.cmd'''" - This contains entries for all '''installed''' DLC [[NCCH]] content, and is updated (<ContentID> will change) every time DLC content is installed/removed.
 +
 
 +
=Installing other-model system-titles=
 +
When finalizing title-install of already downloaded Old3DS system-titles to a New3DS NAND image with New3DS NATIVE_FIRM, the end result is that the New3DS version (TID-low bitmask 0x20000000) of those titles gets deleted.
 +
 
 +
It's unknown where this behaviour is implemented (might be NIM, AM, or AMXPXI).
166

edits

Navigation menu