libctru  v2.3.1
Enumerations | Functions
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_JP = 0 ,
  CFG_LANGUAGE_EN = 1 ,
  CFG_LANGUAGE_FR = 2 ,
  CFG_LANGUAGE_DE = 3 ,
  CFG_LANGUAGE_IT = 4 ,
  CFG_LANGUAGE_ES = 5 ,
  CFG_LANGUAGE_ZH = 6 ,
  CFG_LANGUAGE_KO = 7 ,
  CFG_LANGUAGE_NL = 8 ,
  CFG_LANGUAGE_PT = 9 ,
  CFG_LANGUAGE_RU = 10 ,
  CFG_LANGUAGE_TW = 11
}
 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

Configuration language values.

Enumerator
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

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
sizeSize of the data to retrieve.
blkIDID of the block to retrieve.
outDataPointer 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
sizeSize of the data to retrieve.
blkIDID of the block to retrieve.
outDataPointer 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
sizeSize of the data to retrieve.
blkIDID of the block to retrieve.
inDataPointer 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
sizeSize of the data to retrieve.
blkIDID of the block to retrieve.
inDataPointer to block data to write.

◆ CFGI_GetLocalFriendCodeSeed()

Result CFGI_GetLocalFriendCodeSeed ( u64 seed)

Gets the 64-bit local friend code seed.

Parameters
seedPointer 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
dataPointer 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
dataPointer 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
dataPointer 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
serialPointer to output the serial to. (This is normally 0xF)

◆ CFGU_GenHashConsoleUnique()

Result CFGU_GenHashConsoleUnique ( u32  appIDSalt,
u64 hash 
)

Generates a console-unique hash.

Parameters
appIDSaltSalt to use.
hashPointer 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
sizeSize of the data to retrieve.
blkIDID of the block to retrieve.
outDataPointer to write the block data to.

◆ CFGU_GetCountryCodeID()

Result CFGU_GetCountryCodeID ( u16  string,
u16 code 
)

Gets a country code ID from its string.

Parameters
stringString to use.
codePointer to output the country code to.

◆ CFGU_GetCountryCodeString()

Result CFGU_GetCountryCodeString ( u16  code,
u16 string 
)

Gets a string representing a country code.

Parameters
codeCountry code to use.
stringPointer to output the string to.

◆ CFGU_GetModelNintendo2DS()

Result CFGU_GetModelNintendo2DS ( u8 value)

Gets whether the system is a 2DS.

Parameters
valuePointer 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
valuePointer to output the result to. (0 = no, 1 = yes)

◆ CFGU_GetSystemLanguage()

Result CFGU_GetSystemLanguage ( u8 language)

Gets the system's language.

Parameters
languagePointer 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
modelPointer to output the model to. (see CFG_SystemModel)

◆ CFGU_IsNFCSupported()

Result CFGU_IsNFCSupported ( bool *  isSupported)

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

Parameters
isSupportedpointer to the output the result to.

◆ CFGU_SecureInfoGetRegion()

Result CFGU_SecureInfoGetRegion ( u8 region)

Gets the system's region from secure info.

Parameters
regionPointer to output the region to. (see CFG_Region)
Examples
network/boss/source/main.c.