cfgu.h File Reference

CFGU (Configuration) Service. More...

`#include <3ds/types.h>`

Go to the source code of this file.

## Enumerations

enum | CFG_Region { CFG_REGION_JPN = 0 , CFG_REGION_USA = 1 , CFG_REGION_EUR = 2 , CFG_REGION_AUS = 3 , CFG_REGION_CHN = 4 , CFG_REGION_KOR = 5 , CFG_REGION_TWN = 6 }
| Configuration region values. More...
enum | CFG_Language { CFG_LANGUAGE_DEFAULT = -1 , CFG_LANGUAGE_JP , CFG_LANGUAGE_EN , CFG_LANGUAGE_FR , CFG_LANGUAGE_DE , CFG_LANGUAGE_IT , CFG_LANGUAGE_ES , CFG_LANGUAGE_ZH , CFG_LANGUAGE_KO , CFG_LANGUAGE_NL , CFG_LANGUAGE_PT , CFG_LANGUAGE_RU , CFG_LANGUAGE_TW }
| Configuration language values. More...
enum | CFG_SystemModel { CFG_MODEL_3DS = 0 , CFG_MODEL_3DSXL = 1 , CFG_MODEL_N3DS = 2 , CFG_MODEL_2DS = 3 , CFG_MODEL_N3DSXL = 4 , CFG_MODEL_N2DSXL = 5 }

## Functions

Result | cfguInit (void)
| Initializes CFGU.
void | cfguExit (void)
| Exits CFGU.
Result | CFGU_SecureInfoGetRegion (u8 *region)
| Gets the system's region from secure info. More...
Result | CFGU_GenHashConsoleUnique (u32 appIDSalt, u64 *hash)
| Generates a console-unique hash. More...
Result | CFGU_GetRegionCanadaUSA (u8 *value)
| Gets whether the system's region is Canada or USA. More...
Result | CFGU_GetSystemModel (u8 *model)
| Gets the system's model. More...
Result | CFGU_GetModelNintendo2DS (u8 *value)
| Gets whether the system is a 2DS. More...
Result | CFGU_GetCountryCodeString (u16 code, u16 *string)
| Gets a string representing a country code. More...
Result | CFGU_GetCountryCodeID (u16 string, u16 *code)
| Gets a country code ID from its string. More...
Result | CFGU_IsNFCSupported (bool *isSupported)
| Checks if NFC (code name: fangate) is supported. More...
Result | CFGU_GetConfigInfoBlk2 (u32 size, u32 blkID, void *outData)
| Gets a config info block with flags = 2. More...
Result | CFG_GetConfigInfoBlk4 (u32 size, u32 blkID, void *outData)
| Gets a config info block with flags = 4. More...
Result | CFG_GetConfigInfoBlk8 (u32 size, u32 blkID, void *outData)
| Gets a config info block with flags = 8. More...
Result | CFG_SetConfigInfoBlk4 (u32 size, u32 blkID, const void *inData)
| Sets a config info block with flags = 4. More...
Result | CFG_SetConfigInfoBlk8 (u32 size, u32 blkID, const void *inData)
| Sets a config info block with flags = 8. More...
Result | CFG_UpdateConfigSavegame (void)
| Writes the CFG buffer in memory to the savegame in NAND.
Result | CFGU_GetSystemLanguage (u8 *language)
| Gets the system's language. More...
Result | CFGI_RestoreLocalFriendCodeSeed (void)
| Deletes the NAND LocalFriendCodeSeed file, then recreates it using the LocalFriendCodeSeed data stored in memory.
Result | CFGI_RestoreSecureInfo (void)
| Deletes the NAND SecureInfo file, then recreates it using the SecureInfo data stored in memory.
Result | CFGI_DeleteConfigSavefile (void)
| Deletes the "config" file stored in the NAND Config_Savegame.
Result | CFGI_FormatConfig (void)
| Formats Config_Savegame.
Result | CFGI_ClearParentalControls (void)
| Clears parental controls.
Result | CFGI_VerifySigLocalFriendCodeSeed (void)
| Verifies the RSA signature for the LocalFriendCodeSeed data already stored in memory.
Result | CFGI_VerifySigSecureInfo (void)
| Verifies the RSA signature for the SecureInfo data already stored in memory.
Result | CFGI_SecureInfoGetSerialNumber (u8 *serial)
| Gets the system's serial number. More...
Result | CFGI_GetLocalFriendCodeSeedData (u8 *data)
| Gets the 0x110-byte buffer containing the data for the LocalFriendCodeSeed. More...
Result | CFGI_GetLocalFriendCodeSeed (u64 *seed)
| Gets the 64-bit local friend code seed. More...
Result | CFGI_GetSecureInfoData (u8 *data)
| Gets the 0x11-byte data following the SecureInfo signature. More...
Result | CFGI_GetSecureInfoSignature (u8 *data)
| Gets the 0x100-byte RSA-2048 SecureInfo signature. More...

