Config Savegame

Config Savegame

This page describes the format of the Cfg NAND savegame. These blocks can be accessed with the Cfg service commands.

Structure of save-file “/config” #

OffsetSizeDescription
0x00x2Total entries
0x20x2Data entries offset
0x40x4558Block entries
0x455CData for the entries

The filesize for this /config file is 0x8000-bytes.

Configuration block entry #

OffsetSizeDescription
0x00x4BlkID
0x40x4Offset to the data for this block when size is >4, otherwise this word is the data for this block
0x80x2Size
0xA0x2Access Flags

Access Flags #

Bit MaskDescription
0x2User Readable (cfg:u)
0x4System Writable (cfg:s / cfg:i)
0x8System Readable (cfg:s / cfg:i)

Config blocks will typically either use 0xC for system readable/writable or 0xE for all 3.

Configuration blocks #

BlkIDSizeAccess FlagsDescription
0x000000000x20xCConfig savegame version?
0x000100000x10xCRTC compensation value
0x000200000x1340xCCodec
0x000300000x10xCLeap Year Counter (read By PTM)
0x000300010x80xEUser time offset (read by CECD): displayed timestamp - rtc timestamp
0x000300020x80xCSettings time offset: newly set timestamp - rtc timestamp
0x000400000x100xCTouch calibration (read by HID)
0x000400010x1C0xCAnalog Stick Calibration Param?(read by HID)
0x000400020x120xCGyroscope (read by HID)
0x000400030xC0xCAccelerometer (read by HID)
0x000400040x1C0xCCStick calibration data
0x000500000x20xCScreen flicker
0x000500010x20xCBacklight controls (u8 ABL_powersave_enable, u8 brightness_level) (read by GSP)
0x000500020x380xCBacklight PWM (read by GSP)
0x000500030x200xCPower saving mode (ABL) calibration (read by GSP)
0x000500040x200xCPower saving mode (ABL) calibration (for legacy FIRM)
0x000500050x200xEStereo display settings (HWCAL block 0x470)
0x000500060x20xC3D switching delay
0x000500070x40xC?
0x000500080x10C0xCPower saving mode (ABL) extra config
0x000500090x80xCnew3DS only(?) backlight control (5th byte: auto-brightness enable)
0x000600000x960xC??? (HWCAL block 0x500)
0x000700000x2140xE3D filters
0x000700010x10xESound output mode (mono=0, stereo=1, surround=2)
0x000700020x80xEMicrophone echo cancellation params
0x000800000xC000xCWiFi configuration slot 0
0x000800010xC000xCWiFi configuration slot 1
0x000800020xC000xCWiFi configuration slot 2
0x000900000x80xEThis contains a u64 ID, used by processes using NWMUDS:InitializeWithVersion. The first word is the same as LocalFriendCodeSeed, while the latter is a separate word.
0x000900010x80xESame content as 0x0009000? This console-unique u64 is used by GenHashConsoleUnique. It is generated by `((0x3FFFFFFFF) & LocalFriendCodeSeed)
0x000900020x40xEThe first two bytes are the same random16 used in 0x00090001. The second two bytes are zeros.
0x000A00000x1C0xEUser Name
0x000A00010x20xEBirthday (u8 month, u8 day)
0x000A00020x10xELanguage
0x000B00000x40xECountryInfo
0x000B00010x8000xECountry name in UTF-16, every 0x80-bytes is an entry for each language, in the order of the Language table below (not all entries are set)
0x000B00020x8000xEState name in UTF-16, every 0x80-bytes is an entry for each language
0x000B00030x40xECoordinates. A pair of s16 represents latitude and longitude, respectively. One need to multiply both value by 180/32768 to get coordinates in degrees
0x000C00000xC00xEParental Controls - Main data
0x000C00010x140xECOPPACS restriction data
0x000C00020x2000xEParental Controls - Registered e-Mail address and custom secret question
0x000D00000x40xEu16 at offset 0x0: EULA Version which was agreed to. u16 @ 0x02: latest version
0x000E00000x10xE? (related to SpotPass options in Internet Settings?)
0x000F00000x100xCDebug configuration, read by NS on dev-units: on startup, NS does svcKernelSetState(6, 1, (u64)debug_flags & 1); svcKernelSetState(6, 2, (u64)debug_flags & 2); (see here) where debug_flags is the u32 located at offset 0xC in this struct. Then it compares the u32 from +8 in this config-block with the APPMEMTYPE. When those don’t match NS starts a FIRM-launch (with the same FIRM titleID as the currently running one) to boot into a FIRM with the APPMEMTYPE value from this config-block. The byte at offset 0x0 is related to the memtype as well.
0x000F00010x80xC?
0x000F00030x10xCHome Menu button disable
0x000F00040x40xCThe first u8 is the System-Model value, the last 3-bytes are unknown
0x000F00050x40xCThe first u8 indicates whether network updates are enabled (however, NIM only checks this flag with developer ENVINFO).
0x000F00060x280xCIn NIM, taken as a (hopefully null terminated) string used for the “X-Device-Token” http header field for NPNS url.
0x001000000x20xCTWL EULA info ({bool agreed; u8 agreedVersion})
0x001000010x940xCStores Parental Restrictions PIN/Secret Answer and other info for TWL mode
0x001000020x10xCTWL country code
0x001000030x100xCTWL movable unique ID, used for DSiWare exports
0x001100000x40xCThe low u16 indicates whether the system setup is required, such as when the system is booted for the first time or after doing a System Format: 0 = setup required, non-zero = no setup required
0x001100010x80xCTitleID of the menu to launch, used by NS on dev units (this block can be edited on dev units with Config)
0x001200000x80xCVolume Slider Bounds (Read by HID and PTM)
0x001300000x40xEIf response is 0x100 then debug mode is enabled.
0x001500000x40xCClock Sequence (u16) used for generating UUIDs in ACT.
0x001500010x80xC?
0x001500020x40xEIn NIM, taken as an u32, using the low u16, casted to a char, and turned lower case for the making of the url for NPNS.
0x001600000x40xEUnknown, first byte is used by config service-cmd 0x00070040. (Unknown whether the last 3-bytes are used)
0x001700000x40xEMiiverse (OLV) access key
0x001800000x40xCQTM Infrared LED related, can be 0 or 1
0x001800010x180xCQTM calibration data
0x001900000x10xCUnknown. NFC-module checks for value1/non-value1.

The developer unit TID block only exists on developer units.

Stereo Display Settings #

All values are hard-coded in cfg module.

OffsetSizeValueDescription
0x0462.0fassumed pupillary distance in mm?
0x44289.0fassumed distance in mm between player’s eyes and upper screen?
0x8476.80fwidth in mm of (old) 3DS upper screen (doesn’t vary for different models?)
0xC446.08fheight in mm of (old) 3DS upper screen (doesn’t vary for different models?)
0x10410.0f
0x1445.0f
0x18455.58f
0x1C421.57f

Languages #

IDDescription
0JP
1EN
2FR
3DE
4IT
5ES
6ZH
7KO
8NL
9PT
10RU
11TW

CountryInfo #

ByteDescription
0?
1?
2State/Province code.
3Country code, same as DSi/Wii country codes. Value 0xFF is invalid.

User Name Block 0x000A0000 #

ByteDescription
0x00-0x15User name (UTF-16)
0x16-0x17u16 NGWord flag to denote that the user name is inappropriate
0x18-0x1Bu32 NGWord version the username was last checked with. If this value is less than the u32 stored in the NGWord CFA “romfs:/version.dat”, the system then checks the username string with the bad-word list CFA again, then updates this field with the value from the CFA

While the user name is NULL-terminated, the terminator is not applied when the user name is 10 characters long, which leads to online access breaking (002-0109) and buffer overflows when the user name is retrieved, even in DS games.

WiFi Slot Structure #

Network structure #

This is used twice in the actual WiFi slot structure.

OffsetSizeDescription
0x00x1Whether the network was set or not?
0x10x1Whether to use this network strucutre to connect?
0x20x1Whether this structure is the first (0) or the second (1) in the larger WiFi slot structure?
0x30x1Padding ?
0x40x20SSID of the network, without a trailing nullbyte.
0x240x1Length of the SSID.
0x250x1AP crypto key type
0x260x2Padding ?
0x280x40Plaintext of the passphrase of the network, without a trailing nullbyte.
0x680x20PBKDF2 of the passphrase and SSID ( ๐Ÿ”— http://jorisvr.nl/wpapsk.html).

Actual structure #

OffsetSizeDescription
0x00x2?
0x20x2๐Ÿ”— CRC-16 checksum of the next 0x410 bytes.
0x40x88First network structure. Only set if the network was set “normally”, or was the last to be set using WPS during the session.
0x8C0x20Padding.
0xAC0x88Second network structure. Only set if the network was set using WPS, otherwise 0-filled.
0x1340x20CPadding.
0x3400x1Whether to automatically get the IP address (use DHCP) or not, defaults to 1.
0x3410x1Whether to automatically get the DNS or not, defaults to 1.
0x3420x2Padding ?
0x3440x4IP address, to use if 0x340 is false.
0x3480x4IP address of the gateway, to use if 0x340 is false.
0x34C0x4Subnetwork mask, to use if 0x340 is false.
0x3500x4IP address of the primary DNS , to use if 0x341 is false.
0x3540x4IP address of the secondary DNS, to use if 0x341 is false.
0x3580x4Always 0x01050000 ? Only set if the network was the last to be set during the session.
0x35C0x4IP address to use. Only set if the network was the last to be set during the session.
0x3600x6MAC address of the AP. Only set if the network was the last to be set during the session.
0x3660x1Channel. Only set if the network was the last to be set during the session.
0x3670x1Padding ? Only set if the network was the last to be set during the session.
0x3680x1Whether to use a proxy or not, defaults to 0.
0x3690x1Whether to use a basic authentication for the proxy, defaults to 0.
0x36A0x2Port to use for the proxy, defaults to 1.
0x36C0x30URL/address of the proxy, including a trailing nullbyte.
0x39C0x34Padding.
0x3D00x20Username to use for basic authentication, including a trailing nullbyte.
0x3F00x20Password to use for basic authentication, including a trailing nullbyte.
0x4100x2Padding ?
0x4120x2MTU value, defaults to 1400 and ranges between 576 and 1500, inclusive.
0x4140x7ECPadding.

LCD display config #

There seems to be some sort of LCD display configuration stored in this cfg. When using the cfg-save from an Old3DS on a New3DS without formatting the cfg first, the bottom-screen display is somewhat off(which is fixed by formatting the cfg-save).

Parental Control Settings Block 0x00100001 #

ByteSize in bytesDescription
0x00xDUnknown.
0xD0x4PIN
0x110x40Secret Answer (UTF-16)

Parental Control Settings Block 0x000C0000 #

OffsetSizeDescription
0x000x04Parental Control Restriction Bitmask
0x040x04Unknown
0x080x01Rating system used for configuration
0x090x01Maximum allowed age (20 = No restriction)
0x0A0x01Secret Question Type (0-5: Pre-defined, 6: Custom)
0x0B0x01Unknown
0x0C0x08Parental Controls PIN code (with NULL-termination, although restricted to 4 digits)
0x140x44Secret Answer (UTF-16)

Parental Control Restriction Bitmask #

BitRestriction name
0Global Parental Controls Enable
1Internet Browser
2Display of 3D Images (disabled on 2DS)
3Sharing Images/Audio/Video/Long Text Data
4Online Interaction
5StreetPass
6Friend Registration
7DS Download Play
8Nintendo 3DS Shopping Services (eShop / EC Applet)
9View Distributed Videos
10Miiverse (View)
11Miiverse (Post)
31“Child Online Privacy Protection” (see CFG:IsCoppacsSupported)

Parental Control Settings Block 0x000C0002 #

OffsetSizeDescription
0x00000x0001Boolean, whether an e-Mail has been registered
0x00010x0101Registered e-Mail address (Plaintext)
0x01020x0068Custom Secret Question (UTF-16)