Changes

Jump to navigation Jump to search
2,796 bytes added ,  18:39, 10 June 2018
Added missing names for some commands (again)
Line 1: Line 1:  
[[Category:Services]]
 
[[Category:Services]]
   −
= Filesystem service "fs:USER" =
+
= Services =
 +
== Filesystem service "fs:USER" ==
 
You can at most have 32 FS archive handles.
 
You can at most have 32 FS archive handles.
   Line 553: Line 554:  
| 0x086B00C2
 
| 0x086B00C2
 
|?
 
|?
|?
+
|SetOtherSaveDataSecureValue
 
| 00121004
 
| 00121004
 
|-
 
|-
 
| 0x086C00C2
 
| 0x086C00C2
 
|?
 
|?
|?
+
|GetOtherSaveDataSecureValue
 
| 00121004
 
| 00121004
 
|-
 
|-
Line 567: Line 568:  
|-
 
|-
 
| 0x086E00C0
 
| 0x086E00C0
|?
+
|Related to Secure Value? Used in Pokemon Sun/Moon.
|?
+
|SetThisSaveDataSecureValue
 
|None?
 
|None?
 
|-
 
|-
 
| 0x086F0040
 
| 0x086F0040
|?
+
|Related to Secure Value? Used in Pokemon Sun/Moon.
|?
+
|GetThisSaveDataSecureValue
 
| 0xE
 
| 0xE
 
|-
 
|-
Line 626: Line 627:  
| 0x00101015
 
| 0x00101015
 
|-
 
|-
| 0x087A....
+
| 0x087A0180
 
| [[9.6.0-24|9.6.0-X]]
 
| [[9.6.0-24|9.6.0-X]]
| ?
+
| [[FS:AddSeed|AddSeed]]
 
| 0x00200000
 
| 0x00200000
 
|-
 
|-
Line 643: Line 644:  
| 0x087D0000
 
| 0x087D0000
 
| [[9.6.0-24|9.6.0-X]]
 
| [[9.6.0-24|9.6.0-X]]
| Writes an u32 from state to cmdreply[2]. Probably the total number of titles in the SEEDDB?
+
| GetNumSeeds. Writes the number of seeds to cmdreply[2]
 
| 0x00200000
 
| 0x00200000
 
|-
 
|-
Line 685: Line 686:  
| ?
 
| ?
 
| 0x00200000
 
| 0x00200000
 +
|-
 +
| 0x088600C0
 +
| [[11.1.0-34|11.1.0-X]]
 +
| [[FS:CheckUpdatedDat|CheckUpdatedDat]]
 +
| 0x00080000
 
|}
 
|}
   Line 693: Line 699:  
Each session for fs:USER has separate permissions, initially these are set to all zero's for new fs:USER sessions. The permissions/etc for fs:USER sessions are initialized via [[FS:Initialize]](loaded from the user process exheader).
 
Each session for fs:USER has separate permissions, initially these are set to all zero's for new fs:USER sessions. The permissions/etc for fs:USER sessions are initialized via [[FS:Initialize]](loaded from the user process exheader).
   −
=File service=
+
== Filesystem service "fs:LDR" ==
 +
This service is identical to fs:USER, except [[FS:OpenArchive]] archive 0x2345678E can only be accessed with fs:LDR.
 +
 
 +
== ProgramRegistry service "fs:REG" ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Command Header
 +
!  Description
 +
|-
 +
| 0x000100C6
 +
| [[FSReg:Dummy1|Dummy1]]
 +
|-
 +
| 0x040103C0
 +
| [[FSReg:Register|Register]]
 +
|-
 +
| 0x04020040
 +
| [[FSReg:Unregister|Unregister]]
 +
|-
 +
| 0x040300C0
 +
| [[FSReg:GetProgramInfo|GetProgramInfo]]
 +
|-
 +
| 0x04040100
 +
| [[FSReg:LoadProgram|LoadProgram]]
 +
|-
 +
| 0x04050080
 +
| [[FSReg:UnloadProgram|UnloadProgram]]
 +
|-
 +
| 0x04060080
 +
| [[FSReg:CheckHostLoadId|CheckHostLoadId]]
 +
|}
 +
 
 +
