Filesystem services: Difference between revisions

TimmSkiller (talk | contribs)
 
(118 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[[Category:Services]]
= Services =
 
{{Anchor|FS}}{{Anchor|FSUSER}}{{Anchor|fs:USER}}
= Filesystem service "fs:USER" =
== Filesystem service "fs:USER" ==
You can at most have 32 FS archive handles.
You can at most have 32 FS archive handles.


Line 446: Line 446:
| 0x101005
| 0x101005
|-
|-
| 0x08560200
| 0x08560240
| [[3.0.0-5]]
| [[3.0.0-5]]
| [[FS:CreateSystemSaveData|CreateSystemSaveData]]
| [[FS:CreateSystemSaveData|CreateSystemSaveData]]
Line 553: Line 553:
| 0x086B00C2
| 0x086B00C2
|?
|?
|?
| [[FS:SetOtherSaveDataSecureValue|SetOtherSaveDataSecureValue]]
| 00121004
| 0x121004
|-
|-
| 0x086C00C2
| 0x086C00C2
|?
|?
|?
| [[FS:GetOtherSaveDataSecureValue|GetOtherSaveDataSecureValue]]
| 00121004
| 0x121004
|-
|-
| 0x086D0040
| 0x086D0080
|?
|?
|?
| [[FS:BeginSaveDataMove|BeginSaveDataMove]]
| 00020004
| 0x20004
|-
|-
| 0x086E00C0
| 0x086E00C0
|?
|?
|?
| [[FS:SetThisSaveDataSecureValue|SetThisSaveDataSecureValue]]
|None?
|None
|-
|-
| 0x086F0040
| 0x086F0040
|?
|?
|?
| [[FS:GetThisSaveDataSecureValue|GetThisSaveDataSecureValue]]
| 0xE
| None
|-
|-
| 0x087000C2
| 0x087000C2
|?
|?
|?
| [[FS:CheckArchive|CheckArchive]]
|None?
|None
|-
|-
| 0x08710100
| 0x08710140
|?
| ?
|?
| [[FS:TransferSaveDataCMAC|TransferSaveDataCMAC]]
| 0xC
| 0x20004
|-
|-
| 0x087201C0
| 0x08720200
|?
|?
|?
| [[FS:RegisterTitleContentOverlay|RegisterTitleContentOverlay]]
| 00080004
| 0x80004
|-
|-
| 0x087300C0
| 0x08730100
|?
|?
|?
| [[FS:UnregisterTitleContentOverlay|UnregisterTitleContentOverlay]]
| 00080004
| 0x80004
|-
|-
| 0x08740000
| 0x08740000
|?
|?
|?
| [[FS:UnregisterAllTitleContentOverlays|UnregisterAllTitleContentOverlays]]
| 00080004
| 0x80004
|-
|-
| 0x08750140
| 0x08750140
|?
|?
|?
| [[FS:SetSaveArchiveSecureValue|SetSaveArchiveSecureValue]]
|None?
|None
|-
|-
| 0x087600C0
| 0x087600C0
|?
|?
|?
| [[FS:GetSaveArchiveSecureValue|GetSaveArchiveSecureValue]]
|None?
|None
|-
|-
| 0x08770100
| 0x08770140
|?
|?
|?
|?
| [[FS:RegisterSpecialTitleContent|RegisterSpecialTitleContent]]
| 0x80004
|-
|-
| 0x087800C0
| 0x08780100
|?
|?
|?
|?
| [[FS:UnregisterSpecialTitleContent|UnregisterSpecialTitleContent]]
| 0x80004
|-
|-
| 0x087900C2
| 0x087900C2
| ?
| ?
| Same as GetLegacyBannerData, except for the last parameter this passes u8 value 0x1 instead of 0x0, for the FSPXI command.
| Same as [[FS:GetLegacyBannerData|GetLegacyBannerData]], except for the last parameter this internally passes u8 value 0x1 instead of 0x0, for the FSPXI command.
| 0x00101015
| 0x101015
|-
|-
| 0x087A....
| 0x087A0180
| [[9.6.0-24|9.6.0-X]]
| [[9.6.0-24|9.6.0-X]]
| ?
| [[FS:AddSeed|AddSeed]]
| 0x00200000
| 0x200000
|-
|-
| 0x087B....
| 0x087B0080
| [[9.6.0-24|9.6.0-X]]
| [[9.6.0-24|9.6.0-X]]
| Wrapper for the code internally used for command <0x087A....>.
| [[FS:GetSeed|GetSeed]]
| 0x00200000
| 0x200000
|-
|-
| 0x087C....
| 0x087C0080
| [[9.6.0-24|9.6.0-X]]
| [[9.6.0-24|9.6.0-X]]
| Eventually calls same code as command <0x087A....>.
| [[FS:DeleteSeed|DeleteSeed]]
| 0x00200000
| 0x200000
|-
|-
| 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?
| [[FS:GetNumSeeds|GetNumSeeds]]
| 0x00200000
| 0x200000
|-
|-
| 0x087E0042
| 0x087E0042
| [[9.6.0-24|9.6.0-X]]
| [[9.6.0-24|9.6.0-X]]
| Eventually calls same code as command <0x087A....>. Writes a list of titleIDs to the outbuf, this is for titles with content-lock-seed(s) stored in SEEDDB. (u32 total_titleids_probably, ((Size<<4)  <nowiki>|</nowiki> 12), outbufptr)
| [[FS:ListSeeds|ListSeeds]]
| 0x00200000
| 0x200000
|-
|-
| 0x087F....
| 0x087F0100
| [[9.6.0-24|9.6.0-X]]
| [[9.6.0-24|9.6.0-X]]
| ?
| [[FS:TitleContentHasSeed|TitleContentHasSeed]]
| 0x00200000
| 0x200000
|-
|-
| 0x0880....
| 0x08800880
| [[9.6.0-24|9.6.0-X]]
| [[9.6.0-24|9.6.0-X]]
| Eventually calls same code as command <0x087A....>.
| [[FS:AddTitleTag|AddTitleTag]]
| 0x00200000
| 0x200000
|-
|-
| 0x0881....
| 0x08810080
| [[9.6.0-24|9.6.0-X]]
| [[9.6.0-24|9.6.0-X]]
| Eventually calls same code as command <0x087A....>.
| [[FS:GetTitleTag|GetTitleTag]]
| 0x00200000
| 0x200000
|-
|-
| 0x0882....
| 0x08820080
| [[9.6.0-24|9.6.0-X]]
| [[9.6.0-24|9.6.0-X]]
| Eventually calls same code as command <0x087A....>.
| [[FS:DeleteTitleTag|DeleteTitleTag]]
| 0x00200000
| 0x200000
|-
|-
| 0x08830000
| 0x08830000
| [[9.6.0-24|9.6.0-X]]
| [[9.6.0-24|9.6.0-X]]
| Writes an output value to cmdreply[2].
| [[FS:GetNumTitleTags|GetNumTitleTags]]
| 0x00200000
| 0x200000
|-
|-
| 0x08840042
| 0x08840042
| [[9.6.0-24|9.6.0-X]]
| [[9.6.0-24|9.6.0-X]]
| Eventually calls same code as command <0x087A....>.
| [[FS:ListTitleTags|ListTitleTags]]
| 0x00200000
| 0x200000
|-
|-
| 0x0885....
| 0x088500C0
| [[9.6.0-24|9.6.0-X]]
| [[9.6.0-24|9.6.0-X]]
| ?
| [[FS:CheckTitleSeed|CheckTitleSeed]]
| 0x00200000
| 0x200000
|-
| 0x088600C0
| [[11.1.0-34|11.1.0-X]]
| [[FS:CheckUpdatedDat|CheckUpdatedDat]]
| 0x80000
|}
|}


