Difference between revisions of "SD卡文件系统"
m (→title) |
|||
Line 1: | Line 1: | ||
− | + | == 概述 == | |
+ | 3DS使用SD卡存储游戏数据、音乐以及使用3DS拍摄的照片和视频 | ||
+ | |||
+ | SD卡 | ||
+ | ├── DCIM 目录 | ||
+ | └── Nintendo 3DS 目录 | ||
+ | ├── <ID0> | ||
+ | │ └── <ID1> | ||
+ | │ ├── [[Title Database|dbs]] | ||
+ | │ ├── [[extdata]] | ||
+ | │ ├── [[Title Data Structure|title]] | ||
+ | │ └── [[DSiWare_Exports|Nintendo DSiWare]] | ||
+ | └── [[SD Filesystem#Private|Private]] | ||
+ | |||
+ | * 存储在sdmc/Nintendo 3DS/<ID0>/<ID1>目录下的所有数据都是console-unique [[AES|keyslots]]加密的, 存储在 [[Flash Filesystem|nand/data/<ID0>]] 目录下的文件只用于MAC keyslots. 这些目录的CTR文件都使用 [[nand/private/movable.sed]] 初始化keyslots. | ||
+ | * ID0 是SHA256 [[nand/private/movable.sed|hash]] 的前 0x10-bytes from . | ||
+ | * 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: | ||
+ | |||
+ | |||
+ | |||
+ | {| class="wikitable" border="1" | ||
+ | |- | ||
+ | ! 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 - 照片及因特网浏览器(Internet Browser)下载的图像。 | /DCIM - 照片及因特网浏览器(Internet Browser)下载的图像。 | ||
Line 7: | Line 58: | ||
/DCIM 在[[3.0.0-5]]版本中也存储.avi格式的3D视频,视频框架为MJPG。 | /DCIM 在[[3.0.0-5]]版本中也存储.avi格式的3D视频,视频框架为MJPG。 | ||
(with [[3.0.0-5]] also stores .avi 3D videos from the camera title, video frames use MJPG.) | (with [[3.0.0-5]] also stores .avi 3D videos from the camera title, video frames use MJPG.) | ||
+ | |||
+ | |||
+ | '''DCIM''' - [[Nintendo 3DS Camera]]拍摄的相片和影片存储在这里. 网络浏览器下载的图像也存储在这里. | ||
+ | |||
+ | Note: 播放/录制 (3D)视频是在[[3.0.0-5]]系统新增的功能.3D视频是MJPG编码的avi格式的文件 | ||
+ | |||
+ | '''dbs''' - 包含安装于SD卡中title相关的数据库. 这些文件是加密的,详见[[Title Database]] | ||
+ | |||
+ | '''title''' - 安装于SD卡中的title.这个目录的所有数据是 [[AES|keyslot]] console-unique加密的. SD卡中的title列表可以在 [[Title list]] 查看. title数据结构的更多信息,请参阅 [[Title Data Structure]]. | ||
+ | |||
+ | '''Nintendo DSiWare''' - DSiWare titles 详见 [[DSiWare_Exports|exported]] . | ||
+ | |||
+ | |||
+ | |||
+ | |||
== Extdata == | == Extdata == | ||
Line 72: | Line 138: | ||
== Private == | == Private == | ||
− | "Private" | + | 保存在这里的"Private" 数据似乎是明文: |
/Nintendo 3DS/Private/<Title ID Low>/ | /Nintendo 3DS/Private/<Title ID Low>/ | ||
Line 80: | Line 146: | ||
− | + | camera private 目录是 [[phtcache.bin]]. | |
− | camera | + | 想在3DS放入并能查看到新图片的时候,重命名为8位数字的.mpo文件并保存到/DCIM目录下。 |
− | + | sound private 目录是 voice/XX/*.m4a. 这里的XX是01-10,存储为m4a文件. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 10:09, 4 May 2013
概述
3DS使用SD卡存储游戏数据、音乐以及使用3DS拍摄的照片和视频
SD卡
├── DCIM 目录 └── Nintendo 3DS 目录 ├── <ID0> │ └── <ID1> │ ├── dbs │ ├── extdata │ ├── title │ └── Nintendo DSiWare └── Private
- 存储在sdmc/Nintendo 3DS/<ID0>/<ID1>目录下的所有数据都是console-unique keyslots加密的, 存储在 nand/data/<ID0> 目录下的文件只用于MAC keyslots. 这些目录的CTR文件都使用 nand/private/movable.sed 初始化keyslots.
- ID0 是SHA256 hash 的前 0x10-bytes from .
- 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 - 照片及因特网浏览器(Internet Browser)下载的图像。 /Music - 音乐文件。 /Nintendo 3DS - 游戏数据。
/DCIM 在3.0.0-5版本中也存储.avi格式的3D视频,视频框架为MJPG。 (with 3.0.0-5 also stores .avi 3D videos from the camera title, video frames use MJPG.)
DCIM - Nintendo 3DS Camera拍摄的相片和影片存储在这里. 网络浏览器下载的图像也存储在这里.
Note: 播放/录制 (3D)视频是在3.0.0-5系统新增的功能.3D视频是MJPG编码的avi格式的文件
dbs - 包含安装于SD卡中title相关的数据库. 这些文件是加密的,详见Title Database
title - 安装于SD卡中的title.这个目录的所有数据是 keyslot console-unique加密的. SD卡中的title列表可以在 Title list 查看. title数据结构的更多信息,请参阅 Title Data Structure.
Nintendo DSiWare - DSiWare titles 详见 exported .
Extdata
附加的游戏数据储存在这里:
- /Nintendo 3DS/<SomeID>/<SomeID>/extdata/00000000
00000082 - eShop - JPN (Unconfirmed) 0000008f - Some 2.0.0-2 data, unknown doesn't appear in extdata management. 00000098 - eShop - EUR (Unconfirmed) 00000207 - Mii Maker - JPN 0000020d - Face Raiders - JPN 00000210 - Some 2.0.0-2 data, unknown doesn't appear in extdata management. 00000217 - Mii Maker - USA 00000219 - eShop USA 0000021d - Face Raiders - USA 00000227 - Mii Maker - EUR 0000022d - Face Raiders - EUR 0000030c - Nintendogs + Cats - EUR 00000326 - Pokédex 3D - EUR 0000032d - Super Street Fighter IV 3D - USA 0000033b - Ridge Racer 3D - EUR 0000033c - Super Street Fighter IV 3D - EUR 0000034d - Samurai Warriors Chronicles - USA 00000358 - Ridge Racer 3D - USA 0000038a - Dead or Alive Dimensions - EUR 00000481 - Monster Hunter Tri G (Download-Quests) - JPN 000004aa - Nintendo Video - USA 000004ab - Nintendo Video - EUR
所有extdata下的附加数据(extra data)都是加密的。尽管这些文件使用类似于闪存(FLASH)存档的0xFF区块,附加数据却不能用对待闪存存档的异或操作来解密。所有附加数据文件都不能被拷贝到别的3DS的SD卡上,它们被锁在3DS本体上。(straybirdsnest注:保存了一台3DS附加数据的SD卡直接(或者拷贝到另外的SD卡后)插入到另外一台3DS上无法被识别,猜测原文是指这个。)
(All "extra data" under extdata is encrypted. Although these files use 0xFF blocks similar to FLASH saves, extdata can't be decrypted with the xorpad fail like FLASH saves. All "extra data" files can't be copied to other 3DS SD cards, they are locked to the console.)
import.db 与 title.db
6月更新后,文件夹结构有了细微变化。你会在 /Nintendo 3DS/<SomeID>/<SomeID>/ 的exetdata旁找到"dbs"和"title"文件夹。"dbs"文件夹包含两个文件:import.db和title.db——用途目前不明。import.db似乎包含来自DSiWare SRL的数据。
文件数据的开头部分是加密的,但剩余部分是明文(cleartext)。这个文件总是3.1MB大小,因此它不包含大多数DSiWare的完整的SRL。里面的数据排列方式也与源SRL——ARM7代码,ARM9代码的排列顺序不同,它们混(mix)在一起。文件包含未安装的DSiWare数据,只在源DSi上被列出,用于DSiWare转移。(翻译待考证)
(The data at the beginning of the file is encrypted, but the rest is cleartext. This file is always 3.1MB, thus this doesn't contain the whole SRL for most DSiWare. The data stored here is not ordered the same way as the src SRL: ARM7 code, ARM9 code, and data are mixed together. The file can contain data from DSiWare that wasn't installed, only listed on the src DSi for DSiWare transfer. (This file is likely some temporary data storage used for DSiWare install etc).)
title.db似乎是加密的。
title
/title/00040000/ 包含 eshop 下载的数据 (有人能帮忙查证和加上地区吗?): 00032600 - Pokedex 3D - EUR (verified) 00042a00 - Legend of Zelda - Link's Awakening - EUR 0004ab00 - Nintendo Video - EUR 00052000 - Let's Golf 3D - EUR 00054300 - 3D Classics Excitebike - USA 00054e00 - 3D Classics Excitebike - EUR (verified) 00054300 - 3D Classics Excitebike - USA 00045C00 - 3D Classics Excitebike - JPN
要查看更多的ID,请参阅Title_list上的00040000标题(title)。
上面的游戏标题文件(title directories)包含两个目录: content 和 data 。content 包含 00000000.tmd、.app文件,某些cmd目录包含 00000001.cmd,所有这些文件都使用一个本体唯一的密钥(console-unique key)加密。data目录包含 00000001.sav,这是游戏标题(title)的加密游戏存档。尽管这些存档看起来很像闪存游戏存档,但是它们对文件内每个AES块使用了唯一的CTR,而CTR在每个游戏存档写入的时候又会改变。重命名这些游戏存档文件将引起主菜单在启动游戏(title)时挂起(hang),修改存档将像游戏卡带闪存存档一样抛出checksum/hash错误。
(The above title directories contain two dirs: content and data. content contains 00000000.tmd, .app files, and some cmd dir containing 00000001.cmd, all of which are encrypted with a console-unique key. The data dir contains 00000001.sav, this is the title's encrypted savegame. Although these saves look similar to FLASH savegames, these savegames use proper unique CTR for each AES block in the file, and the CTR properly changes for each savegame write. Renaming these savegames causes home-menu to hang while launching titles, modifying saves throws the usual checksum/hash corruption like gamecard flash saves.)
重命名content文件夹下任意文件或目录的时候,主菜单上的图标仍会被显示。修改这些文件与重命名有同样效果。重命名cmd文件夹下的cmd文件,或 00000000.app ,则3D标题会消失。重命名cmd目录或目录下的文件时,主菜单会拒绝运行游戏程序,说明书(译者注:即菜单里的软件说明书,3DSware和马里奥大陆3D这样的游戏会自带)将无法工作。(会显示“SD卡未插入”的黑屏)。重命名 00000001.app时,说明书将不会被载入,因此 .app 可能是说明书?主 00000000.app 二进制文件被重命名的时候,无法启动该游戏程序,并且显示说明书的地方将显示游戏程序的图标和标题。(译者注:这段按本人理解翻译,有兴趣的可以亲自试验一下,记得先备份SD卡内容)重命名tmp文件夹里面的文件将不会引起主菜单的任何改变。
(When renaming any of these files/dir under content, the icon in home-menu is still displayed. Modifying any of these files has same result as renaming them. When renaming the cmd dir/cmd file, or 00000000.app, the 3D banner isn't displayed. When renaming the cmd dir or the file contained in that dir, home-menu will refuse to run the title, and the manual will not work.(will display the black screen saying sdcard isn't inserted) Manual won't load when 00000001.app is renamed, so that .app might be the manual? When the main 00000000.app binary is renamed, the title will not launch and in the manual placeholder text is used for the title name/icon. Home-menu doesn't care at all when tmd is renamed.)
Private
保存在这里的"Private" 数据似乎是明文:
/Nintendo 3DS/Private/<Title ID Low>/
00020400 - Nintendo 3DS Camera 00020500 - Nintendo 3DS Sound
camera private 目录是 phtcache.bin.
想在3DS放入并能查看到新图片的时候,重命名为8位数字的.mpo文件并保存到/DCIM目录下。
sound private 目录是 voice/XX/*.m4a. 这里的XX是01-10,存储为m4a文件.