Difference between revisions of "SD Filesystem"

From 3dbrew
Jump to navigation Jump to search
(A bit of info about the private folder on the root of the SD card, it needs more research though...)
(87 intermediate revisions by 15 users not shown)
Line 1: Line 1:
The 3DS uses an SD Card for general storage of additional game data and photos taken with the 3DS.
+
== Overview ==
 +
The 3DS uses an SD Card for general storage of game data, music, photos and videos taken with the 3DS.
  
  /DCIM - Photos
+
  sdmc
  /Nintendo 3DS - Game Data
+
├── DCIM
 +
  ├── Nintendo 3DS
 +
│  ├── <ID0>
 +
│  │  └── <ID1>
 +
│  │      ├── [[SD Savedata Backups|backups]]
 +
│  │      ├── [[Title Database|dbs]]
 +
│  │      ├── [[extdata]]
 +
│  │      ├── [[Title Data Structure|title]]
 +
│  │      └── [[DSiWare_Exports|Nintendo DSiWare]]
 +
│  └── [[SD Filesystem#Private|Private]]
 +
└── [[SD Filesystem#Other Private Data|private]]
 +
    └── Nintendo 3DS
 +
        └── app
  
Additional game data is stored here:
 
  
/Nintendo 3DS/<SomeID>/<SomeID>/extdata/00000000
+
* Everything stored under sdmc/Nintendo 3DS/<ID0>/<ID1> is encrypted with console-unique [[AES|keyslots]], files stored under [[Flash Filesystem|nand/data/<ID0>]] only use these keyslots for MACs. All CTR files under these directories use the keyslots initialized by [[nand/private/movable.sed]].
 +
* ID0 is the first 0x10-bytes from a SHA256 [[nand/private/movable.sed|hash]].
 +
* ID1 is the scrambled SD card CID from the SD card which this directory was originally created on. To generate this directory name from the original CID, first the CID is rotated 8-bits to the left. Then, each u16 is moved as described in the below table:
  
  0000033c - Super Streetfighter IV 3D - EUR
+
{| class="wikitable" border="1"
  0000034d - Samurai Warriors Chronicles - USA
+
|-
  0000033b - Ridge Racer 3D - EUR
+
! Input rotated CID u16 index
  00000358 - Ridge Racer 3D - USA
+
!  Output CID u16 index
  0000022d - Face Raiders - EUR
+
|-
  00000227 - Mii Plaza - EUR
+
|  6
  0000020d - 顔シューティング - JPN
+
|  0
  00000207 - すれちがいMii広場 - JPN
+
|-
All "extra data" under extdata is encrypted. Although these files use 0xFF blocks similar to EEPROM [[Savegames|saves]], extdata can't be decrypted with the xorpad fail like EEPROM saves. All "extra data" files can't be copied to other 3DS SD cards, they are locked to the console.
+
| 7
 +
|  1
 +
|-
 +
|  4
 +
|  2
 +
|-
 +
| 5
 +
|  3
 +
|-
 +
|  2
 +
|  4
 +
|-
 +
| 3
 +
|  5
 +
|-
 +
| 0
 +
| 6
 +
|-
 +
| 1
 +
| 7
 +
|}
  
"Private" data is stored here:
+
'''DCIM''' - Photos and Videos taken by the [[Nintendo 3DS Camera]] application are stored in this directory. Internet Browser image downloads are stored here too.
 +
 
 +
Note: Playing/Recording (3D) Videos was introduced with update [[3.0.0-5]]. The 3D videos are in .avi format and the video frames use MJPG.
 +
 
 +
'''backups''' - This directory contains SD Title Savedata backups. For more info, see [[SD Savedata Backups]].
 +
 
 +
'''dbs''' - This contains database files relating to the titles installed on the SD Card. These files are encrypted. For more info, see [[Title Database]]
 +
 
 +
'''title''' - Title data for titles installed to the SD Card are found here. All data in this directory is encrypted with a console-unique [[AES|keyslot]]. For a list of SD Card titles see the [[Title list]]. For more info on the title data structure see [[Title Data Structure]].
 +
 
 +
'''Nintendo DSiWare''' - DSiWare titles are [[DSiWare_Exports|exported]] here.
 +
 
 +
== Private ==
 +
"Private" data is stored here as cleartext:
  
 
  /Nintendo 3DS/Private/<Title ID Low>/
 
  /Nintendo 3DS/Private/<Title ID Low>/
   
+
 
 +
  00020400 - Nintendo 3DS Camera
 
  00020500 - Nintendo 3DS Sound
 
  00020500 - Nintendo 3DS Sound
00020400 - Nintendo 3DS Camera
 
  
"Private" data for 3DS Sound/Camera are cleartext.
+
Under the camera private dir is [[phtcache.bin]].
Under the camera priv dir is [[phtcache.bin]], this seems to list the pictures on SD card?
+
When you want to install and see pictures with 3DS, rename to 8 numbers.mpo and save it on /DCIM.
Under the sound priv dir is: voice/XX/*.m4a. Where XX is 01-10, with sound saved as .m4a.
+
Under the sound private dir is: voice/XX/*.m4a. Where XX is 01-10, with sound saved as .m4a.
 +
 
 +
== Other Private Data ==
 +
 
 +
There is also a directory called "private" on the root of the SD card that contains data, in which would otherwise be completely different from what the Nintendo 3DS normally uses, but known to the application itself.
 +
 
 +
Some apps, such as Flipnote Studio 3D create a directory called "private" on the root of the SD Card, it contains a Nintendo 3DS directory inside it. Inside the app directory contains a directory with the game code of the application (eg. "JKZP" for Flipnote Studio 3D), then its corresponding data, as shown here:
 +
 
 +
/private/Nintendo 3DS/app/<Game Code>/
 +
 
 +
In this case of Flipnote Studio 3D, there are multiple files with an ID, then ending with the .kwz extension. There is also a !!.lst file as well.

Revision as of 23:56, 11 August 2017

Overview

The 3DS uses an SD Card for general storage of game data, music, photos and videos taken with the 3DS.

sdmc
├── DCIM
├── Nintendo 3DS
│   ├── <ID0>
│   │   └── <ID1>
│   │       ├── backups
│   │       ├── dbs
│   │       ├── extdata
│   │       ├── title
│   │       └── Nintendo DSiWare
│   └── Private
└── private
    └── Nintendo 3DS
        └── app


  • Everything stored under sdmc/Nintendo 3DS/<ID0>/<ID1> is encrypted with console-unique keyslots, files stored under nand/data/<ID0> only use these keyslots for MACs. All CTR files under these directories use the keyslots initialized by nand/private/movable.sed.
  • ID0 is the first 0x10-bytes from a SHA256 hash.
  • ID1 is the scrambled SD card CID from the SD card which this directory was originally created on. To generate this directory name from the original CID, first the CID is rotated 8-bits to the left. Then, each u16 is moved as described in the below table:
Input rotated CID u16 index Output CID u16 index
6 0
7 1
4 2
5 3
2 4
3 5
0 6
1 7

DCIM - Photos and Videos taken by the Nintendo 3DS Camera application are stored in this directory. Internet Browser image downloads are stored here too.

Note: Playing/Recording (3D) Videos was introduced with update 3.0.0-5. The 3D videos are in .avi format and the video frames use MJPG.

backups - This directory contains SD Title Savedata backups. For more info, see SD Savedata Backups.

dbs - This contains database files relating to the titles installed on the SD Card. These files are encrypted. For more info, see Title Database

title - Title data for titles installed to the SD Card are found here. All data in this directory is encrypted with a console-unique keyslot. For a list of SD Card titles see the Title list. For more info on the title data structure see Title Data Structure.

Nintendo DSiWare - DSiWare titles are exported here.

Private

"Private" data is stored here as cleartext:

/Nintendo 3DS/Private/<Title ID Low>/
00020400 - Nintendo 3DS Camera 
00020500 - Nintendo 3DS Sound

Under the camera private dir is phtcache.bin. When you want to install and see pictures with 3DS, rename to 8 numbers.mpo and save it on /DCIM. Under the sound private dir is: voice/XX/*.m4a. Where XX is 01-10, with sound saved as .m4a.

Other Private Data

There is also a directory called "private" on the root of the SD card that contains data, in which would otherwise be completely different from what the Nintendo 3DS normally uses, but known to the application itself.

Some apps, such as Flipnote Studio 3D create a directory called "private" on the root of the SD Card, it contains a Nintendo 3DS directory inside it. Inside the app directory contains a directory with the game code of the application (eg. "JKZP" for Flipnote Studio 3D), then its corresponding data, as shown here:

/private/Nintendo 3DS/app/<Game Code>/

In this case of Flipnote Studio 3D, there are multiple files with an ID, then ending with the .kwz extension. There is also a !!.lst file as well.