seeddb
- SeedDB management
The seeddb
module handles seeds used for title encryption. This applies to digital games released after early 2015. Seeds were used to enable pre-purchasing and downloading titles before release without providing access to the actual contents before the release date.
When a CryptoEngine
object is initialized, by default it will attempt to load a seeddb.bin
using the paths defined in seeddb_paths
.
File format
The SeedDB file consists of a seed count, then each entry has a Title ID and its associated seed.
Offset |
Size |
Data |
---|---|---|
0x0 |
0x4 |
Entry count in little endian (C) |
0x4 |
0xC |
Padding |
0x10 |
(0x20 * C) |
Entries |
Offset |
Size |
Data |
---|---|---|
0x0 |
0x8 |
Title ID in little endian |
0x8 |
0x10 |
Seed |
0x18 |
0x8 |
Padding |
Functions
- pyctr.crypto.seeddb.load_seeddb(fp=None)[source]
Load a seeddb file.
- Parameters:
fp (FilePathOrObject) – A file path or file-like object with the seeddb data.
- pyctr.crypto.seeddb.get_seed(program_id, *, load_if_required=True)[source]
Get a seed for a Program ID.
- Parameters:
program_id (Union[int, str, bytes]) – The Program ID to search for. If bytes is provided, the value must be little-endian.
load_if_required (bool) – Automatically load using
load_seeddb()
if the requested Program ID is not already available.
Data
- pyctr.crypto.seeddb.seeddb_paths: Dict[int, bytes]
The list of paths that
load_seeddb()
will try to load from automatically. By default this is every path inpyctr.util.config_dirs
withseeddb.bin
. If the environment variableSEEDDB_PATH
is set, its value is put at the beginning of the list.