pyctr.type.config.save module
- exception pyctr.type.config.save.ConfigSaveError[source]
Bases:
PyCTRErrorGeneric error for Config Save operations.
- exception pyctr.type.config.save.InvalidConfigSaveError[source]
Bases:
ConfigSaveErrorConfig Save is corrupted.
- exception pyctr.type.config.save.OutOfSpaceConfigSaveError[source]
Bases:
ConfigSaveErrorConfig Save generation ran out of space for data.
- exception pyctr.type.config.save.BlockFlagsNotAllowed(flags)[source]
Bases:
ConfigSaveErrorFlags not allowed. Must be 8, 12, 10, or 14 (0x8, 0xC, 0xA, or 0xE).
- Parameters:
flags (int)
- exception pyctr.type.config.save.BlockIDNotFoundError(block_id)[source]
Bases:
ConfigSaveErrorBlock ID not found.
- Parameters:
block_id (int)
- exception pyctr.type.config.save.InvalidBlockDataError[source]
Bases:
ConfigSaveErrorBlock data was invalid (like flags or size)
- class pyctr.type.config.save.ConfigSaveReader[source]
Bases:
objectClass for 3DS Config Save.
https://www.3dbrew.org/wiki/Config_Savegame
- to_bytes()[source]
Converts the object to a raw config save file.
CFG adds new block from end to start of file for any block > 4 bytes. Any block <= 4 bytes only get a block entry.
Note that this may not result in bit-for-bit the same as the input file due to garbage in unused parts of the file that this doesn’t load.
- Returns:
Raw config save data.
- Return type:
- save(fn)[source]
Save the config save to a file.
- Parameters:
fn (FilePath) – File path to write to.
- set_block(block_id, data, flags=None, *, strict=True)[source]
Sets or adds a config block.
- Parameters:
block_id (int) – Block ID.
data (bytes) – Block data.
flags (int) – Block flags, determining access permissions. Must be 8, 12, 10, or 14 (0x8, 0xC, 0xA, or 0xE). Defaults to the known flags for the Block ID if it doesn’t exist.
strict (bool) – Only allow known Block IDs and their sizes and flags. This list is in
KNOWN_BLOCKS. Setting this to False will allow using any Block ID with any data size, but flags must still be of the four allowed.