Filesystem services: Difference between revisions

TimmSkiller (talk | contribs)
TimmSkiller (talk | contribs)
 
(10 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 ExeFS. Not accessible with fs:USER.
| 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.
=== SelfNCCH File Path Data Format ===
{| class="wikitable" border="1"
|-
!  Index word
!  Description
|-
| 0
| Type:
* 0x0: RomFS
* 0x1: error 0xD9004676
* 0x2: ExeFS
* 0x3: Error 0xE0E046BE.
* 0x4: FS-module crashes on this
* 0x5: Update RomFS?
|-
| 1-2
| File name for ExeFS ("icon"/"banner"/"logo"). ".code" is not allowed
|}
Note that ExeFS files only support reading from offset=0 and with size=file_size.


=== SystemSaveData / Extdata / Shared Extdata Archive Path Data Format ===
=== SystemSaveData / Extdata / Shared Extdata Archive Path Data Format ===
Line 1,342: Line 1,321:
| 0x0 || 0x8 || Program ID (Title ID)
| 0x0 || 0x8 || Program ID (Title ID)
|-
|-
| 0x8 || 0x1 || [[Mediatypes|Media Type]]
| 0xB || 0x1 || [[Mediatypes|Media Type]]
|-
|-
| 0x9 || 0x7 || padding
| 0xC || 0x4 || padding
|}
|}


Line 1,387: Line 1,366:


{| class="wikitable" border="1"
{| class="wikitable" border="1"
| [[NCCH#NCCH_Flags|u64, Allowed content types flag]]
| [[NCCH#Content_Types|u64, Allowed content types flag]]
(<code>(1 << allowed_type_a) |
 
(1 << allowed_type_b)...</code>)
|}
|}


Line 1,396: Line 1,378:
! Offset !! Size !! Description
! Offset !! Size !! Description
|-
|-
| 0x0 || 0x10 || 16-byte IV for save data decryption
| 0x0 || 0x10 || 16-byte IV for save data crypto
|}
|}
|
|
Line 1,441: Line 1,423:
- 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).
- 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).


=== FSPXI Program Access ===
=== 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]] ===