pyctr.type.save.diff module

class pyctr.type.save.diff.DIFF(file, mode='rb', *, fs=None, closefd=None, crypto=None, dev=False, cmac_base=None, sd_key_file=None, sd_key=None)[source]

Bases: PartitionContainerBase

Reads and writes to DIFF files.

Parameters:
  • file (FilePathOrObject) – A file path or a file-like object with the DIFF data.

  • mode (ReadWriteBinaryFileModes) – Mode to open the file with, passed to open. Only used if a file path was given.

  • closefd (bool | None) – Close the underlying file object when closed. Defaults to True for file paths, and False for file-like objects.

  • crypto (CryptoEngine) – A custom CryptoEngine object to be used. Defaults to None, which causes a new one to be created.

  • dev (bool) – Use devunit keys.

  • cmac_base (CMACTypeBase) – A CMACTypeBase object that describes how to update the CMAC.

  • sd_key_file (FilePath) – Path to a movable.sed file to load the SD KeyY from.

  • sd_key (bytes) – SD KeyY to use. Has priority over sd_key_file if both are specified.

  • fs (FS | None)

partitions: dict[int, Partition]

Partitions of the file. DIFF only has one, so there would only be a single 0 key.