Line 693: Line 698:
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=
{{Anchor|FSLDR}}{{Anchor|fs:LDR}}
 
== Filesystem service "fs:LDR" ==
This service is identical to fs:USER, except [[FS:OpenArchive]] archive 0x2345678E can only be accessed with fs:LDR.
 
{{Anchor|FSReg}}{{Anchor|FSREG}}{{Anchor|fs:REG}}
== ProgramRegistry service "fs:REG" ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 700: Line 711:
|-
|-
| 0x000100C6
| 0x000100C6
| [[FSFile:Dummy1|Dummy1]]
| [[FSReg:Dummy1|Dummy1]]
|-
|-
| 0x040100C4
| 0x040103C0
| [[FSFile:Control|Control]]
| [[FSReg:Register|Register]]
|-
|-
| 0x08010100
| 0x04020040
| [[FSFile:OpenSubFile|OpenSubFile]]
| [[FSReg:Unregister|Unregister]]
|-
|-
| 0x080200C2
| 0x040300C0
| [[FSFile:Read|Read]]
| [[FSReg:GetProgramInfo|GetProgramInfo]]
|-
|-
| 0x08030102
| 0x04040100
| [[FSFile:Write|Write]]
| [[FSReg:LoadProgram|LoadProgram]]
|-
|-
| 0x08040000
| 0x04050080
| [[FSFile:GetSize|GetSize]]
| [[FSReg:UnloadProgram|UnloadProgram]]
|-
|-
| 0x08050080
| 0x04060080
| [[FSFile:SetSize|SetSize]]
| [[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]] and [[FS:OpenFileDirectly]] can be used to access files through a service-like interface, despite not being an actual service registered using [[SRV:RegisterService]]. To use this service-like interface, simply call the SendSyncRequest SVC with a file session handle, using the IPC buffer in thread-local storage for parameters and responses, just like you would with a proper service.
 
{| class="wikitable" border="1"
|-
|-
| 0x08060000
!  Command Header
| [[FSFile:GetAttributes|GetAttributes]]
!  Description
|-
|-
| 0x08070040
| 0x000100C6
| [[FSFile:SetAttributes|SetAttributes]]
| [[FSFile:Dummy1|Dummy1]]
|-
|-
| 0x08080000
| 0x040100C4
| [[FSFile:Close|Close]]
| [[FSFile:Control|Control]]
|-
|-
| 0x08090000
| 0x08010100
| [[FSFile:OpenSubFile|OpenSubFile]]
|-
| 0x080200C2
| [[FSFile:Read|Read]]
|-
| 0x08030102
| [[FSFile:Write|Write]]
|-
| 0x08040000
| [[FSFile:GetSize|GetSize]]
|-
| 0x08050080
| [[FSFile:SetSize|SetSize]]
|-
| 0x08060000
| [[FSFile:GetAttributes|GetAttributes]]
|-
| 0x08070040
| [[FSFile:SetAttributes|SetAttributes]]
|-
| 0x08080000
| [[FSFile:Close|Close]]
|-
| 0x08090000
| [[FSFile:Flush|Flush]]
| [[FSFile:Flush|Flush]]
|-
|-
Line 742: Line 786:
|-
|-
| 0x0C010100
| 0x0C010100
| ? (takes two u64(?), outputs u64)
| [[FSFile:GetAvailable|GetAvailable]]
|}
|}


