SaveDataFiler

Table of Contents

Overview

The SaveDataFiler tool provides features to view, import, and export the following types of data.

You can use the import and export features to save save data, expanded save data, and rollback prevention values in a format that can be edited on a PC. You can also use this to rewrite save data for another CTR card, and expanded save data for an SD Card used by another system.

Usage 1: Importing Data to System NAND Memory

The SaveDataFiler binary is in the following location in the CTR-SDK.
$CTRSDK_ROOT/tools/TargetTools/CTR-TS/Release/SaveDataFiler.cia
Copy the above binary to an SD Card, and import it from DevMenu to the system's NAND memory. After that, it can be launched from the HOME Menu. (It can also be launched from DevMenu.)

Note 1: Handling Extended Save Data

The expanded save data specifications only allow access from the system that created the data. SaveDataFiler is no exception; it cannot access expanded save data that was created on another system. If you want to use expanded save data on another system, you must first export it to an SD Card (see Writing to SD Cards), and then import it once more to the system that you want to access it from. In other words, you must import the SaveDataFiler on both the original system, and the system you want to access the data from.

Note 2: Handling Save Data in Backup Memory

The save-data specifications prevent access if there is badly formatted ROM data (data that is not recognized as a valid CTR application) in the ROM area of the CTR card (or emulation memory). This applies to the emulation memory immediately after the debugger is powered on, as well as to CTR cards to which a System Updater has been written.


It also may not be possible to correctly import or export save data if the application written to the CTR card (or loaded into emulation memory) is different from the application that created the save data.
In other words, the save data may not be exported correctly if the procedure below is followed. (The same applies to importing data.)

  1. Create save data with application A.
  2. Write the .cci file for application B to the CTR card.
  3. Launch SaveDataFiler and export the save data.
Due to the two reasons above, make sure that the CCI file of the application that created the save data is written to the CTR card (or loaded into emulation memory) when importing or exporting that save data.

Usage 2: Start From CTR Card (or Emulation Memory)

You can also launch SaveDataFiler from a CTR card (or emulation memory).
$CTRSDK_ROOT/tools/TargetTools/CTR-TS/Release/SaveDataFiler.csu
Use the debugger to write the binary above to the CTR card (or to load it into emulation memory). You can also start it from the HOME or Test Menu.

Note: Handling Save Data in Backup Memory

Because SaveDataFiler itself does not store save data, it cannot access backup devices when it is launched from a CTR card (or emulation memory). An error such as the following is displayed on the screens.

<Upper Screen>

File Type    : broken user save data

Level  : -7
Summary: 9
Module : 17
Desc   : 230

<Lower Screen>

CTR Card -- broken --

Import the SaveDataFiler into system NAND memory, and use this information to import and export user save data to and from backup memory.

How to Use

The method of operations is as explained below.
The buttons that can be used vary by each screen. When the tool runs, use the guide displayed on the upper screen as a reference for operations.
ButtonOperation
Shared
↑↓Move the cursor within the list
←→Change tab
ASelect / Run
BCancel
L+R+STARTInitializes shared expanded save data.※(Note: See Initializing Shared Expanded Save Data)
List Display Mode (User Tab)
XWrite selected save data back to factory defaults
YWrite the selected save data to the SD Card (Note: See Writing to SD Cards)
R+YWrite the rollback prevention values for the selected save data to the SD Card (Note: See Rollback Prevention Values)
R+XDelete the rollback prevention values for the selected save data (Note: See Rollback Prevention Values)
List Display Mode (Ext Tab)
XDeletes save data
YWrite the save data to the SD Card (Note: See Writing to SD Cards)
Filer Mode
XDelete the selected item
R+YThoroughly destroy the selected files (Note: See Destroying Files)
L+YDestroy only the selected files (not supported for rendundant save data). (Note: See Destroying Files.)

Writing to SD Cards

