pyctr.type.save.partition module

pyctr.type.save.partition.load_partdesc(partdesc)[source]

Load a partition descriptor.

Parameters:

partdesc (bytes) – The partition descriptor. The first 0x44 must be a DIFI header. The rest is determined by the DIFI.

pyctr.type.save.partition.partdesc_to_bytes(difi, ivfc, dpfs, master_hashes, size)[source]
class pyctr.type.save.partition.Partition(fp, difi, ivfc, dpfs, master_hashes, *, update_partdesc_callback=None, partdesc_size=None)[source]

Bases: object

Reads a partition found within DISA and DIFF files.

Parameters:
  • fp (BinaryIO) – A file-like object with the partition data.

  • difi (DIFI) – DIFI header from the partition descriptor.

  • ivfc (IVFC) – IVFC descriptor from the partition descriptor.

  • dpfs (DPFS) – DPFS descriptor from the partition descriptor.

  • master_hashes (list[bytes]) – A list of SHA-256 hashes over IVFC Level 1.

  • update_partdesc_callback (Callable[[bytes], None])

  • partdesc_size (int)