## Detailed Description

CFGU (Configuration) Service.

## Enumeration Type Documentation

## CFG_Language

enum CFG_Language

Configuration language values.

Enumerator
CFG_LANGUAGE_DEFAULT | Use system language in errorInit.
CFG_LANGUAGE_JP | Japanese.
CFG_LANGUAGE_EN | English.
CFG_LANGUAGE_FR | French.
CFG_LANGUAGE_DE | German.
CFG_LANGUAGE_IT | Italian.
CFG_LANGUAGE_ES | Spanish.
CFG_LANGUAGE_ZH | Simplified Chinese.
CFG_LANGUAGE_KO | Korean.
CFG_LANGUAGE_NL | Dutch.
CFG_LANGUAGE_PT | Portugese.
CFG_LANGUAGE_RU | Russian.
CFG_LANGUAGE_TW | Traditional Chinese.

## CFG_Region

enum CFG_Region

Configuration region values.

Enumerator
CFG_REGION_JPN | Japan.
CFG_REGION_USA | USA.
CFG_REGION_EUR | Europe.
CFG_REGION_AUS | Australia.
CFG_REGION_CHN | China.
CFG_REGION_KOR | Korea.
CFG_REGION_TWN | Taiwan.

## CFG_SystemModel

enum CFG_SystemModel

Enumerator
CFG_MODEL_3DS | Old 3DS (CTR)
CFG_MODEL_3DSXL | Old 3DS XL (SPR)
CFG_MODEL_N3DS | New 3DS (KTR)
CFG_MODEL_2DS | Old 2DS (FTR)
CFG_MODEL_N3DSXL | New 3DS XL (RED)
CFG_MODEL_N2DSXL | New 2DS XL (JAN)

## Function Documentation

## CFG_GetConfigInfoBlk4()

Result CFG_GetConfigInfoBlk4 | ( | u32 | size,
|  | u32 | blkID,
|  | void * | outData
| ) |  |

Gets a config info block with flags = 4.

Parameters

  size | Size of the data to retrieve.
  blkID | ID of the block to retrieve.
  outData | Pointer to write the block data to.

## CFG_GetConfigInfoBlk8()

Result CFG_GetConfigInfoBlk8 | ( | u32 | size,
|  | u32 | blkID,
|  | void * | outData
| ) |  |

Gets a config info block with flags = 8.

Parameters

  size | Size of the data to retrieve.
  blkID | ID of the block to retrieve.
  outData | Pointer to write the block data to.

## CFG_SetConfigInfoBlk4()

Result CFG_SetConfigInfoBlk4 | ( | u32 | size,
|  | u32 | blkID,
|  | const void * | inData
| ) |  |

Sets a config info block with flags = 4.

Parameters

  size | Size of the data to retrieve.
  blkID | ID of the block to retrieve.
  inData | Pointer to block data to write.

## CFG_SetConfigInfoBlk8()

Result CFG_SetConfigInfoBlk8 | ( | u32 | size,
|  | u32 | blkID,
|  | const void * | inData
| ) |  |

Sets a config info block with flags = 8.

Parameters

  size | Size of the data to retrieve.
  blkID | ID of the block to retrieve.
  inData | Pointer to block data to write.

