Filesystem services: Difference between revisions
TimmSkiller (talk | contribs) |
TimmSkiller (talk | contribs) |
||
| (13 intermediate revisions by the same user not shown) | |||
| Line 964: | Line 964: | ||
| Unknown. There's code for this in spider v9.9, but that code isn't actually used. | | Unknown. There's code for this in spider v9.9, but that code isn't actually used. | ||
| Yes | | Yes | ||
| | | No | ||
| No | | No | ||
| Yes | | Yes | ||
| Line 1,002: | Line 1,002: | ||
|- | |- | ||
| 0x2345678E | | 0x2345678E | ||
| FSPXI: Program Access (limited subset of merged main title + update/patch title access). For fs:LDR(used by the "loader" FIRM ARM11-process), only | | FSPXI: Program Access (limited subset of merged main title + update/patch title access). For fs:LDR(used by the "loader" FIRM ARM11-process), only <code>exefs:/.code</code>. Not accessible with fs:USER. | ||
| Yes | | Yes | ||
| Yes | | Yes | ||
| Line 1,128: | Line 1,128: | ||
== Binary LowPath == | == Binary LowPath == | ||
The format of the data that a binary LowPath points to is custom per archive. | The format of the data that a binary LowPath points to is custom per archive. | ||
=== SystemSaveData / Extdata / Shared Extdata Archive Path Data Format === | === SystemSaveData / Extdata / Shared Extdata Archive Path Data Format === | ||
| Line 1,298: | Line 1,277: | ||
|- | |- | ||
| 3 || Banner save data access (for DSiWare titles) | | 3 || Banner save data access (for DSiWare titles) | ||
|- | |||
| 4 || FS only: Save data transfer (internally uses generated data from [[FS:BeginSaveDataMove]] as the IV for "Save data access (low-level, encrypted)") | |||
|- | |- | ||
| 5 || Save data access (low-level, encrypted) | | 5 || Save data access (low-level, encrypted) | ||
| Line 1,340: | Line 1,321: | ||
| 0x0 || 0x8 || Program ID (Title ID) | | 0x0 || 0x8 || Program ID (Title ID) | ||
|- | |- | ||
| | | 0xB || 0x1 || [[Mediatypes|Media Type]] | ||
|- | |- | ||
| | | 0xC || 0x4 || padding | ||
|} | |} | ||
| Line 1,357: | Line 1,338: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
|- | |- | ||
! High Level NCCH Access !! Save Data Access (high level) !! Raw Content | ! High Level NCCH Access !! Save Data Access (high level) !! Raw Content !! FS only: Save Data Transfer | ||
|- | |- | ||
| | | | ||
| Line 1,385: | Line 1,366: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
| [[NCCH# | | [[NCCH#Content_Types|u64, Allowed content types flag]] | ||
(<code>(1 << allowed_type_a) | | |||
(1 << allowed_type_b)...</code>) | |||
|} | |} | ||
| Line 1,394: | Line 1,378: | ||
! Offset !! Size !! Description | ! Offset !! Size !! Description | ||
|- | |- | ||
| 0x0 || 0x10 || 16-byte IV for save data | | 0x0 || 0x10 || 16-byte IV for save data crypto | ||
|} | |} | ||
| | | | ||
| Line 1,403: | Line 1,387: | ||
| 0x0 || 0x4 || Content index from TMD for NAND/SD titles | | 0x0 || 0x4 || Content index from TMD for NAND/SD titles | ||
NCSD partition index for gamecards | NCSD partition index for gamecards | ||
|- | |||
| 0x4 || 0xC || padding | |||
|} | |||
| | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset !! Size !! Description | |||
|- | |||
| 0x0 || 0x4 || Save data transfer key from [[FS:BeginSaveDataMove]] | |||
|- | |- | ||
| 0x4 || 0xC || padding | | 0x4 || 0xC || padding | ||
| Line 1,419: | Line 1,412: | ||
The "Seed Verify/Validate" NCCH access type also requires the seed portion of the lowpath. The target NCCH content is opened (with the opened file interface being stubbed, meaning no real reads/writes can be performed on it), and the given seed is used to calculate the seed check hash, and part of it is compared to the check value in the NCCH header. If it matches, opening the "file" succeeds, otherwise 0xD900458C is returned. If attempt is made to use the seed validation type on a content that does not use a seed, error 0xC92044E6 is returned. | The "Seed Verify/Validate" NCCH access type also requires the seed portion of the lowpath. The target NCCH content is opened (with the opened file interface being stubbed, meaning no real reads/writes can be performed on it), and the given seed is used to calculate the seed check hash, and part of it is compared to the check value in the NCCH header. If it matches, opening the "file" succeeds, otherwise 0xD900458C is returned. If attempt is made to use the seed validation type on a content that does not use a seed, error 0xC92044E6 is returned. | ||
==== FS Limitations ==== | |||
For FS, this archive functions the same, except for the following limitations: | |||
- Only the title access types "High Level NCCH Access" and "High Level Save Data Access", and "Save Data Transfer" are allowed. | |||
- For high level NCCH access, the types "RomFS", "System Menu Data", "Seeded check", and "Seed Check/Verify" are allowed. | |||
- For "Seed Check/Verify", rather than providing the title seed in the file path (as is the case for FSPXI), the seed is retrieved from the seed database (meaning the file lowpath size is always 0x14 for FS). | |||
=== Program Access / SelfNCCH access === | |||
Provides access to a "merged" archive of a base title and, optionally, a separate update (patch) title. | |||
If no patch title exists, the base title is considered to be the patch title, i.e. turning all "patch" accesses into accesses to the base title. | |||
==== Program Access Type ==== | |||
{| class="wikitable" border="1" | |||
|- | |||
! Value !! Description !! Accesses | |||
|- | |||
| 0 || RomFS ("unspecified" [[NCCH#Content_Type|content type]], the default) || Base title | |||
|- | |||
| 1 || <code>exefs:/.code</code> || Patch title | |||
|- | |||
| 2 || System Menu Data (<code>exefs:/icon</code>, <code>exefs:/banner</code>, <code>exefs:/logo</code>) || Base title | |||
|- | |||
| 3 || Save Data (high level, decrypted) || - | |||
|- | |||
| 4 || RomFS (all [[NCCH#Content_Type|content types]]) || Base title | |||
|- | |||
| 5 || RomFS ("unspecified" [[NCCH#Content_Type|content type]], the default) || Patch title | |||
|} | |||
==== Archive Path ==== | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset !! Size !! Description | |||
|- | |||
| 0x0 || 0x8 || u64, Program Handle from [[PXIPM:RegisterProgram]] | |||
|} | |||
==== File Path ==== | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset !! Size !! Description | |||
|- | |||
| 0x0 || 0x4 || [[Filesystem_services#Program_Access_Type|Program Access Type]] | |||
|- | |||
| 0x4 || 0x8 || Dynamic data depending on [[Filesystem_services#Program_Access_Type|Program Access Type]]: | |||
{| class="wikitable" border="1" | |||
|- | |||
! ExeFS files (System Menu Data, etc.) !! RomFS of base title (all [[NCCH#Content_Type|content types]]) | |||
|- | |||
| | |||
{| class="wikitable" border="1" | |||
| 8-character ExeFS filename | |||
|} | |||
| | |||
{| class="wikitable" border="1" | |||
|- | |||
! Offset !! Size !! Description | |||
|- | |||
| 0x0 || 0x4 || u32, content index of target content | |||
|- | |||
| 0x4 || 0x4 || padding | |||
|} | |||
|} | |||
|} | |||
==== FS Limitations ==== | |||
- FSPXI allows all access types. | |||
- When used through fs:LDR by loader, FS only provides access to <code>exefs:/.code</code>. | |||
- For SelfNCCH access, the only allowed access types are "RomFS ("unspecified" [[NCCH#Content_Type|content type]], the default)" of the Base or Patch title, and "System Menu Data". Attempting to access "Save Data" results in error 0xE0E046BE, "RomFS (all [[NCCH#Content_Type|content types]])" in 0xF9604784, and "<code>exefs:/.code</code>" in 0xD9004676. | |||
=== [[RomFS]] === | === [[RomFS]] === | ||