Only two sessions can be opened for this service at a time, hence no other processes can use this due to [[Process_Manager_Services|pm-module]] and [[Loader_Services|loader]] using this.
 +
 
 +
=File and directory access=
 +
==Files==
 +
File session handles obtained via [[FS:OpenFile]] et al can be used to access files through a service-like interface, despite not being an actual service registered using [[SRV:RegisterService]].
 +
 
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 745: Line 787:  
|}
 
|}
   −
=Directory service=
+
==Directories==
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 777: Line 819:  
|}
 
|}
   −
= Filesystem service "fs:LDR" =
+
= Archives =
This service is identical to fs:USER, except [[FS:OpenArchive]] archive 0x2345678E can only be accessed with fs:LDR.
  −
 
  −
= ProgramRegistry service "fs:REG" =
  −
{| class="wikitable" border="1"
  −
|-
  −
!  Command Header
  −
!  Description
  −
|-
  −
| 0x000100C6
  −
| [[FSReg:Dummy1|Dummy1]]
  −
|-
  −
| 0x040103C0
  −
| [[FSReg:Register|Register]]
  −
|-
  −
| 0x04020040
  −
| [[FSReg:Unregister|Unregister]]
  −
|-
  −
| 0x040300C0
  −
| [[FSReg:GetProgramInfo|GetProgramInfo]]
  −
|-
  −
| 0x04040100
  −
| [[FSReg:LoadProgram|LoadProgram]]
  −
|-
  −
| 0x04050080
  −
| [[FSReg:UnloadProgram|UnloadProgram]]
  −
|-
  −
| 0x04060080
  −
| [[FSReg:CheckHostLoadId|CheckHostLoadId]]
  −
|}
  −
 
  −
Only two sessions can be opened for this service at a time, hence no other processes can use this due to [[Process_Manager_Services|pm-module]] and [[Loader_Services|loader]] using this.
  −
 
  −
=SEEDDB=
  −
With [[9.6.0-24|9.6.0-X]] new [[System_SaveData]] with saveID 0001000F was added, this seems to be handled by FS-module itself, probably via the new service-cmds added to fsuser. [[Home Menu]] and [[NIM_Services|NIM]] module have access to those commands.
  −
 
  −
The SEEDDB savedata contains the title-unique seed-data used for the new [[NCCH]] keyY generation added with FIRM [[9.6.0-24|9.6.0-X]].
  −
 
  −
= Common Types =
  −
== MediaType ==
  −
{| class="wikitable" border="1"
  −
|-
  −
!  Value
  −
!  Description
  −
|-
  −
| 0
  −
| NAND
  −
|-
  −
| 1
  −
| SD
  −
|-
  −
| 2
  −
| Game Card
  −
|}
  −
 
  −
== OpenFlags ==
  −
{| class="wikitable" border="1"
  −
|-
  −
!  Bit
  −
!  Description
  −
|-
  −
| 0
  −
| Read
  −
|-
  −
| 1
  −
| Write
  −
|-
  −
| 2
  −
| Create
  −
|}
  −
 
  −
== Attributes ==
  −
{| class="wikitable" border="1"
  −
|-
  −
!  Offset
  −
!  Size
  −
!  Description
  −
|-
  −
| 0x0
  −
| 0x1
  −
| Is Directory
  −
|-
  −
| 0x1
  −
| 0x1
  −
| Is Hidden
  −
|-
  −
| 0x2
  −
| 0x1
  −
| Is Archive
  −
|-
  −
| 0x3
  −
| 0x1
  −
| Is Read-Only
  −
|}
  −
 
  −
== WriteOption ==
  −
{| class="wikitable" border="1"
  −
|-
  −
!  Offset
  −
!  Size
  −
!  Description
  −
|-
  −
| 0x0
  −
| 0x1
  −
| Flush
  −
|-
  −
| 0x1
  −
| 0x1
  −
| Update Time Stamp
  −
|-
  −
| 0x2
  −
| 0x1
  −
| Reserved
  −
|-
  −
| 0x3
  −
| 0x1
  −
| Reserved
  −
|}
  −
 
  −
