util - Utility functions

The util module contains extra useful functions.

pyctr.util.readle(b)[source]

Convert little-endian bytes to an int.

Parameters:

b (bytes) –

Return type:

int

pyctr.util.readbe(b)[source]

Convert big-endian bytes to an int.

Parameters:

b (bytes) –

Return type:

int

pyctr.util.roundup(offset, alignment)[source]

Round up a number to a provided alignment.

Parameters:
  • offset (int) –

  • alignment (int) –

Return type:

int

pyctr.util.windows: bool

If the current platform is Windows.

pyctr.util.macos: bool

If the current platform is macOS.

pyctr.util.config_dirs: List[str]

Data directories that should contain the ARM9 bootROM (boot9.bin), SeedDB (seeddb.bin), and other files.

This includes ~/.3ds and ~/3ds. On Windows this also includes %APPDATA%\3ds. On macOS this also includes ~/Library/Application Support/3ds.