## CFGI_GetLocalFriendCodeSeed()

Result CFGI_GetLocalFriendCodeSeed | ( | u64 * | seed | ) |

Gets the 64-bit local friend code seed.

Parameters

  seed | Pointer to write the friend code seed to.

## CFGI_GetLocalFriendCodeSeedData()

Result CFGI_GetLocalFriendCodeSeedData | ( | u8 * | data | ) |

Gets the 0x110-byte buffer containing the data for the LocalFriendCodeSeed.

Parameters

  data | Pointer to output the buffer. (The size must be at least 0x110-bytes)

## CFGI_GetSecureInfoData()

Result CFGI_GetSecureInfoData | ( | u8 * | data | ) |

Gets the 0x11-byte data following the SecureInfo signature.

Parameters

  data | Pointer to output the buffer. (The size must be at least 0x11-bytes)

## CFGI_GetSecureInfoSignature()

Result CFGI_GetSecureInfoSignature | ( | u8 * | data | ) |

Gets the 0x100-byte RSA-2048 SecureInfo signature.

Parameters

  data | Pointer to output the buffer. (The size must be at least 0x100-bytes)

## CFGI_SecureInfoGetSerialNumber()

Result CFGI_SecureInfoGetSerialNumber | ( | u8 * | serial | ) |

Gets the system's serial number.

Parameters

  serial | Pointer to output the serial to. (This is normally 0xF)

## CFGU_GenHashConsoleUnique()

Result CFGU_GenHashConsoleUnique | ( | u32 | appIDSalt,
|  | u64 * | hash
| ) |  |

Generates a console-unique hash.

Parameters

  appIDSalt | Salt to use.
  hash | Pointer to output the hash to.

## CFGU_GetConfigInfoBlk2()

Result CFGU_GetConfigInfoBlk2 | ( | u32 | size,
|  | u32 | blkID,
|  | void * | outData
| ) |  |

Gets a config info block with flags = 2.

Parameters

  size | Size of the data to retrieve.
  blkID | ID of the block to retrieve.
  outData | Pointer to write the block data to.

## CFGU_GetCountryCodeID()

Result CFGU_GetCountryCodeID | ( | u16 | string,
|  | u16 * | code
| ) |  |

Gets a country code ID from its string.

Parameters

  string | String to use.
  code | Pointer to output the country code to.

## CFGU_GetCountryCodeString()

Result CFGU_GetCountryCodeString | ( | u16 | code,
|  | u16 * | string
| ) |  |

Gets a string representing a country code.

Parameters

  code | Country code to use.
  string | Pointer to output the string to.

## CFGU_GetModelNintendo2DS()

Result CFGU_GetModelNintendo2DS | ( | u8 * | value | ) |

Gets whether the system is a 2DS.

Parameters

  value | Pointer to output the result to. (0 = yes, 1 = no)

## CFGU_GetRegionCanadaUSA()

Result CFGU_GetRegionCanadaUSA | ( | u8 * | value | ) |

Gets whether the system's region is Canada or USA.

Parameters

  value | Pointer to output the result to. (0 = no, 1 = yes)

## CFGU_GetSystemLanguage()

Result CFGU_GetSystemLanguage | ( | u8 * | language | ) |

Gets the system's language.

Parameters

  language | Pointer to write the language to. (see CFG_Language)

Examples
  get_system_language/source/main.c.

## CFGU_GetSystemModel()

Result CFGU_GetSystemModel | ( | u8 * | model | ) |

Gets the system's model.

Parameters

  model | Pointer to output the model to. (see CFG_SystemModel)

## CFGU_IsNFCSupported()

Result CFGU_IsNFCSupported | ( | bool * | isSupported | ) |

Checks if NFC (code name: fangate) is supported.

Parameters

  isSupported | pointer to the output the result to.

## CFGU_SecureInfoGetRegion()

Result CFGU_SecureInfoGetRegion | ( | u8 * | region | ) |

Gets the system's region from secure info.

Parameters

  region | Pointer to output the region to. (see CFG_Region)

Examples
  network/boss/source/main.c.