== DirectoryEntry ==
  −
{| class="wikitable" border="1"
  −
|-
  −
!  Offset
  −
!  Size
  −
!  Description
  −
|-
  −
| 0x0
  −
| 0x20C
  −
| UTF-16 Entry Name
  −
|-
  −
| 0x20C
  −
| 0xA
  −
| 8.3 short filename name
  −
|-
  −
| 0x216
  −
| 0x4
  −
| 8.3 short filename extension
  −
|-
  −
| 0x21A
  −
| 0x1
  −
| Always 1
  −
|-
  −
| 0x21B
  −
| 0x1
  −
| Reserved
  −
|-
  −
| 0x21C
  −
| 0x4
  −
| [[Filesystem_services#Attributes|Attributes]]
  −
|-
  −
| 0x220
  −
| 0x8
  −
| Entry Size
  −
|}
  −
 
  −
== ArchiveResource ==
   
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Offset
+
!  ArchiveId
!  Size
  −
!  Description
  −
|-
  −
| 0x0
  −
| 0x4
  −
| Sector byte-size
  −
|-
  −
| 0x4
  −
| 0x4
  −
| Cluster byte-size
  −
|-
  −
| 0x8
  −
| 0x4
  −
| Partition capacity in clusters
  −
|-
  −
| 0xC
  −
| 0x4
  −
| Available free space in clusters
  −
|}
  −
 
  −
== ArchiveId ==
  −
{| class="wikitable" border="1"
  −
|-
  −
!  Idcode
   
!  Description
 
!  Description
 
!  Accessible via [[Filesystem_services|FS]]
 
!  Accessible via [[Filesystem_services|FS]]
 
!  Accessible via [[Filesystem_services_PXI|FSPXI]]
 
!  Accessible via [[Filesystem_services_PXI|FSPXI]]
 +
!  Only accessible by Process9 internally
 
!  Requires binary [[FS:OpenFile|Lowpath]]
 
!  Requires binary [[FS:OpenFile|Lowpath]]
 +
!  Required exheader FS access info bitmask
 
|-
 
|-
 
| 0x00000003
 
| 0x00000003
| Application RomFS
+
| SelfNCCH (including [[#RomFS|RomFS]])
 
| Yes
 
| Yes
 
| No
 
| No
 
| No
 
| No
 +
| No
 +
| None
 
|-
 
|-
 
| 0x00000004
 
| 0x00000004
Line 976: Line 843:  
| No
 
| No
 
| No
 
| No
 +
| No
 +
| None
 
|-
 
|-
 
| 0x00000006
 
| 0x00000006
 
| ExtSaveData
 
| ExtSaveData
 
| Yes
 
| Yes
 +
| No
 
| No
 
| No
 
| Yes
 
| Yes
 +
| 0x100D, when the input extdataID isn't listed in the exheader.
 
|-
 
|-
 
| 0x00000007
 
| 0x00000007
 
| Shared ExtSaveData
 
| Shared ExtSaveData
 
| Yes
 
| Yes
 +
| No
 
| No
 
| No
 
| Yes
 
| Yes
 +
| None
 
|-
 
|-
 
| 0x00000008
 
| 0x00000008
 
| SystemSaveData
 
| SystemSaveData
 
| Yes
 
| Yes
 +
| No
 
| No
 
| No
 
| Yes
 
| Yes
 +
| 0x4, when the input saveID doesn't match the exheader system-saveID.
 
|-
 
|-
 
| 0x00000009
 
| 0x00000009
Line 1,000: Line 875:  
| Yes
 
| Yes
 
| No
 
| No
 +
| No
 +
| 0x8E
 
|-
 
|-
 
| 0x0000000A
 
| 0x0000000A
Line 1,006: Line 883:  
| No
 
| No
 
| No
 
| No
 +
| No
 +
| 0x808E
 
|-
 
|-
 
| 0x12345678
 
| 0x12345678
 
| ExtSaveData for BOSS
 
| ExtSaveData for BOSS
 
| Yes
 
| Yes
 +
| No
 
| No
 
| No
 
| Yes
 
| Yes
 +
| 0x44
 
|-
 
|-
 
| 0x12345679
 
| 0x12345679
Line 1,018: Line 899:  
| Yes
 
| Yes
 
| No
 
| No
 +
| No
 +
| 0x16
 
|-
 
|-
 
| 0x1234567B
 
| 0x1234567B
Line 1,023: Line 906:  
| No
 
| No
 
| Yes
 
| Yes
 +
| No
 
| Yes
 
| Yes
 +
|
 
|-
 
|-
 
| 0x1234567C
 
| 0x1234567C
Line 1,029: Line 914:  
| No
 
| No
 
| Yes
 
| Yes
 +
| No
 
| Yes
 
| Yes
 +
|
 
|-
 
|-
 
| 0x1234567D
 
| 0x1234567D
Line 1,036: Line 923:  
| Yes
 
| Yes
 
| No
 
| No
 +
| No
 +
| 0x800
 
|-
 
|-
 
| 0x1234567E
 
| 0x1234567E
Line 1,042: Line 931:  
| Yes
 
| Yes
 
| No
 
| No
 +
| No
 +
| 0x200
 
|-
 
|-
 
| 0x1234567F
 
| 0x1234567F
Line 1,048: Line 939:  
| Yes
 
| Yes
 
| No
 
| No
 +
| No
 +
| ?
 
|-
 
|-
 
| 0x12345680
 
| 0x12345680
Line 1,053: Line 946:  
| Yes
 
| Yes
 
| ?
 
| ?
 +
| No
 
| Yes
 
| Yes
 +
| ?
 
|-
 
|-
 
| 0x12345681
 
| 0x12345681
 
| Unknown. Accessed by FS service.
 
| Unknown. Accessed by FS service.
 
| ?
 
| ?
 +
| ?
 +
| No
 
| ?
 
| ?
 
| ?
 
| ?
Line 1,065: Line 962:  
| Yes
 
| Yes
 
| ?
 
| ?
 +
| No
 
| Yes
 
| Yes
 +
| ?
 
|-
 
|-
 
| 0x2345678A
 
| 0x2345678A
Line 1,071: Line 970:  
| Yes
 
| Yes
 
| Yes
 
| Yes
 +
| No
 
| Yes
 
| Yes
 +
| 0x1005
 
|-
 
|-
 
| 0x2345678B
 
| 0x2345678B
Line 1,078: Line 979:  
| No
 
| No
 
| Yes
 
| Yes
 +
| Yes
 +
|
 
|-
 
|-
 
| 0x2345678C
 
| 0x2345678C
Line 1,084: Line 987:  
| No
 
| No
 
| Yes
 
| Yes
 +
| Yes
 +
|
 
|-
 
|-
 
| 0x2345678D
 
| 0x2345678D
Line 1,089: Line 994:  
| No
 
| No
 
| No
 
| No
 +
| Yes
 
| No
 
| No
 +
|
 
|-
 
|-
 
| 0x2345678E
 
| 0x2345678E
Line 1,095: Line 1,002:  
| Yes
 
| Yes
 
| Yes
 
| Yes
 +
| No
 
| Yes
 
| Yes
 +
| None, see description.
 
|-
 
|-
 
| 0x567890AB
 
| 0x567890AB
Line 1,102: Line 1,011:  
| Yes
 
| Yes
 
| No
 
| No
 +
| No
 +
| ?
 
|-
 
|-
 
| 0x567890AC
 
| 0x567890AC
Line 1,108: Line 1,019:  
| Yes
 
| Yes
 
| No
 
| No
 +
| No
 +
| ?
 
|-
 
|-
 
| 0x567890AD
 
| 0x567890AD
| ?
+
| TWLS (DSi Sound stores recordings here). This is mapped to the FAT12 image stored in the file at [[Twln/shared2/0000]].
 
| No
 
| No
 
| Yes
 
| Yes
 
| No
 
| No
 +
| No
 +
| ?
 
|-
 
|-
 
| 0x567890AE
 
| 0x567890AE
Line 1,120: Line 1,035:  
| Yes
 
| Yes
 
| No
 
| No
 +
| No
 +
| 0x100
 
|-
 
|-
 
| 0x567890AF
 
| 0x567890AF
Line 1,126: Line 1,043:  
| Yes
 
| Yes
 
| No
 
| No
 +
| No
 +
| 0x100
 
|-
 
|-
 
| 0x567890B0
 
| 0x567890B0
Line 1,132: Line 1,051:  
| Yes
 
| Yes
 
| No
 
| No
 +
| No
 +
|
 
|-
 
|-
 
| 0x567890B1
 
| 0x567890B1
Line 1,138: Line 1,059:  
| No
 
| No
 
| No
 
| No
 +
| No
 +
| 0x6
 
|-
 
|-
 
| 0x567890B2
 
| 0x567890B2
 
| UserSaveData (for check). This is the same as the regular SaveData archive, except with this the savedata ID and mediatype is loaded from the input archive lowpath.
 
| UserSaveData (for check). This is the same as the regular SaveData archive, except with this the savedata ID and mediatype is loaded from the input archive lowpath.
 
| Yes
 
| Yes
 +
| No
 
| No
 
| No
 
| Yes
 
| Yes
 +
| 0x6
 
|-
 
|-
 
| 0x567890B4
 
| 0x567890B4
| ? SaveData from Demo Version of Retail Game
+
| Similar to 0x567890B2 but can only access Accessible Save specified in [[NCCH/Extended_Header#Storage_Info|exheader]]?
 
| Yes
 
| Yes
 
| No
 
| No
 
| No
 
| No
 +
| Yes
 +
| ?
 
|}
 
|}
    
Archives listed as not requiring a binary lowpath, use lowpath type [[FS:OpenFile|empty]].
 
Archives listed as not requiring a binary lowpath, use lowpath type [[FS:OpenFile|empty]].
 +
 +
The above permission bitmasks are from v2.x, see the above Services section for how these are handled.
    
Archives CTR NAND, NAND RO Write FS, TWL NAND, NAND W FS, and CARD SPI FS require the corresponding process exheader access control mount flag to be set, in the exheader for any of the currently running ARM11 processes, for [[Filesystem_services_PXI|FSPXI]]. The access rights checked by [[Filesystem services|FS]] module for archive mounting with fs:USER, are stored in the process' exheader accessinfo.
 
Archives CTR NAND, NAND RO Write FS, TWL NAND, NAND W FS, and CARD SPI FS require the corresponding process exheader access control mount flag to be set, in the exheader for any of the currently running ARM11 processes, for [[Filesystem_services_PXI|FSPXI]]. The access rights checked by [[Filesystem services|FS]] module for archive mounting with fs:USER, are stored in the process' exheader accessinfo.
Line 1,158: Line 1,087:  
The CARDSPI archive allows access to the gamecard CARD1 raw savedata flash(aka "cardspi:/" in [[FIRM|Process9]]), the file lowpath must be WCHAR "/". The "NAND W FS" archive allows access to the raw NAND image(aka "wnand:/" in Process9), the file lowpath must be WCHAR "/".
 
The CARDSPI archive allows access to the gamecard CARD1 raw savedata flash(aka "cardspi:/" in [[FIRM|Process9]]), the file lowpath must be WCHAR "/". The "NAND W FS" archive allows access to the raw NAND image(aka "wnand:/" in Process9), the file lowpath must be WCHAR "/".
   −
== PathType ==
+
= Filenames and Paths =
 +
PathType:
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
 
!  Value
 
!  Value
 
!  Description
 
!  Description
 +
|-
 +
| -1
 +
| Returned internally by Process9, when errors occur it seems(in particular when no nul-terminator was found in the input path). The data ptr is set to NULL.
 
|-
 
|-
 
| 0x0
 
| 0x0
| INVALID - Specifies an invalid path.
+
| INVALID - Specifies an invalid path
 
|-
 
|-
 
| 0x1
 
| 0x1
| EMPTY - Specifies an empty path.
+
| EMPTY - Specifies an empty path
 
|-
 
|-
 
| 0x2
 
| 0x2
| BINARY - Non-text based path. Meaning is per-archive.
+
| BINARY - Non-text based path. Meaning is per-archive
 
|-
 
|-
 
| 0x3
 
| 0x3
| CHAR - Text-based path with 8-bit characters.
+
| ASCII - Text-based path with 7-bit ASCII characters padded to 8-bits each (signed char)
 
|-
 
|-
 
| 0x4
 
| 0x4
| WCHAR - Text-based path with 16-bit characters.
+
| UTF16 - Text-based path with UTF-16 characters
 
|}
 
|}
   −
=== Binary LowPath ===
+
In IPC requests, sizes of ASCII and UTF16 paths must include space for the null-terminator.
 +
 
 +
== 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 Archive Path Data Format ====
+
=== SelfNCCH File Path Data Format ===
===== FS =====
+
{| 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 Archive Path Data Format ===
 +
==== FS ====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,198: Line 1,154:  
The file/directory lowpath is a text lowpath in the [[Savegames|savegame]] filesystem.
 
The file/directory lowpath is a text lowpath in the [[Savegames|savegame]] filesystem.
   −
===== FSPXI =====
+
==== FSPXI ====
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,209: Line 1,165:  
The file lowpath is a binary lowpath containing the u64 saveid, however the high word of the saveid is always zero. The mounted file is the cleartext savegame image. Up to 32 SystemSaveData image files can be opened under a single mounted FSPXI archive.
 
The file lowpath is a binary lowpath containing the u64 saveid, however the high word of the saveid is always zero. The mounted file is the cleartext savegame image. Up to 32 SystemSaveData image files can be opened under a single mounted FSPXI archive.
   −
==== UserSaveDataForCheck Archive Path Data Format ====
+
=== UserSaveDataForCheck Archive Path Data Format ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,226: Line 1,182:  
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.
 
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.
   −
==== ExtSaveData Archive Path Data Format ====
+
=== 0x567890B4 Archive Path Data Format ===
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Index word
 +
!  Description
 +
|-
 +
| 0
 +
| [[Mediatypes|Mediatype]]
 +
|-
 +
| 1
 +
| <code><nowiki>Lower_word_saveid >> 8</nowiki></code> ?
 +
|-
 +
| 2
 +
| Unknown. Game calculate this using formula <code><nowiki>0xFFFFFF00 | unknown_b</nowiki></code>
 +
|}
 +
 
 +
=== ExtSaveData Archive Path Data Format ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,243: Line 1,215:  
For FS, the file/directory lowpath is a text path in the [[extdata]] filesystem. For FSPXI, the file lowpath is a text path relative to the "/extdata/<ExtdataIDHigh>/<ExtdataIDLow>" directory on SD/NAND, for the cleartext extdata image to mount.
 
For FS, the file/directory lowpath is a text path in the [[extdata]] filesystem. For FSPXI, the file lowpath is a text path relative to the "/extdata/<ExtdataIDHigh>/<ExtdataIDLow>" directory on SD/NAND, for the cleartext extdata image to mount.
   −
==== 0x2345678A Archive Path Data Format ====
+
=== 0x2345678A Archive Path Data Format ===
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,256: Line 1,228:  
|-
 
|-
 
| 2  
 
| 2  
| [[Mediatypes|Mediatype]]
+
| ([[Mediatypes|Mediatype]] & 0xFF) | (uninitialized_data? & 0xFFFFFF00)
 
|-
 
|-
 
| 3
 
| 3
| Reserved
+
| Number of something? Hardcoded per-archive, 0 for ExeFS, 200 for area:, 100 for rate:, 40 for eula:, etc.
 
|}
 
|}
   −
===== File lowpath =====
+
File lowpath:
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,283: Line 1,255:  
The 0x14-byte lowpath is all-zero for accessing the title's main RomFS.
 
The 0x14-byte lowpath is all-zero for accessing the title's main RomFS.
   −
==== [[RomFS]] ====
+
=== [[RomFS]] ===
The raw FS image for the main CXI RomFS(for the current app this is accessible via archiveid 0x3) can be accessed via an all-zero 0xc-byte binary file-lowpath. The update RomFS for the current app can be accessed with the first u32 in the binary file-lowpath being set to 0x5. This allows access to the raw level-3 IVFC image: the user process must handle parsing the filesystem used in this image itself.
+
 
 +
Archives 0x3 and 0x2345678E both allow for accessing the [[RomFS#Level_3_Format|level-3 IVFC images]] for RomFS access. The main CXI RomFS is accessible via an all-zero 0xc-byte binary file-lowpath. The update RomFS can be accessed with the first u32 in the binary file-lowpath being set to 0x5. The user must handle parsing the filesystem used in the exposed image itself.
   −
In this scenario, OpenFile returns a handle to the RomFS archive.
+
With FSPXI the returned data for RomFS is the entire RomFS section from the NCCH, starting at the IVFC header.
   −
The 0x3 archive is an interface for the 0x2345678A archive with the current process programID+mediatype. The file lowpath is 3-words. These words are written to 0x2345678A-archive file_lowpath+0, with the rest of that lowpath set to all-zero. File lowpath:
+
The 0x3 archive is an interface for the 0x2345678E archive with the current process programID+mediatype. The file lowpath is 3-words. These words are written to 0x2345678E-archive file_lowpath+0, with the rest of that lowpath set to all-zero(lowpath is different from archive 0x2345678A). File lowpath:
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
 
|-
 
|-
Line 1,301: Line 1,274:  
|-
 
|-
 
| 1-2
 
| 1-2
| See above.
+
| See above. Not validated by FS-module.
 +
|}
 +
 
 +
=SEEDDB=
 +
With [[9.6.0-24|9.6.0-X]] new [[System_SaveData]] with saveID 0001000F was added, this seems to be handled by FS-module itself, probably via the new service-cmds added to fsuser. [[Home Menu]] and [[NIM_Services|NIM]] module have access to those commands.
 +
 
 +
The SEEDDB savedata contains the title-unique seed-data used for the new [[NCCH]] keyY generation added with FIRM [[9.6.0-24|9.6.0-X]].
 +
 
 +
= Common Types =
 +
== MediaType ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0
 +
| NAND
 +
|-
 +
| 1
 +
| SD
 +
|-
 +
| 2
 +
| Game Card
 +
|}
 +
 
 +
== SystemMediaType ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Value
 +
!  Description
 +
|-
 +
| 0
 +
| CTR NAND
 +
|-
 +
| 1
 +
| TWL NAND
 +
|-
 +
| 2
 +
| SD
 +
|-
 +
| 3
 +
| TWL Photo
 +
|}
 +
 
 +