You can use SaveDataFiler to write save data and expanded save data to SD Cards.
The written data is saved to SD Cards in the following location. It can then be edited from a PC or other device.
sdmc:/filer/
        +--- UserSaveData/
        |       +--- <The date and time saved>/
        |                +--- <Unique ID>/         ←Data is saved below here.
        |                +--- <Unique ID& gt.dat       ← File that contains format parameters.
        +--- ExtData/
        |       +--- <The date and time saved>/
        |       +--- <expanded save data number>/      ←Data is saved below here.
        |       +--- <expanded save data number>.dat   ←File storing format parameters.
        +--- SecureValue/
                +--- <The date and time saved>/
                         +--- <expanded save data number>/      ←Data is saved below here.
                         +--- SecureValue.dat       ←File that stores format parameters.

Data saved in the previous locations can be restored from the SD Tab.

Destroying Files

The goal of destroying files is to put them in a state where the nn::fs::ResultVerificationFailed error is returned when they are loaded using functions from the FS library. You can use this to test error processing for files that are damaged when a card is removed during a write or a when a file is illegally spoofed.
There are two features for destroying files:
- Thoroughly destroy the selected files (R+Y)
Can always destroy the selected files.
This action may destroy other files or directories as well.
- Only destroy the selected files (L+Y)
Not supported for redundant save data.
This may fail to destroy the selected files.
It will never affect other files or directories, regardless of whether the destruction is successful.
If destruction is successful, an error appears in the file list. (See User Tab)

Rollback Prevention Values

You can write rollback prevention values to the SD Card and delete them for debugging purposes.

The following three features are related to rollback prevention values.
・ Write the selected title's rollback prevention values to the SD Card (R+Y)
Writes 64 bit values within the system save region.
・ Load the selected title's rollback prevention values from the SD Card (SD tab)
Overwrites 64 bit values within the system save region with content saved on SD Card.
・ Delete selected title's rollback prevention values (R+X)
Deletes 64 bit values within the system save region.
Usage of rollback prevention values will be different for each application.
When debugging applications that use rollback prevention values, save data and rollback prevention values must be handled as a pair.

Upper Screen

This is a description of the content of the upper screen.
Revision     : 34302  --- (1)

File Type    : file  --- (2)
  | LimitSize | LimitDir | LimitFile | Dup |  --- (3)
  |    ---    |       16 |        16 |  ON |
Level  : -5
Summary: 8
Module : 17
Desc   : 392  --- (4)

File Size    : 1024 bytes  --- (5)

X: delete this file  --- (6)
R+Y: destroy this file
       :

NumberDescription
(1)Revision number for the SaveDataFiler.
(2)Indicates the type of item selected in the lower screen.
(3)When the item selected on the lower screen is an archive, the format parameters of that archive are displayed.
Their meanings are as follows.
LimitSize(not used at present)
LimitDirthe maximum number of directories that can be created
LimitFilethe maximum number of files that can be created
Dupwhether there is duplication
This is not displayed on the SD Tab.
(4)When an error occurs during an archive mount or during an operation on an item selected from the lower screen, its Result value is displayed.
To learn more about the content of errors, see the Description List for the fs library.
(5)When the item selected in the lower screen is a file, its size is displayed. -1 is displayed if the size could not be obtained.
(6)The operations guide is displayed.

User Tab

This tab is for manipulating save data.

List Display Mode

When this tab is selected, a list showing the CTR Card and download applications appears.
In addition to "CTR Card," this list shows the unique IDs of the download applications imported to the SD Card.
CTR Card
F7FFF
FFFFF
   :
If an archive is corrupted, the corresponding Result value appears on the upper screen when it is mounted.

Filer Mode

When an item is selected from the list, the content of its save data is displayed on the lower screen.
../
Dir1/
Dir2/
File1
File2 : Read Error (0-512)
File3
  :
When an error has occurred during file operations, such as a damaged file, the filename is displayed in red. To display the corresponding Result value on the upper screen, align the cursor with the filename.