=Directory service=
==Directories==
Directory session handles obtained via [[FS:OpenDirectory]] are usable via a service-like interface, following the exact same procedure described above for file sessions.
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 777: Line 822:
|}
|}


= 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"
{| class="wikitable" border="1"
|-
|-
Command Header
ArchiveId
!  Description
!  Description
!  Accessible via [[Filesystem_services|FS]]
!  Accessible via [[Filesystem_services_PXI|FSPXI]]
!  Only accessible by Process9 internally
!  Requires binary [[FS:OpenFile|Lowpath]]
!  Required exheader FS access info bitmask
|-
|-
| 0x000100C6
| 0x00000003
| [[FSReg:Dummy1|Dummy1]]
| SelfNCCH (including [[#RomFS|RomFS]])
| Yes
| No
| No
| No
| None
|-
|-
| 0x040103C0
| 0x00000004
| [[FSReg:Register|Register]]
| SaveData (the saveID/mediatype for this is loaded from data originally from the user process' exheader)
| Yes
| No
| No
| No
| None
|-
|-
| 0x04020040
| 0x00000006
| [[FSReg:Unregister|Unregister]]
| ExtSaveData
|-
| Yes
| 0x040300C0
| No
| [[FSReg:GetProgramInfo|GetProgramInfo]]
| No
| Yes
| 0x100D, when the input extdataID isn't listed in the exheader.
|-
|-
| 0x04040100
| 0x00000007
| [[FSReg:LoadProgram|LoadProgram]]
| Shared ExtSaveData
| Yes
| No
| No
| Yes
| None
|-
|-
| 0x04050080
| 0x00000008
| [[FSReg:UnloadProgram|UnloadProgram]]
| SystemSaveData
| Yes
| No
| No
| Yes
| 0x4, when the input saveID doesn't match the exheader system-saveID.
|-
|-
| 0x04060080
| 0x00000009
| [[FSReg:CheckHostLoadId|CheckHostLoadId]]
| SDMC
|}
| Yes
 
| Yes
Only one session can be opened for this service at a time, hence no other processes can use this due to [[Process_Manager_Services|pm-module]] using this.
| No
 
| No
=SEEDDB=
| 0x8E
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
| 0x0000000A
!  Description
| SDMC Write-Only
| Yes
| No
| No
| No
| 0x808E
|-
|-
| 0
| 0x12345678
| NAND
| ExtSaveData for BOSS
| Yes
| No
| No
| Yes
| 0x44
|-
|-
| 1
| 0x12345679
| SD
| CARD SPI FS
| Yes
| Yes
| No
| No
| 0x16
|-
|-
| 2
| 0x1234567B
| Game Card
| ExtSaveData, and ExtSaveData for BOSS
|}
| No
 
| Yes
== OpenFlags ==
| No
{| class="wikitable" border="1"
| Yes
|  
|-
|-
!  Bit
| 0x1234567C
!  Description
| SystemSaveData
| No
| Yes
| No
| Yes
|
|-
|-
| 0
| 0x1234567D
| Read
| NAND RW
| Yes
| Yes
| No
| No
| 0x800
|-
|-
| 1
| 0x1234567E
| Write
| NAND RO
| Yes
| Yes
| No
| No
| 0x200
|-
|-
| 2
| 0x1234567F
| Create
| NAND RO Write FS
|}
| No
 
| Yes
== Attributes ==
| No
{| class="wikitable" border="1"
| No
| ?
|-
|-
!  Offset
| 0x12345680
!  Size
| Extdata transfer. Used for transferring [[Extdata#NAND_Shared_Extdata|NAND Shared Extdata]] during [[System_Transfer#System_Save_Data_/_Shared_Extdata_Transfer|system tranfers]].
!  Description
| Yes
| Yes
| No
| Yes
| ?
|-
|-
| 0x0
| 0x12345681
| 0x1
| System Savedata transfer. Used for transferring [[System_SaveData|System Save Data]] during [[System_Transfer#System_Save_Data_/_Shared_Extdata_Transfer|system tranfers]].
| Is Directory
| Yes
| Yes
| No
| Yes
| ?
|-
|-
| 0x1
| 0x12345682
| 0x1
| Unknown. There's code for this in spider v9.9, but that code isn't actually used.
| Is Hidden
| Yes
| No
| No
| Yes
| ?
|-
|-
| 0x2
| 0x2345678A
| 0x1
| Title access. With FS, this allows accessing NCCH/NCSD contents (ExeFS, RomFS, checking if a content uses a seed, checking the validity of the installed seed). FSPXI, additionally, allows opening raw NCCH/NCSD NCCH contents and DSiWare contents for reading, along with encrypted save data.
| Is Archive
| Yes
| Yes
| No
| Yes
| 0x1005
|-
|-
| 0x3
| 0x2345678B
| 0x1
| Used internally by Process9 as the lowest level title access archive. Allows for opening various sections of a title (TMD, CMD, raw contents, DLC contents, raw save data (including public/private/banner saves for DSiWare), title and/or content import context files and /data directories for save data.
| Is Read-Only
| No
|}
| No
 
| Yes
== DirectoryEntry ==
| Yes
{| class="wikitable" border="1"
|  
|-
|-
!  Offset
| 0x2345678C
!  Size
| Used internally to access [[Title_Database|Title Database (/dbs)]] files. For SD, <code>title.db</code> and <code>import.db</code>. For NAND, <code>title.db</code>, <code>import.db</code>, <code>tmp_t.db</code>, <code>tmp_i.db</code>, and <code>jumpid.db</code>.
!  Description
| No
| No
| Yes
| Yes
|
|-
|-
| 0x0
| 0x2345678D
| 0x20C
| Used internally to access non-title /dbs files on the NAND: <code>certs.db</code> and <code>ticket.db</code>.
| UTF-16 Entry Name
| No
| No
| Yes
| No
|  
|-
|-
| 0x20C
| 0x2345678E
| 0xA
| 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.
| UTF-8 Short Name
| Yes
| Yes
| No
| Yes
| None, see description.
|-
|-
| 0x216
| 0x567890AB
| 0x4
| NAND CTR FS
| UTF-8 Extension
| No
| Yes
| No
| No
| ?
|-
|-
| 0x21A
| 0x567890AC
| 0x1
| TWL PHOTO
| Always 1
| Yes
| Yes
| No
| No
| ?
|-
|-
| 0x21B
| 0x567890AD
| 0x1
| TWLS (DSi Sound stores recordings here). This is mapped to the FAT12 image stored in the file at [[Twln/shared2/0000]].
| Reserved
| No
| Yes
| No
| No
| ?
|-
|-
| 0x21C
| 0x567890AE
| 0x4
| NAND TWL FS
| [[Filesystem_services#Attributes|Attributes]]
| Yes
| Yes
| No
| No
| 0x100
|-
|-
| 0x220
| 0x567890AF
| 0x8
| NAND W FS
| Entry Size
| Yes
|}
| Yes
 
| No
== ArchiveResource ==
| No
{| class="wikitable" border="1"
| 0x100
|-
|-
!  Offset
| 0x567890B0
!  Size
| Internally creates the same "ID Storage" wrapper over the NAND that is used for SystemSaveData and Shared ExtData, but all operations are stubbed and return 0xE0C046F8.
!  Description
| No
| Yes
| No
| No
|
|-
|-
| 0x0
| 0x567890B1
| 0x4
| Gamecard SaveData (for check). This is a wrapper for UserSaveDataForCheck: the OpenArchive code for that is called with archive-lowpath TID=0/mediatype=2(gamecard).
| Sector byte-size
| Yes
| No
| No
| No
| 0x6
|-
|-
| 0x4
| 0x567890B2
| 0x4
| 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.
| Cluster byte-size
| Yes
| No
| No
| Yes
| 0x6
|-
|-
| 0x8
| 0x567890B3
| 0x4
| [[3DS_Virtual_Console#NAND_Savegame|AGB Save Data]]
| Partition capacity in clusters
| No
|-
| No
| 0xC
| 0x4
| Available free space in clusters
|}
 
== ArchiveId ==
{| class="wikitable" border="1"
|-
!  Idcode
!  Description
!  Accessible via [[Filesystem_services|FS]]
!  Accessible via [[Filesystem_services_PXI|FSPXI]]
!  Requires binary [[FS:OpenFile|Lowpath]]
|-
| 0x00000003
| Application RomFS
| Yes
| Yes
| No
| No
| No
| -
|-
|-
| 0x00000004
| 0x567890B4
| SaveData (the saveID/mediatype for this is loaded from data originally from the user process' exheader)
| 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]].
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.
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 "/".
= Filenames and Paths =
{{Anchor|PathType}} PathType:
{| class="wikitable" border="1"
|-
|-
| 0x00000006
!  Value
| ExtSaveData
!  Description
| Yes
| No
| Yes
|-
|-
| 0x00000007
| -1
| Shared ExtSaveData
| 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.
| Yes
| No
| Yes
|-
|-
| 0x00000008
| 0x0
| SystemSaveData
| INVALID - Specifies an invalid path
| Yes
| No
| Yes
|-
|-
| 0x00000009
| 0x1
| SDMC
| EMPTY - Specifies an empty path
| Yes
| Yes
| No
|-
|-
| 0x0000000A
| 0x2
| SDMC Write-Only
| BINARY - Non-text based path. Meaning is per-archive
| Yes
| No
| No
|-
|-
| 0x12345678
| 0x3
| ExtSaveData for BOSS
| ASCII - Text-based path with 7-bit ASCII characters padded to 8-bits each (signed char)
| Yes
| No
| Yes
|-
|-
| 0x12345679
| 0x4
| CARD SPI FS
| UTF16 - Text-based path with UTF-16 characters
| Yes
|}
| Yes
 
| No
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.
 
=== SystemSaveData / Extdata / Shared Extdata Archive Path Data Format ===
 
==== DataAccessPath ====
 
{| class="wikitable" border="1"
|-
|-
| 0x1234567B
!  Offset !! Size !! Description
| ExtSaveData, and ExtSaveData for BOSS
| No
| Yes
| Yes
|-
|-
| 0x1234567C
| 0x0 || 0x1 || u8 [[Mediatypes|Mediatype]]
| SystemSaveData
| No
| Yes
| Yes
|-
|-
| 0x1234567D
| 0x1 || 0x1 || only for NAND data (System Savedata / Shared Extdata), otherwise left 0:
| NAND RW
{| class="wikitable" border="1"
| Yes
| Yes
| No
|-
|-
| 0x1234567E
! Value !! Description
| NAND RO
| Yes
| Yes
| No
|-
|-
| 0x1234567F
| 0 || Accesses from/to <code>nand:/data/<ID0 of current system></code>
| NAND RO Write FS
| No
| Yes
| No
|-
|-
| 0x12345682
| 1 || Accesses from/to <code>nand:/fixdata</code>
| Unknown. There's code for this in spider v9.9, but that code isn't actually used.
| Yes
| ?
| Yes
|-
|-
| 0x2345678A
| 2 || Accesses from/to <code>nand:/data/<ID0 from [[Filesystem_services#DeviceMoveContext|Device Move Context]]></code>
| User/GameCard SaveData (for check), and other uses (FS can only mount the latter; includes ExeFS and RomFS) (lo hi mediatype reserved)
|}
| Yes
| Yes
| Yes
|-
|-
| 0x2345678B
| 0x2 || 0x2 || padding
| ?
|}
| No
 
| No
==== SystemSaveData ====
| Yes
 
===== FS =====
 
====== Archive Path ======
{| class="wikitable" border="1"
|-
|-
| 0x2345678C
!  Index word
| ?
!  Description
| No
| No
| Yes
|-
|-
| 0x2345678D
| 0
| ?
| [[Filesystem_services#DataAccessPath|DataAccessPath]]
| No
| No
| No
|-
|-
| 0x2345678E
| 1
| FSPXI: Similar to archive 0x2345678A. For fs:LDR(used by the "loader" FIRM ARM11-process), only ExeFS. Not accessible with fs:USER.
| save ID low (save ID high is 0)
| Yes
|}
| Yes
 
| Yes
====== File Path ======
The file path is a cleartext ASCII or UTF16 file path (<code><file path></code>).
 
The file path would access the file at <code><base path>/sysdata/<save ID low>/<save ID high>/<file path></code>.
Note that <code>/<file path></code> refers to the virtual file system inside the </code><save ID high></code> file.
 
===== FSPXI / FS System Savedata Transfer / FSPXI System Savedata Transfer =====
 
====== Archive Path ======
{| class="wikitable" border="1"
|-
|-
| 0x567890AB
!  Index word
| NAND CTR FS
!  Description
| No
|-
| Yes
| 0
| No
| [[Filesystem_services#DataAccessPath|DataAccessPath]]
|}
 
====== File Path ======
{| class="wikitable" border="1"
|-
|-
| 0x567890AC
! Index word !! Description
| TWL PHOTO
| Yes
| Yes
| No
|-
|-
| 0x567890AD
| 0 || save ID low
| ?
| No
| Yes
| No
|-
|-
| 0x567890AE
| 1 || save ID high
| NAND TWL FS
|}
| Yes
 
| Yes
The file path would access the file at <code><base path>/sysdata/<save ID low>/<save ID high></code>.
| No
 
==== Extdata / Shared Extdata ====
 
===== FS / FS Extdata Transfer / FSPXI Extdata Transfer =====
 
====== Archive Path ======
{| class="wikitable" border="1"
|-
!  Index word
!  Description
|-
|-
| 0x567890AF
| 0
| NAND W FS
| [[Filesystem_services#DataAccessPath|DataAccessPath]]
| Yes
| Yes
| No
|-
|-
| 0x567890B0
| 1
| ?
| ext save ID low
| No
| Yes
| No
|-
|-
| 0x567890B1
| 2
| Gamecard SaveData (for check). This is a wrapper for UserSaveDataForCheck: the OpenArchive code for that is called with archive-lowpath TID=0/mediatype=2(gamecard).
| ext save ID high
| Yes
| No
| No
|-
| 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.
| Yes
| No
| Yes
|-
| 0x567890B4
| ? SaveData from Demo Version of Retail Game
| Yes
| No
| No
|}
|}


Archives listed as not requiring a binary lowpath, use lowpath type [[FS:OpenFile|empty]].
This refers to the extdata filesystem structure's base directory at <code><base path>/extdata/<ext save ID low>/<ext save ID high></code>.
 
====== File Path ======
The file path is a cleartext ASCII or UTF16 file path (<code><file path></code>).


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.
For FS Extdata, this would acccess <code><base path>/extdata/<save ID low>/<save ID high>/<directory ID>/<file ID>/<file path></code>, and <code>/<file path></code> refers to the virtual file system inside the </code><file ID></code> file.


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 "/".
For FS / FSPXI Extdata Transfer, this accesses <code><base path>/extdata/<save ID low>/<save ID high>/<file path></code>.


== PathType ==
=== UserSaveDataForCheck Archive Path Data Format ===
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Value
Index word
!  Description
!  Description
|-
|-
| 0x0
| 0
| INVALID - Specifies an invalid path.
| [[Mediatypes|Mediatype]] (must be non-zero)
|-
|-
| 0x1
| 1
| EMPTY - Specifies an empty path.
| Lower word saveid
|-
|-
| 0x2
| 2
| BINARY - Non-text based path. Meaning is per-archive.
| Upper word saveid
|-
| 0x3
| CHAR - Text-based path with 8-bit characters.
|-
| 0x4
| WCHAR - Text-based path with 16-bit characters.
|}
|}


=== Binary LowPath ===
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.
The format of the data that a binary LowPath points to is custom per archive.


==== SystemSaveData Archive Path Data Format ====
=== 0x567890B4 Archive Path Data Format ===
===== FS =====
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,155: Line 1,255:
|-
|-
| 0  
| 0  
| [[Mediatypes|Mediatype]] (must be zero for NAND)
| [[Mediatypes|Mediatype]]
|-
|-
| 1
| 1
| saveid
| <code><nowiki>Lower_word_saveid >> 8</nowiki></code> ?
|-
| 2
| Unknown. Game calculate this using formula <code><nowiki>0xFFFFFF00 | unknown_b</nowiki></code>
|}
|}
The file/directory lowpath is a text lowpath in the [[Savegames|savegame]] filesystem.


===== FSPXI =====
=== Title Access Archive Path Data Format ===
==== Title Access Type ====
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Index word
! Value !! Description
! Description
|-
| 0 || High-level NCCH content access
|-
| 1 || Save data access (high-level, decrypted)
|-
| 2 || Raw content (low-level NCCH/SRL) access
|-
| 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)")
|-
|-
| 0
| 5 || Save data access (low-level, encrypted)
| u8 [[Mediatypes|Mediatype]] (must be zero for NAND)
|}
|}
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 ====
==== NCCH Access Type ====
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Index word
! Value !! Description
! Description
|-
| 0 || RomFS
|-
|-
| 0
| 1 || <code>exefs:/.code</code>
| [[Mediatypes|Mediatype]] (must be non-zero)
|-
| 2 || System Menu Data (<code>exefs:/icon</code>, <code>exefs:/banner</code>, <code>exefs:/logo</code>)
|-
| 3 || NCCH Header(s)
|-
|-
| 1
| 4 || "is seeded" check
| Lower word saveid
|-
|-
| 2
| 5 || Seed verify/validate
| Upper word saveid
|}
|}
The file/directory lowpath for this FS archive is a text path in the [[Savegames|savegame]] filesystem.


==== ExtSaveData Archive Path Data Format ====
==== NCCH Header Access Type ====
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Index word
! Value !! Description
! Description
|-
|-
| 0  
| 0 || [[NCCH/Extended_Header|Extheader]] (0x0-0x400)
| [[Mediatypes|Mediatype]]
|-
|-
| 1
| 1 || [[NCCH/Extended_Header|Extheader]] AccessDesc (0x400-0x800)
| Lower word saveid
|-
|-
| 2
| 2 || Raw [[NCCH#NCCH_Header|NCCH Header]]
| Upper word saveid
|}
|}
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.


==== [[RomFS]] ====
==== Archive Path ====
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. This allows access to the raw level-3 IVFC image: the user process must handle parsing the filesystem used in this image itself.


In this scenario, OpenFile returns a handle to the RomFS archive.
== ProgramInfo ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset
! Offset !! Size !! Description
! Size
|-
! Description
| 0x0 || 0x8 || Program ID (Title ID)
|-
|-
| 0x0
| 0xB || 0x1 || [[Mediatypes|Media Type]]
| 0x8
| Program ID
|-
|-
| 0x8
| 0xC || 0x4 || padding
| 0x1
| [[Filesystem_services#MediaType|Media Type]]
|-
| 0xC
| 0x4
| Reserved
|}
|}


== ProductInfo ==
==== File Path ====
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset
! Offset !! Size !! Description
! Size
! Description
|-
| 0x0
| 0x10
| Product Code
|-
|-
| 0x10
| 0x0 || 0x4 || [[Filesystem_services#Title_Access_Type|Title Access Type]]
| 0x2
| Company Code
|-
|-
| 0x12
| 0x4 || 0x10 || Dynamic data depending on [[Filesystem_services#Title_Access_Type|Title Access Type]]:
| 0x2
| Remaster Version
|}


== IntegrityVerificationSeed ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset
! High Level NCCH Access !! Save Data Access (high level) !! Raw Content !! FS only: Save Data Transfer
! Size
|-
! Description
|
{| class="wikitable" border="1"
|-
! Offset !! Size !! Description
|-
| 0x0 || 0x4 || Content index from TMD for NAND/SD titles
NCSD partition index for gamecards
|-
|-
| 0x0
| 0x4 || 0x4 || [[Filesystem_services#NCCH_Access_Type|NCCH Access Type]]
| 0x10
| AES-CBC MAC over a SHA256 hash, which hashes the first 0x110-bytes of the cleartext SEED.
|-
|-
| 0x10
| 0x8 || 0x8 || Dynamic data depending on [[Filesystem_services#NCCH_Access_Type|NCCH Access Type]]:
| 0x120
For ExeFS, (System Menu Data / <code>exefs:/.code</code>),
| The [[nand/private/movable.sed]], encrypted with AES-CTR using the above MAC for the counter.
 
{| class="wikitable" border="1"
| 8-byte ExeFS file name
|}
 
For Header Access,
 
{| class="wikitable" border="1"
| [[Filesystem_services#NCCH_Header_Access_Type|u64, NCCH Header Access Type]]
|}
|}


== ExtSaveDataInfo ==
For RomFS,
 
{| class="wikitable" border="1"
{| class="wikitable" border="1"
| [[NCCH#Content_Types|u64, Allowed content types flag]]
(<code>(1 << allowed_type_a) |
(1 << allowed_type_b)...</code>)
|}
|}
|
{| class="wikitable" border="1"
|-
|-
! Offset
! Offset !! Size !! Description
! Size
! Description
|-
|-
| 0x0
| 0x0 || 0x10 || 16-byte IV for save data crypto
| 0x1
|}
| [[Filesystem_services#MediaType|Media Type]]
|
{| class="wikitable" border="1"
|-
|-
| 0x1
! Offset !! Size !! Description
| 0x1
| Unknown
|-
|-
| 0x2
| 0x0 || 0x4 || Content index from TMD for NAND/SD titles
| 0x2
NCSD partition index for gamecards
| Reserved
|-
|-
| 0x4
| 0x4 || 0xC || padding
| 0x8
| Save ID
|-
| 0xC
| 0x4
| Reserved
|}
|}
 
|
== SystemSaveDataInfo ==
{| class="wikitable" border="1"  
{| class="wikitable" border="1"
|-
|-
! Offset
! Offset !! Size !! Description
! Size
! Description
|-
|-
| 0x0
| 0x0 || 0x4 || Save data transfer key from [[FS:BeginSaveDataMove]]
| 0x1
| [[Filesystem_services#MediaType|Media Type]]
|-
|-
| 0x1
| 0x4 || 0xC || padding
| 0x1
|}
| Unknown
|}
|-
|-
| 0x2
| 0x14 || 0x10 || 16-byte seed for titles that require one, or for validating a seed against the check value in the [[NCCH#NCCH_Header|NCCH Header]]'s check value.
| 0x2
If the title does not use a seed, this should not be included and size 0x14 should be used instead of 0x24.
| Reserved
|-
| 0x4
| 0x4
| Save ID
|}
|}


== SecureValueSlot ==
For encrypted save data access and banner save data access, the entire 0x10 portion of the dynamic data is left blank.
 
The "is seeded check" NCCH access type opens a virtual 1-byte file that reads either 0 or 1; this value is generated on-the-fly and will be 1 if ncchflags[7] has bit5 set (content uses seed), and 0 otherwise.
 
For NCCH sections that require a seed (e.g. <code>.code</code>, RomFS, etc.), the additional seed portion of the low path must be populated with the correct seed.
 
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"
{| class="wikitable" border="1"
|-
|-
! Value
! Value !! Description !! Accesses
! Description
|-
| 0 || RomFS ("unspecified" [[NCCH#Content_Type|content type]], the default) || Base title
|-
| 1 || <code>exefs:/.code</code> || Patch title
|-
|-
| 0x1000
| 2 || System Menu Data (<code>exefs:/icon</code>, <code>exefs:/banner</code>, <code>exefs:/logo</code>) || Base title
| SD Application
|-
| 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
|}
|}


== CardSpiBaudRate ==
==== Archive Path ====
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value
! Offset !! Size !! Description
! Description
|-
|-
| 0x0
| 0x0 || 0x8 || u64, Program Handle from [[PXIPM:RegisterProgram]]
| 512KHz
|}
 
==== File Path ====
{| class="wikitable" border="1"
|-
|-
| 0x1
! Offset !! Size !! Description
| 1MHz
|-
|-
| 0x2
| 0x0 || 0x4 || [[Filesystem_services#Program_Access_Type|Program Access Type]]
| 2MHz
|-
|-
| 0x3
| 0x4 || 0x8 || Dynamic data depending on [[Filesystem_services#Program_Access_Type|Program Access Type]]:
| 4MHz
{| class="wikitable" border="1"
|-
|-
| 0x4
! ExeFS files (System Menu Data, etc.) !! RomFS of base title (all [[NCCH#Content_Type|content types]])
| 8MHz
|-
|-
| 0x5
|
| 16MHz
{| class="wikitable" border="1"
| 8-character ExeFS filename
|}
|}
 
|
== CardSpiBusMode ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Offset !! Size !! Description
!  Value
|-
!  Description
| 0x0 || 0x4 || u32, content index of target content
|-
|-
| 0x0
| 0x4 || 0x4 || padding
| 1-bit
|}
|-
|}
| 0x1
|}
| 4-bit
 
|}
==== FS Limitations ====
 
 
== SpecialContentType ==
- FSPXI allows all access types.
{| class="wikitable" border="1"
 
|-
- When used through fs:LDR by loader, FS only provides access to <code>exefs:/.code</code>.
!  Value
 
!  Description
- 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.
|-
 
| 0x1
=== [[RomFS]] ===
| Update
 
|-
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.
| 0x2
 
| Manual
With FSPXI the returned data for RomFS is the entire RomFS section from the NCCH, starting at the IVFC header.
|-
 
| 0x3
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:
| DLP Child
{| class="wikitable" border="1"
|}
|-
 
!  Index word
== DeviceMoveContext ==
!  Description
|-
| 0
| See above. The only values which FS-module doesn't allow to be used here are:
* 0x1: Error 0xE0E046BE.
* 0x3: Error 0xE0E046BE.
* 0x4: FS-module executes svcBreak when using this.
|-
| 1-2
| 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
|}
 
== ProgramInfo ==
{| class="wikitable" border="1"
|-
!  Offset
!  Size
!  Description
|-
| 0x0
| 0x8
| Program ID
|-
| 0x8
| 0x1
| [[Filesystem_services#MediaType|Media Type]]
|-
| 0x9
| 0x7
| Padding
|}
 
== ProductInfo ==
{| class="wikitable" border="1"
|-
!  Offset
!  Size
!  Description
|-
| 0x0
| 0x10
| Product Code
|-
| 0x10
| 0x2
| Company Code
|-
| 0x12
| 0x2
| Remaster Version
|}
 
== IntegrityVerificationSeed ==
{| class="wikitable" border="1"
|-
!  Offset
!  Size
!  Description
|-
|  0x0
|  0x10
|  AES-CBC MAC over a SHA256 hash, which hashes the first 0x110-bytes of the cleartext SEED.
|-
|  0x10
|  0x120
|  The [[nand/private/movable.sed]], encrypted with AES-CBC using the above MAC for the counter.
|}
 
== ExtSaveDataInfo ==
{| class="wikitable" border="1"
|-
!  Offset
!  Size
!  Description
|-
| 0x0
| 0x4
| [[Filesystem_services#DataAccessPath|DataAccessPath]]
|-
| 0x4
| 0x8
| Save ID
|-
| 0xC
| 0x4
| Reserved
|}
 
== SystemSaveDataInfo ==
{| class="wikitable" border="1"
|-
!  Offset
!  Size
!  Description
|-
| 0x0
| 0x4
| [[Filesystem_services#DataAccessPath|DataAccessPath]]
|-
| 0x4
| 0x4
| Save ID
|}
 
== SecureValueSlot ==
{| class="wikitable" border="1"
|-
!  Value
!  Description
|-
| 0x1000
| SD Application
|}
 
== SecureValueEntry ==
{| class="wikitable" border="1"
|-
! Offset !! Size !! Description
|-
| 0x0 || 0x4 || u32, [[Filesystem_services#SecureValueSlot|Secure Value Slot]]
|-
| 0x4 || 0x1 || When used as an input entry:
{| class="wikitable" border="1"
|-
! Value !! Description
|-
| 0 || This entry should be removed.
|-
| 1 || This entry should be updated with the given value.
|}
When returned from a command:
{| class="wikitable" border="1"
|-
! Value !! Description
|-
| 0 || No entry with the given slot and title ID was found, or: this entry is unused.
|-
| 1 || The entry with the given slot and title ID was found, or: this entry is used.
|}
|-
| 0x5 || 0x3 || padding
|-
| 0x8 || 0x8 || u64, Secure Value
|}
 
== TitleTag ==
{| class="wikitable" border="1"
|-
! Offset !! Size !! Description
|-
| 0x0 || 0x4 || Magic, <code>PREP</code> (PREPurchase install)
|-
| 0x4 || 0x4 || s32, Release date year
|-
| 0x8 || 0x1 || u8, Release date month
|-
| 0x9 || 0x1 || u8, Release date day
|-
| 0xA || 0x2 || u16, Country code
|-
| 0xC || 0x4 || u32, Seed status (0: not downloaded yet, 1: last download attempt failed, 2: seed installed successfully)
|-
| 0x10 || 0x4 || Result code from last seed installation attempt
|-
| 0x14 || 0x4 || Support error code from last seed installation attempt
|-
| 0x18 || 0x68 || reserved padding (unused)
|}
 
== CardSpiBaudRate ==
{| class="wikitable" border="1"
|-
!  Value
!  Description
|-
| 0x0
| 512KHz
|-
| 0x1
| 1MHz
|-
| 0x2
| 2MHz
|-
| 0x3
| 4MHz
|-
| 0x4
| 8MHz
|-
| 0x5
| 16MHz
|}
 
== CardSpiBusMode ==
{| class="wikitable" border="1"
|-
!  Value
!  Description
|-
| 0x0
| 1-bit
|-
| 0x1
| 4-bit
|}
 
== SpecialContentType ==
{| class="wikitable" border="1"
|-
!  Value
!  Description
!  Found in
|-
| 0x1
| CTR (Old3DS) Update Partition
| Gamecards
|-
| 0x2
| Manual
| Gamecards, Digital titles
|-
| 0x3
| DLP Child
| Gamecards, Digital titles
|-
| 0x4
| KTR (New3DS) Update Partition
| Gamecards
|-
|}
 
== DeviceMoveContext ==
{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
Line 1,393: Line 1,907:
|  0x0
|  0x0
|  0x10
|  0x10
|  IVs
|  IVs (ID0 of source console)
|-
|-
|  0x10
|  0x10
|  0x10
|  0x10
|  Encrypt Parameter
|  Encrypt Parameter (used to calculate the IV for encryption)
|}
|}


=Errors=
=Errors=
See [[Filesystem_services_PXI]].
See [[Filesystem_services_PXI]].
[[Category:Services]]