Filesystem services: Difference between revisions

No edit summary
 
(One intermediate revision by the same user not shown)
Line 758: Line 758:


== ReadSaveDataFileSystemExtraDataBySaveDataSpaceId ==
== ReadSaveDataFileSystemExtraDataBySaveDataSpaceId ==
Takes an input u8 [[#SaveDataSpaceId]], an input u64 saveID, and a type-0x6 output buffer containing the [[#SaveDataFileSystemExtraData]].
Takes an input u8 [[#SaveDataSpaceId]], an input u64 saveID, and a type-0x6 output buffer containing the [[#SaveDataExtraData]].


== ReadSaveDataFileSystemExtraData ==
== ReadSaveDataFileSystemExtraData ==
Takes an input u64 saveID and a type-0x6 output buffer containing the [[#SaveDataFileSystemExtraData]].
Takes an input u64 saveID and a type-0x6 output buffer containing the [[#SaveDataExtraData]].


== OpenSaveDataInfoReader ==
== OpenSaveDataInfoReader ==
Line 1,440: Line 1,440:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#GetChallenge]]
| 0 || [[#GetChallenge|GetChallenge]]
|-
|-
| 16 || [[#SetToken]]
| 16 || [[#SetToken|SetToken]]
|-
|-
| 32 || [[#OpenSaveDataExporter]]
| 32 || [[#OpenSaveDataExporter|OpenSaveDataExporter]]
|-
|-
| 64 || [[#OpenSaveDataImporter]]
| 64 || [[#OpenSaveDataImporter|OpenSaveDataImporter]]
|}
|}


== GetChallenge ==
== GetChallenge ==
No input/output, takes a type-0x6 output buffer.
Takes a type-0x6 output buffer. No output.


== SetToken ==
== SetToken ==
No input/output, takes a type-0x5 input buffer.
Takes a type-0x5 input buffer. No output.


== OpenSaveDataExporter ==
== OpenSaveDataExporter ==
Takes an input u8 [[#SaveDataSpaceId]] and u64, returns an [[#ISaveDataExporter]].
Takes an input u8 [[#SaveDataSpaceId]] and u64. Returns an [[#ISaveDataExporter]].


== OpenSaveDataImporter ==
== OpenSaveDataImporter ==
Line 1,470: Line 1,470:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#GetChallenge]]
| 0 || [[#GetChallenge|GetChallenge]]
|-
|-
| 16 || [[#SetKeyPackage]]
| 16 || [[#SetKeyPackage|SetKeyPackage]]
|-
|-
| 80 || [[#OpenSaveDataExporterAndGetEncryptedKey]]
| 80 || [[#OpenSaveDataExporterAndGetEncryptedKey|OpenSaveDataExporterAndGetEncryptedKey]]
|-
|-
| 81 || [[#PrepareOpenSaveDataImporter]]
| 81 || [[#PrepareOpenSaveDataImporter|PrepareOpenSaveDataImporter]]
|-
|-
| 90 || [[#OpenSaveDataImporter]]
| 90 || [[#OpenSaveDataImporter_2|OpenSaveDataImporter]]
|-
|-
| 91 || [[#OpenSaveDataImporter2]]
| 91 || [[#OpenSaveDataImporter2|OpenSaveDataImporter2]]
|-
|-
| 100 || [[#OpenSaveDataExporterWithKey]]
| 100 || [[#OpenSaveDataExporterWithKey|OpenSaveDataExporterWithKey]]
|-
|-
| 110 || [[#OpenSaveDataImporterWithKey]]
| 110 || [[#OpenSaveDataImporterWithKey|OpenSaveDataImporterWithKey]]
|}
|}


== SetKeyPackage ==
== SetKeyPackage ==
No input/output, takes a type-0x5 input buffer.
Takes a type-0x5 input buffer. No output.  


== OpenSaveDataExporterAndGetEncryptedKey ==
== OpenSaveDataExporterAndGetEncryptedKey ==
Line 1,494: Line 1,494:


== PrepareOpenSaveDataImporter ==
== PrepareOpenSaveDataImporter ==
Takes a type-0x1A output buffer to receive a RsaEncryptedKey.
Takes a type-0x1A output buffer to receive a RsaEncryptedKey. No output.


== OpenSaveDataImporter ==
== OpenSaveDataImporter ==
Takes a total of 0x18-bytes of input and two type-0x5 input buffers, returns an [[#ISaveDataDivisionImporter]].
Takes a total of 0x18-bytes of input and two type-0x5 input buffers. Returns an [[#ISaveDataDivisionImporter]].


== OpenSaveDataImporter2 ==
== OpenSaveDataImporter2 ==
Takes a total of 0x18-bytes of input and a type-0x5 input buffer, returns an [[#ISaveDataDivisionImporter]].
Takes a total of 0x18-bytes of input and a type-0x5 input buffer. Returns an [[#ISaveDataDivisionImporter]].


== OpenSaveDataExporterWithKey ==
== OpenSaveDataExporterWithKey ==
Takes a total of 0x20-bytes of input, returns an [[#ISaveDataDivisionExporter]].
Takes a total of 0x20-bytes of input. Returns an [[#ISaveDataDivisionExporter]].


== OpenSaveDataImporterWithKey ==
== OpenSaveDataImporterWithKey ==
Takes a total of 0x28-bytes of input and a type-0x5 input buffer, returns an [[#ISaveDataDivisionImporter]].
Takes a total of 0x28-bytes of input and a type-0x5 input buffer. Returns an [[#ISaveDataDivisionImporter]].


[17.0.0+] Now only takes 0x18-bytes of input and an additional type-0x5 input buffer.
[17.0.0+] Now only takes 0x18-bytes of input and an additional type-0x5 input buffer.
Line 1,519: Line 1,519:
! Cmd || Name
! Cmd || Name
|-
|-
| 8 || [[#Register]]
| 8 || [[#Register|Register]]
|-
|-
| 16 || [[#Process]]
| 16 || [[#Process|Process]]
|-
|-
| 18 || [[#Cancel]]
| 18 || [[#Cancel|Cancel]]
|}
|}


== Register ==
== Register ==
Takes an input u64, no output.
Takes an input u64. No output.


== Process ==
== Process ==
Takes an input u64, returns an output u64.
Takes an input u64. Returns an output u64.


== Cancel ==
== Cancel ==
Line 1,544: Line 1,544:
! Cmd || Name
! Cmd || Name
|-
|-
| 80 || [[#OpenSaveDataExporter]]
| 80 || [[#OpenSaveDataExporter_2|OpenSaveDataExporter]]
|-
|-
| 90 || [[#OpenSaveDataImporter]]
| 90 || [[#OpenSaveDataImporter_3|OpenSaveDataImporter]]
|}
|}


== OpenSaveDataExporter ==
== OpenSaveDataExporter ==
Takes a total of 0x10-bytes of input, returns an [[#ISaveDataDivisionExporter]].
Takes a total of 0x10-bytes of input. Returns an [[#ISaveDataDivisionExporter]].


== OpenSaveDataImporter ==
== OpenSaveDataImporter ==
Takes 1-byte of input, a type-0x5 input buffer, returns an [[#ISaveDataDivisionImporter]].
Takes 1-byte of input, a type-0x5 input buffer. Returns an [[#ISaveDataDivisionImporter]].


= ISaveDataExporter =
= ISaveDataExporter =
Line 1,564: Line 1,564:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#GetSaveDataInfo]]
| 0 || [[#GetSaveDataInfo|GetSaveDataInfo]]
|-
|-
| 1 || [[#GetRestSize]]
| 1 || [[#GetRestSize|GetRestSize]]
|-
|-
| 16 || [[#Pull]]
| 16 || [[#Pull|Pull]]
|-
|-
| 17 || [[#PullInitialData]]
| 17 || [[#PullInitialData|PullInitialData]]
|}
|}


== GetSaveDataInfo ==
== GetSaveDataInfo ==
No input/output, takes a type-0x1A [[#SaveDataInfo]] output buffer.
Takes a type-0x1A [[#SaveDataInfo]] output buffer. No output.


The actual name for this is the SaveDataExporter constructor. This is used automatically after [[#OpenSaveDataExporter]] by official sw.
The actual name for this is the SaveDataExporter constructor. This is used automatically after [[#OpenSaveDataExporter]] by official sw.


== GetRestSize ==
== GetRestSize ==
No input, returns an output u64.
No input. Returns an output u64.


== Pull ==
== Pull ==
Takes a type-0x6 output buffer, returns an output u64.
Takes a type-0x6 output buffer. Returns an output u64.


== PullInitialData ==
== PullInitialData ==
No input/output, takes a type-0x6 output buffer.
Takes a type-0x6 output buffer. No output.


= ISaveDataImporter =
= ISaveDataImporter =
Line 1,596: Line 1,596:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#GetSaveDataInfo]]
| 0 || [[#GetSaveDataInfo_2|GetSaveDataInfo]]
|-
|-
| 1 || [[#GetRestSize]]
| 1 || [[#GetRestSize_2|GetRestSize]]
|-
|-
| 16 || [[#Push]]
| 16 || [[#Push|Push]]
|-
|-
| 17 || [[#Finalize]]
| 17 || [[#Finalize|Finalize]]
|}
|}


== GetSaveDataInfo ==
== GetSaveDataInfo ==
No input/output, takes a type-0x1A [[#GetSaveDataInfo]] output buffer.
Takes a type-0x1A [[#GetSaveDataInfo]] output buffer. No output.


The actual name for this is the SaveDataImporter constructor. This is used automatically after [[#OpenSaveDataImporter]] by official sw.
The actual name for this is the SaveDataImporter constructor. This is used automatically after [[#OpenSaveDataImporter]] by official sw.


== GetRestSize ==
== GetRestSize ==
No input, returns an output u64.
No input. Returns an output u64.


== Push ==
== Push ==
No input/output, takes a type-0x5 input buffer.
Takes a type-0x5 input buffer. No output.


== Finalize ==
== Finalize ==
Line 1,628: Line 1,628:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#GetChallenge]]
| 0 || [[#GetChallenge_2|GetChallenge]]
|-
|-
| 8 || [18.0.0+] SetMode
| 8 || [18.0.0+] SetMode
Line 1,634: Line 1,634:
| 9 || [18.0.0+] SetAttribute
| 9 || [18.0.0+] SetAttribute
|-
|-
| 16 || [[#SetKeySeedPackage]]
| 16 || [[#SetKeySeedPackage_2|SetKeySeedPackage]]
|-
|-
| 17 || [20.0.0+] [[#SetLocalKeySeedPackage|SetLocalKeySeedPackage]]
| 17 || [20.0.0+] [[#SetLocalKeySeedPackage|SetLocalKeySeedPackage]]
|-
|-
| 32 || [[#OpenSaveDataExporter]]
| 32 || [[#OpenSaveDataExporter_3|OpenSaveDataExporter]]
|-
|-
| 33 || [[#OpenSaveDataExporterForDiffExport]]
| 33 || [[#OpenSaveDataExporterForDiffExport|OpenSaveDataExporterForDiffExport]]
|-
|-
| 34 || [6.0.0+] [[#OpenSaveDataExporterByContext]]
| 34 || [6.0.0+] [[#OpenSaveDataExporterByContext|OpenSaveDataExporterByContext]]
|-
|-
| 63 || [17.0.0+] OpenSaveDataImporter
| 63 || [17.0.0+] [[#OpenSaveDataImporter_4|OpenSaveDataImporter]]
|-
|-
| 64 || [6.0.0-17.0.1] [[#OpenSaveDataImporterDeprecated]] ([5.0.0-5.1.0] OpenSaveDataImporter)
| 64 || [6.0.0-17.0.1] [[#OpenSaveDataImporterDeprecated|OpenSaveDataImporterDeprecated]] ([5.0.0-5.1.0] OpenSaveDataImporter)
|-
|-
| 65 || [5.0.0-17.0.1] [[#OpenSaveDataImporterForDiffImport]]
| 65 || [5.0.0-17.0.1] [[#OpenSaveDataImporterForDiffImport|OpenSaveDataImporterForDiffImport]]
|-
|-
| 66 || [6.0.0-17.0.1] [[#OpenSaveDataImporterForDuplicateDiffImport]]
| 66 || [6.0.0-17.0.1] [[#OpenSaveDataImporterForDuplicateDiffImport|OpenSaveDataImporterForDuplicateDiffImport]]
|-
|-
| 67 || [6.0.0-16.1.0] [[#OpenSaveDataImporter]]
| 67 || [6.0.0-16.1.0] [[#OpenSaveDataImporter_5|OpenSaveDataImporter]]
|-
|-
| 68 || [6.0.0+] [[#OpenSaveDataImporterByContext]]
| 68 || [6.0.0+] [[#OpenSaveDataImporterByContext|OpenSaveDataImporterByContext]]
|-
|-
| 69 || [6.0.0+] [[#CancelSuspendingImport]]
| 69 || [6.0.0+] [[#CancelSuspendingImport|CancelSuspendingImport]]
|-
|-
| 70 || [10.0.0+] CancelSuspendingImportByAttribute
| 70 || [10.0.0+] CancelSuspendingImportByAttribute
Line 1,664: Line 1,664:


== GetChallenge ==
== GetChallenge ==
No input/output, takes a type-0x6 output buffer containing the '''Challenge'''.
Takes a type-0x6 output buffer containing the '''Challenge'''. No output.


== SetKeySeedPackage ==
== SetKeySeedPackage ==
No input/output, takes a type-0x5 input buffer containing the '''KeySeedPackage'''.
Takes a type-0x5 input buffer containing the '''KeySeedPackage'''. No output.


== SetLocalKeySeedPackage ==
== SetLocalKeySeedPackage ==
No input/output, takes a type-0x5 input buffer containing a [[#LocalKeySeedPackage|LocalKeySeedPackage]].
Takes a type-0x5 input buffer containing a [[#LocalKeySeedPackage|LocalKeySeedPackage]]. No output.


This can only be used after [[#SetKeySeedPackage]], in certain conditions.
This can only be used after [[#SetKeySeedPackage]], in certain conditions.
Line 1,681: Line 1,681:


== OpenSaveDataExporterByContext ==
== OpenSaveDataExporterByContext ==
No input/output, takes a type-0x5 input buffer, returns an [[#ISaveDataDivisionExporter]].
Takes a type-0x5 input buffer. Returns an [[#ISaveDataDivisionExporter]].
 
== OpenSaveDataImporter ==
Takes an input u8 [[#SaveDataSpaceId]], a type-0x19 input buffer containing a [[#SaveDataCreationInfo2]] and a type-0x5 input buffer containing an [[#InitialDataVersion2]]. Returns an [[#ISaveDataDivisionImporter]].


== OpenSaveDataImporterDeprecated ==
== OpenSaveDataImporterDeprecated ==
Takes an input u8 [[#SaveDataSpaceId]], a 0x10-byte userID, and a type-0x5 input buffer [[#InitialDataVersion2]]. Returns an [[#ISaveDataDivisionImporter]].
Takes an input u8 [[#SaveDataSpaceId]], a 0x10-byte userID, and a type-0x5 input buffer containing an [[#InitialDataVersion2]]. Returns an [[#ISaveDataDivisionImporter]].


== OpenSaveDataImporterForDiffImport ==
== OpenSaveDataImporterForDiffImport ==
Takes an input u8 [[#SaveDataSpaceId]], an u64, and a type-0x5 input buffer [[#InitialDataVersion2]], returns an [[#ISaveDataDivisionImporter]].
Takes an input u8 [[#SaveDataSpaceId]], an u64, and a type-0x5 input buffer [[#InitialDataVersion2]]. Returns an [[#ISaveDataDivisionImporter]].


== OpenSaveDataImporterForDuplicateDiffImport ==
== OpenSaveDataImporterForDuplicateDiffImport ==
Takes an input u8 and an u64, and a type-0x5 input buffer, returns an [[#ISaveDataDivisionImporter]].
Takes an input u8 and an u64, and a type-0x5 input buffer. Returns an [[#ISaveDataDivisionImporter]].


== OpenSaveDataImporter ==
== OpenSaveDataImporter ==
Takes an input u8, an u8(bool), a 0x10-byte struct, and a type-0x5 input buffer, returns an [[#ISaveDataDivisionImporter]].
Takes an input u8, an u8(bool), a 0x10-byte struct, and a type-0x5 input buffer. Returns an [[#ISaveDataDivisionImporter]].


== OpenSaveDataImporterByContext ==
== OpenSaveDataImporterByContext ==
No input/output, takes a type-0x5 input buffer, returns an [[#ISaveDataDivisionImporter]].
No input/output, takes a type-0x5 input buffer. Returns an [[#ISaveDataDivisionImporter]].


== CancelSuspendingImport ==
== CancelSuspendingImport ==
Takes an input u64 and a 0x10-byte struct, no output.
Takes an input u64 and a 0x10-byte struct. No output.


= ISaveDataDivisionExporter =
= ISaveDataDivisionExporter =
Line 1,710: Line 1,713:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#SetDivisionCount]]
| 0 || [[#SetDivisionCount|SetDivisionCount]]
|-
|-
| 1 || [6.0.0+] [[#ReadSaveDataExtraData]]
| 1 || [6.0.0+] [[#ReadSaveDataExtraData|ReadSaveDataExtraData]]
|-
|-
| 16 || [[#OpenSaveDataDiffChunkIterator]]
| 16 || [[#OpenSaveDataDiffChunkIterator|OpenSaveDataDiffChunkIterator]]
|-
|-
| 48 || [[#OpenSaveDataChunkExporter]]
| 48 || [[#OpenSaveDataChunkExporter|OpenSaveDataChunkExporter]]
|-
|-
| 64 || [6.0.0-8.1.0] [[#FinalizeFullExport]]
| 64 || [6.0.0-8.1.0] [[#FinalizeFullExport|FinalizeFullExport]]
|-
|-
| 65 || [6.0.0-8.1.0] [[#FinalizeDiffExport]]
| 65 || [6.0.0-8.1.0] [[#FinalizeDiffExport|FinalizeDiffExport]]
|-
|-
| 66 || [6.0.0+] [[#CancelExport]]
| 66 || [6.0.0+] [[#CancelExport|CancelExport]]
|-
|-
| 67 || [6.0.0+] [[#SuspendExport]]
| 67 || [6.0.0+] [[#SuspendExport|SuspendExport]]
|-
|-
| 70 || [6.0.0-17.0.1] [[#GetKeySeed]]
| 70 || [6.0.0-17.0.1] [[#GetKeySeed|GetKeySeed]]
|-
|-
| 71 || [6.0.0+] [[#GetInitialDataMac]]
| 71 || [6.0.0+] [[#GetInitialDataMac|GetInitialDataMac]]
|-
|-
| 72 || [6.0.0+] [[#FinalizeExport]]
| 72 || [6.0.0+] [[#FinalizeExport|FinalizeExport]]
|-
|-
| 73 || [9.0.0+] [[#GetInitialDataMacKeyGeneration]]
| 73 || [9.0.0+] [[#GetInitialDataMacKeyGeneration|GetInitialDataMacKeyGeneration]]
|-
|-
| 74 || [18.0.0+] [[#GetKeySeed]]
| 74 || [18.0.0+] [[#GetKeySeed|GetKeySeed]]
|-
|-
| 75 || [20.0.0+] GetLocalKeySeedPackage
| 75 || [20.0.0+] GetLocalKeySeedPackage
|-
|-
| 80 || [6.0.0+] [[#GetImportInitialDataAad]]
| 80 || [6.0.0+] [[#GetImportInitialDataAad|GetImportInitialDataAad]]
|-
|-
| 81 || [6.0.0+] [[#SetExportInitialDataAad]]
| 81 || [6.0.0+] [[#SetExportInitialDataAad|SetExportInitialDataAad]]
|-
|-
| 96 || [6.0.0+] [[#GetReportInfo]]
| 96 || [6.0.0+] [[#GetReportInfo|GetReportInfo]]
|}
|}


== SetDivisionCount ==
== SetDivisionCount ==
Takes an input u32, no output.
Takes an input u32. No output.


== OpenSaveDataChunkExporter ==
== OpenSaveDataChunkExporter ==
Takes an input u32, returns an [[#ISaveDataChunkExporter]].
Takes an input u32. Returns an [[#ISaveDataChunkExporter]].


== FinalizeFullExport ==
== FinalizeFullExport ==
No input, returns two 0x10-byte output structs.
No input. Returns two 0x10-byte output structs.


== FinalizeDiffExport ==
== FinalizeDiffExport ==
No input, returns an output 0x10-byte struct.
No input. Returns an output 0x10-byte struct.


== CancelExport ==
== CancelExport ==
Line 1,761: Line 1,764:


== SuspendExport ==
== SuspendExport ==
No input/output, takes a type-0x6 output buffer.
Takes a type-0x6 output buffer. No output.


== GetKeySeed ==
== GetKeySeed ==
No input, returns an output 0x10-byte struct.
No input. Returns an output 0x10-byte struct.


== GetInitialDataMac ==
== GetInitialDataMac ==
No input, returns an output 0x10-byte struct.
No input. Returns an output 0x10-byte struct.


== FinalizeExport ==
== FinalizeExport ==
Line 1,773: Line 1,776:


== SetExportInitialDataAad ==
== SetExportInitialDataAad ==
Takes an input 0x20-byte struct, no output.
Takes an input 0x20-byte struct. No output.


= ISaveDataDivisionImporter =
= ISaveDataDivisionImporter =
Line 1,784: Line 1,787:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [6.0.0+] [[#ReadSaveDataExtraData]]
| 0 || [6.0.0+] [[#ReadSaveDataExtraData_2|ReadSaveDataExtraData]]
|-
|-
| 16 || [[#OpenSaveDataDiffChunkIterator]]
| 16 || [[#OpenSaveDataDiffChunkIterator_2|OpenSaveDataDiffChunkIterator]]
|-
|-
| 32 || [[#InitializeImport]]
| 32 || [[#InitializeImport|InitializeImport]]
|-
|-
| 33 || [[#FinalizeImport]]
| 33 || [[#FinalizeImport|FinalizeImport]]
|-
|-
| 34 || [6.0.0+] [[#CancelImport]]
| 34 || [6.0.0+] [[#CancelImport|CancelImport]]
|-
|-
| 35 || [6.0.0+] [[#GetImportContext]]
| 35 || [6.0.0+] [[#GetImportContext|GetImportContext]]
|-
|-
| 36 || [6.0.0+] [[#SuspendImport]]
| 36 || [6.0.0+] [[#SuspendImport|SuspendImport]]
|-
|-
| 37 || [11.0.0+] FinalizeImportWithoutSwap
| 37 || [11.0.0+] FinalizeImportWithoutSwap
|-
|-
| 48 || [[#OpenSaveDataChunkImporter]]
| 48 || [[#OpenSaveDataChunkImporter|OpenSaveDataChunkImporter]]
|-
|-
| 64 || [6.0.0+] [[#GetImportInitialDataAad]]
| 64 || [6.0.0+] [[#GetImportInitialDataAad|GetImportInitialDataAad]]
|-
|-
| 80 || [6.0.0+] [[#GetReportInfo]]
| 80 || [6.0.0+] [[#GetReportInfo_2|GetReportInfo]]
|}
|}


== ReadSaveDataExtraData ==
== ReadSaveDataExtraData ==
No input/output, takes a type-0x6 output buffer.
Takes a type-0x6 output buffer. No output.


== OpenSaveDataDiffChunkIterator ==
== OpenSaveDataDiffChunkIterator ==
No input, returns an [[#ISaveDataChunkIterator]].
No input. Returns an [[#ISaveDataChunkIterator]].


== InitializeImport ==
== InitializeImport ==
No input, returns an output u64.
No input. Returns an output u64.


== FinalizeImport ==
== FinalizeImport ==
Line 1,823: Line 1,826:


== GetImportContext ==
== GetImportContext ==
No input/output, takes a type-0x6 output buffer.
Takes a type-0x6 output buffer. No output.


== SuspendImport ==
== SuspendImport ==
Line 1,829: Line 1,832:


== OpenSaveDataChunkImporter ==
== OpenSaveDataChunkImporter ==
Takes an input u32, returns an [[#ISaveDataChunkImporter]].
Takes an input u32. Returns an [[#ISaveDataChunkImporter]].


== GetImportInitialDataAad ==  
== GetImportInitialDataAad ==  
No input, returns an output 0x20-byte struct.
No input. Returns an output 0x20-byte struct.


== GetReportInfo ==
== GetReportInfo ==
No input, returns an output 0x20-byte struct.
No input. Returns an output 0x20-byte struct.


= ISaveDataChunkIterator =
= ISaveDataChunkIterator =
Line 1,846: Line 1,849:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#Next]]
| 0 || [[#Next|Next]]
|-
|-
| 1 || [[#IsEnd]]  
| 1 || [[#IsEnd|IsEnd]]  
|-
|-
| 16 || [[#GetId]]  
| 16 || [[#GetId|GetId]]  
|}
|}


Line 1,857: Line 1,860:


== IsEnd ==
== IsEnd ==
No input, returns an output u8.
No input. Returns an output u8.


== GetId ==
== GetId ==
No input, returns an output u32.
No input. Returns an output u32.


= ISaveDataChunkExporter =
= ISaveDataChunkExporter =
Line 1,871: Line 1,874:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#Pull]]
| 0 || [[#Pull_2|Pull]]
|-
|-
| 16 || [6.0.0+] [[#GetRestRawDataSize]]
| 16 || [6.0.0+] [[#GetRestRawDataSize|GetRestRawDataSize]]
|}
|}


== Pull ==
== Pull ==
Takes an input u64 and a type-0x6 output buffer, returns an output u64.
Takes an input u64 and a type-0x6 output buffer. Returns an output u64.


== GetRestRawDataSize ==
== GetRestRawDataSize ==
No input, returns an output u64.
No input. Returns an output u64.


= ISaveDataChunkImporter =
= ISaveDataChunkImporter =
Line 1,891: Line 1,894:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#Push]]
| 0 || [[#Push_2|Push]]
|}
|}


== Push ==
== Push ==
Takes an input u64 and a type-0x5 input buffer, no output.
Takes an input u64 and a type-0x5 input buffer. No output.


= ISaveDataTransferProhibiter =
= ISaveDataTransferProhibiter =
Line 2,027: Line 2,030:
= FileSystemProxyType =
= FileSystemProxyType =
This is "nn::fs::FileSystemProxyType".
This is "nn::fs::FileSystemProxyType".
sdknso converts the input [[#ContentType|ContentType]] to a FileSystemProxyType, for use with the cmd input.


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 2,052: Line 2,053:
| 8 || [4.0.0+] RegisteredUpdate
| 8 || [4.0.0+] RegisteredUpdate
|}
|}
sdknso converts the input [[#ContentType|ContentType]] to a FileSystemProxyType, for use with the cmd input.


= ContentType =
= ContentType =
Line 2,100: Line 2,103:
| 3 || [16.0.0+] System0
| 3 || [16.0.0+] System0
|}
|}
= UserId =
This is "nn::fs::UserId". This is a 0x10-byte struct.
= HashSalt =
This is "nn::fs::HashSalt". This is a 0x20-byte struct.
= SaveDataId =
This is "nn::fs::SaveDataId". This is an u64.
= StaticSaveDataId =
This is "nn::fs::StaticSaveDataId". This is an u64.
= SystemSaveDataId =
This is "nn::fs::SystemSaveDataId". This is an u64.
= SystemBcatSaveDataId =
This is "nn::fs::SystemBcatSaveDataId". This is an u64.
= SaveDataReferenceId =
This is "nn::fs::SaveDataReferenceId". This is an u64.


= SaveDataSpaceId =
= SaveDataSpaceId =
Line 2,199: Line 2,223:
|-
|-
| 2 || ExtensionContext
| 2 || ExtensionContext
|}
= SaveDataMetaInfo =
This is "nn::fs::SaveDataMetaInfo".
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0
| 0x4
| Size
|-
| 0x4
| 0x1
| [[#SaveDataMetaType|Type]]
|-
| 0x5
| 0xB
| Reserved
|}
|}


Line 3,120: Line 3,166:
| 0x0
| 0x0
| 0x8
| 0x8
| [[NCM_services#ApplicationId|ApplicationId]] (0 for SystemSaveData)</br>SaveData: 0 can be used for accessing the savedata associated with the current FS session [[NCM_services#ApplicationId|ApplicationId]], otherwise when set this is the [[NCM_services#ApplicationId|ApplicationId]] associated with the savedata to access.
| [[#SaveDataReferenceId|ReferenceId]] (0 for SystemSaveData; SaveData: 0 can be used for accessing the savedata associated with the current FS session [[NCM_services#ApplicationId|ApplicationId]], otherwise when set this is the [[NCM_services#ApplicationId|ApplicationId]] associated with the savedata to access)
|-
|-
| 0x8
| 0x8
| 0x10
| 0x10
| UserId</br>For user-specific savedata(saveuser) when set, otherwise when zero this indicates the common savedata(savecommon). This is loaded from [[Account_services]].
| [[#UserId|UserId]] (for user-specific savedata(saveuser) when set, otherwise when zero this indicates the common savedata(savecommon); this is loaded from [[Account_services]])
|-
|-
| 0x18
| 0x18
| 0x8
| 0x8
| [[Flash_Filesystem|SystemSaveDataId]] (0 for SaveData)
| [[#StaticSaveDataId|StaticSaveDataId]] (0 for SaveData)
|-
|-
| 0x20
| 0x20
| 0x1
| 0x1
| [[#SaveDataType]]
| [[#SaveDataType|Type]]
|-
|-
| 0x21
| 0x21
| 0x1
| 0x1
| [[#SaveDataRank]]
| [[#SaveDataRank|Rank]]
|-
|-
| 0x22
| 0x22
| 0x2
| 0x2
| SaveDataIndex
| Index
|-
|-
| 0x24
| 0x24
| 0x4
| 0x1C
| Padding
| Reserved
|-
| 0x28
| 0x8
| 0 for SystemSaveData/SaveData.
|-
| 0x30
| 0x8
| 0 for SystemSaveData/SaveData.
|-
| 0x38
| 0x8
| 0 for SystemSaveData/SaveData.
|}
|}
Total size is 0x40-bytes.


For DeviceSaveData, this struct is all-zero except for the [[#SaveDataType]] field (and optionally the ApplicationId if specified).
For DeviceSaveData, this struct is all-zero except for the [[#SaveDataType]] field (and optionally the ApplicationId if specified).
Line 3,174: Line 3,206:
| 0x0
| 0x0
| 0x8
| 0x8
| SaveDataSize
| Size
|-
|-
| 0x8
| 0x8
Line 3,182: Line 3,214:
| 0x10
| 0x10
| 0x8
| 0x8
| AvailableSize</br>0x4000 for SystemSaveData/SaveData/DeviceSaveData/BcatSaveData.
| BlockSize (0x4000 for SystemSaveData/SaveData/DeviceSaveData/BcatSaveData)
|-
|-
| 0x18
| 0x18
| 0x8
| 0x8
| OwnerId</br>Official user-processes only uses 0 here for SystemSaveData/SaveData. For the dedicated save-creation code with SaveData/DeviceSaveData, this value comes from an input param with official user-processes. For BcatSaveData, this is the hard-coded [[NCM_services#ProgramId|ProgramId]] of the bcat-sysmodule.
| OwnerId (official user-processes only uses 0 here for SystemSaveData/SaveData; for the dedicated save-creation code with SaveData/DeviceSaveData, this value comes from an input param with official user-processes; for BcatSaveData, this is the hard-coded [[NCM_services#ProgramId|ProgramId]] of the bcat-sysmodule)
|-
|-
| 0x20
| 0x20
| 0x4
| 0x4
| [[#SaveDataFlags]]</br>Written using an input param for official user-processes. Hard-coded 0 for BcatSaveData.
| [[#SaveDataFlags|Flags]] (written using an input param for official user-processes; hard-coded 0 for BcatSaveData)
|-
|-
| 0x24
| 0x24
| 0x1
| 0x1
| [[#SaveDataSpaceId]]</br>Official user-processes only uses 0 here for SystemSaveData, 1 for SaveData/DeviceSaveData/BcatSaveData.
| [[#SaveDataSpaceId|SpaceId]] (Official user-processes only uses 0 here for SystemSaveData, 1 for SaveData/DeviceSaveData/BcatSaveData)
|-
|-
| 0x25
| 0x25
| 0x1
| 0x1
| Unknown. 0 for SystemSaveData/SaveData.
| IsPseudoSaveFs (0 for SystemSaveData/SaveData)
|-
|-
| 0x26
| 0x26
| 0x1A
| 0x1A
| Not initialized for SystemSaveData/SaveData.
| Reserved
|}
|}


Total size is 0x40-bytes.
= SaveDataCreationInfo2 =
 
This is "nn::fs::SaveDataCreationInfo2".
= DeviceSaveData =
This is accessed using the same commands for SaveData with the same input u8, the only difference compared to SaveData is the [[#SaveDataAttribute]].
 
= BcatSaveData =
This is accessed using the same commands for SaveData with the same input u8. The [[#SaveDataAttribute]] is the same as DeviceSaveData (besides the SaveDataType), except that the [[NCM_services#ApplicationId|ApplicationId]] field is always set to <input ApplicationId> (unlike DeviceSaveData where it's optional). See above regarding [[#SaveDataCreationInfo]].
 
The 0x10-byte struct passed to [[#CreateSaveDataFileSystem]] has the first 0x5-bytes set to all-zero.
 
MountSystemBcatSaveData uses [[#OpenSaveDataFileSystemBySystemSaveDataId]] with [[#SaveDataSpaceId]] System. The [[#SaveDataAttribute]] is all-zero, except for the SaveDataType, and SystemSaveDataId is set to the input param.
 
= SaveDataInfo =
This is "nn::fs::SaveDataInfo".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 3,227: Line 3,247:
|-
|-
| 0x0
| 0x0
| 0x4
| Version
|-
| 0x4
| 0x4
| Reserved
|-
| 0x8
| 0x8
| SaveDataId
| 0x40
| [[#SaveDataAttribute|Attribute]]
|-
|-
| 0x48
| 0x8
| 0x8
| 0x1
| Size
| [[#SaveDataSpaceId]]
|-
|-
| 0x9
| 0x50
| 0x1
| 0x8
| [[#SaveDataType]]
| JournalSize
|-
|-
| 0xA
| 0x58
| 0x6
| 0x8
| Padding?
| BlockSize
|-
|-
| 0x10
| 0x60
| 0x10
| 0x8
| UserId
| OwnerId
|-
|-
| 0x20
| 0x68
| 0x8
| 0x4
| SystemSaveDataId (0 for regular SaveData)
| Flags
|-
|-
| 0x28
| 0x6C
| 0x8
| 0x1
| [[NCM_services#ApplicationId|ApplicationId]] (for regular SaveData)
| [[#SaveDataSpaceId|SpaceId]]
|-
|-
| 0x30
| 0x6D
| 0x8
| 0x1
| Raw saveimage size
| [[#SaveDataFormatType|FormatType]]
|-
|-
| 0x38
| 0x6E
| 0x2
| 0x2
| SaveDataIndex
| Reserved
|-
|-
| 0x3A
| 0x70
| 0x1
| 0x1
| [[#SaveDataRank]]
| IsHashSaltSpecified
|-
| 0x71
| 0x3
| Reserved
|-
|-
| 0x3B
| 0x74
| 0x25
| 0x20
| Unknown. Usually zeros?
| [[#HashSalt|HashSalt]]
|}
|-
| 0x94
| 0x1
| [[#SaveDataMetaType|MetaType]]
|-
| 0x95
| 0x3
| Reserved
|-
| 0x98
| 0x4
| MetaSize
|-
| 0x9C
| 0x160
| Reserved
|}


This is a 0x60-byte struct.
= SaveDataInfo =
 
This is "nn::fs::SaveDataInfo".
= SaveDataFileSystemExtraData =
This is a 0x200-byte struct. Appears to match [[Savegames#Extra_data]].
 
= InitialDataVersion2 =
This is a 0x8210-byte struct used by [[#ISaveDataTransferManagerWithDivision]].
 
= LocalKeySeedPackage =
This is "nn::fs::LocalKeySeedPackage".
 
This is a 0x200-byte ([S2] 0x280-byte) struct.
 
= FsAccessControlRestrictionMode =
This is "nn::fs::FsAccessControlRestrictionMode".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Value || Name
! Offset
! Size
! Description
|-
| 0x0
| 0x8
| SaveDataId
|-
|-
| 0 ||  
| 0x8
| 0x1
| [[#SaveDataSpaceId|SaveDataSpaceId]]
|-
| 0x9
| 0x1
| [[#SaveDataType|SaveDataType]]
|-
| 0xA
| 0x6
| Reserved
|-
| 0x10
| 0x10
| SaveDataUserId
|-
| 0x20
| 0x8
| SystemSaveDataId (0 for regular SaveData)
|-
| 0x28
| 0x8
| [[NCM_services#ApplicationId|ApplicationId]] (for regular SaveData)
|-
| 0x30
| 0x8
| SaveDataSize
|-
| 0x38
| 0x2
| Index
|-
| 0x3A
| 0x1
| [[#SaveDataRank|Rank]]
|-
| 0x3B
| 0x1
| State
|-
| 0x3C
| 0x24
| Reserved
|}
|}
= SaveDataExtraData =
This is "nn::fs::SaveDataExtraData".
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0
| 0x40
| [[#SaveDataAttribute|Attribute]]
|-
| 0x40
| 0x8
| OwnerId
|-
| 0x48
| 0x8
| TimeStamp
|-
| 0x50
| 0x4
| Flags
|-
| 0x54
| 0x4
| Reserved
|-
| 0x58
| 0x8
| AvailableSize
|-
| 0x60
| 0x8
| JournalSize
|-
| 0x68
| 0x8
| CommitId
|-
| 0x70
| 0x190
| Reserved
|}
= SaveDataFilter =
This is "nn::fs::SaveDataFilter".
{| class="wikitable" border="1"
|-
! Offset
! Size
! Description
|-
| 0x0
| 0x1
| FilterApplicationId
|-
| 0x1
| 0x1
| FilterSaveDataType
|-
| 0x2
| 0x1
| FilterSaveDataUserId
|-
| 0x3
| 0x1
| FilterStaticSaveDataId
|-
| 0x4
| 0x1
| FilterIndex
|-
| 0x5
| 0x1
| Option
|-
| 0x6
| 0x2
| Reserved
|-
| 0x8
| 0x40
| [[#SaveDataAttribute|Attribute]]
|}
= InitialDataVersion2 =
This is a 0x2000-byte struct used by [[#ISaveDataTransferManagerWithDivision]].
= LocalKeySeedPackage =
This is "nn::fs::LocalKeySeedPackage".
This is a 0x200-byte ([S2] 0x280-byte) struct.
= FsAccessControlRestrictionMode =
This is "nn::fs::FsAccessControlRestrictionMode".
{| class="wikitable" border="1"
|-
! Value || Name
|-
| 0 ||
|}
= Notes =
== DeviceSaveData ==
This is accessed using the same commands for SaveData with the same input u8, the only difference compared to SaveData is the [[#SaveDataAttribute]].
== BcatSaveData ==
This is accessed using the same commands for SaveData with the same input u8. The [[#SaveDataAttribute]] is the same as DeviceSaveData (besides the SaveDataType), except that the [[NCM_services#ApplicationId|ApplicationId]] field is always set to <input ApplicationId> (unlike DeviceSaveData where it's optional). See above regarding [[#SaveDataCreationInfo]].
The 0x10-byte struct passed to [[#CreateSaveDataFileSystem]] has the first 0x5-bytes set to all-zero.
MountSystemBcatSaveData uses [[#OpenSaveDataFileSystemBySystemSaveDataId]] with [[#SaveDataSpaceId]] System. The [[#SaveDataAttribute]] is all-zero, except for the SaveDataType, and SystemSaveDataId is set to the input param.


[[Category:Services]]
[[Category:Services]]