In addition, the function that was called when the error occurred is displayed next to the filename.
ViewDescription
Open Errornn::fs::FileStream::TryInitialize returned an error. There was a failure in opening the file.
Read Errornn::fs::FileStream::TryRead returned an error. There was a failure when reading the file.
At the same time, the byte at which the read error occurred in the file is also displayed. SaveDataFiler reads in units of 1 MB, so the actual region where the error occurs may be smaller than this. This may also appear when there is an unwritten area in the file. See the note to nn::fs::ResultVerificationFailed for details.
Size Errornn::fs::FileStream::TryGetSize returned an error. There was a failure in getting the file size (metadata).
However, if the system fails to get the metadata, it will also fail to open the file. Thus, an Open Error will generally be displayed.

Ext Tab

This tab is for manipulating the expanded save data on the SD Card.

List Display Mode

When this tab is selected, the expanded save data on the SD Card is displayed in a list. The displayed numbers are the expanded save data numbers.
00000001
00000002  -- broken --
00000003
   :
When an archive is corrupt (when the nn::fs::MountExtSaveData function returns an error), the number is displayed in red. When the cursor is aligned above the filename, the result value is displayed in the upper screen.

Filer Mode

When an archive is selected from the list, the content of the expanded save data are displayed. The displayed content is the same as for the User Tab.

SD Tab

This tab is for manipulating the data written to SD Cards.

The data on the SD Card is displayed in a list.
user  : 20110101000000 : 00000000
user  : 20110101121530 : 000f7fff
ext   : 20110101000000 : 00000001
ext   : 20110102141516 : 00000002
  :           :              :
 (1)         (2)            (3)
NumberDescription
(1)Indicates the data type.
UserSave Data
extExpanded Save Data
secureRollback prevention values
(2)This is the directory name (the date and time saved) on the SD Card.
(3)The meaning of this item depends on the save data type.
UserDisplays the unique ID.
Displays 0 when data is exported from a card application by using a tool prior to CTR-SDK 4.2.0.
extDisplays the expanded save data number.
secureDisplays the unique ID.
Displays 0 when data is exported from a card application by using a tool prior to CTR-SDK 4.2.0.
Select from the list and press the A Button to import the data to the media from which it is later exported. Application save data, expanded save data on the SD Card, and rollback prevention values in the system save region are all deleted at this time.


For save data, you can specify the location to import to and then import the save data by pressing the L+A Buttons or the R+A Buttons.

If you export data from a card application by using a tool prior to CTR-SDK 4.2.0, you cannot import that data to an SD Card.
Use a tool from CTR-SDK 4.2.1 or later, or convert the data by using ctr_FilerDataMigrator.

Initializing Shared Expanded Save Data

You can delete the shared expanded save data in system NAND memory by pressing L + R + START. (Press the START Button while holding down the L and R Buttons.)
If you return to the HOME Menu with the shared expanded save data deleted, the system will not operate correctly. After using this feature, you must restart the system. The data will be rebuilt when the HOME Menu or TestMenu (development menu) launches. (Startup will take a little longer than usual.)

Revision History

2013/03/11
Added information about the destruction of redundant save data files.
2012/06/15
Added a note about specifying the location to which to import save data.
2012/04/27
Updated description about rollback prevention value operations.
2011/10/20
Added information about two features for destroying files.
2011/10/11
Added conditions for displaying a read error when there is an unwritten area.
2011/09/30
Updated description of destroying user save data.
2011/09/29
Revised note about differences due to method of launching SaveDataFiler.
2011/06/22
Added note about differences due to method of starting SaveDataFiler.
2011/06/13
Added description of usage.
Changed error message upon failure to destroy file.
2011/04/21
Added a note about file destruction.
2011/03/23
Added support for save data in download applications.
2011/03/19
Added feature to initialize shared expanded save data.
2011/02/18
Initial version.

CONFIDENTIAL