== OpenFlags ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Bit
 +
!  Description
 +
|-
 +
| 0
 +
| Read
 +
|-
 +
| 1
 +
| Write
 +
|-
 +
| 2
 +
| Create
 +
|}
 +
 
 +
== Attributes ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x1
 +
| Is Directory
 +
|-
 +
| 0x1
 +
| 0x1
 +
| Is Hidden
 +
|-
 +
| 0x2
 +
| 0x1
 +
| Is Archive
 +
|-
 +
| 0x3
 +
| 0x1
 +
| Is Read-Only
 +
|}
 +
 
 +
== WriteOption ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x1
 +
| Flush
 +
|-
 +
| 0x1
 +
| 0x1
 +
| Update Time Stamp
 +
|-
 +
| 0x2
 +
| 0x1
 +
| Reserved
 +
|-
 +
| 0x3
 +
| 0x1
 +
| Reserved
 +
|}
 +
 
 +
== DirectoryEntry ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x20C
 +
| UTF-16 Entry Name
 +
|-
 +
| 0x20C
 +
| 0xA
 +
| 8.3 short filename name
 +
|-
 +
| 0x216
 +
| 0x4
 +
| 8.3 short filename extension
 +
|-
 +
| 0x21A
 +
| 0x1
 +
| Always 1
 +
|-
 +
| 0x21B
 +
| 0x1
 +
| Reserved
 +
|-
 +
| 0x21C
 +
| 0x4
 +
| [[Filesystem_services#Attributes|Attributes]]
 +
|-
 +
| 0x220
 +
| 0x8
 +
| Entry Size
 +
|}
 +
 
 +
== ArchiveResource ==
 +
{| class="wikitable" border="1"
 +
|-
 +
!  Offset
 +
!  Size
 +
!  Description
 +
|-
 +
| 0x0
 +
| 0x4
 +
| Sector byte-size
 +
|-
 +
| 0x4
 +
| 0x4
 +
| Cluster byte-size
 +
|-
 +
| 0x8
 +
| 0x4
 +
| Partition capacity in clusters
 +
|-
 +
| 0xC
 +
| 0x4
 +
| Available free space in clusters
 
|}
 
|}
  
24

edits

Navigation menu