pyctr.type.save.partdesc.dpfs module
- exception pyctr.type.save.partdesc.dpfs.DPFSReadOnlyError[source]
Bases:
PartitionDescriptorErrorThe DPFS level is read-only.
- class pyctr.type.save.partdesc.dpfs.DPFSLevel1(data, tree_selector)[source]
Bases:
DPFSLevelChunkBaseReads the contents of DPFS Level 1. In the DPFS tree, this contains bits that determine which blocks are active in DPFS Level 2.
- class pyctr.type.save.partdesc.dpfs.DPFSLevel2(data, block_size, lv1)[source]
Bases:
DPFSLevelChunkBaseReads the contents of DPFS Level 2. In the DPFS tree, this contains bits that determine which blocks are active in DPFS Level 3.
- Parameters:
data (bytes) – The DPFS Level 2 data.
block_size_log2 – Block size in log2.
lv1 (DPFSLevel1) – Level 1 to read active bits from.
block_size (int)
- class pyctr.type.save.partdesc.dpfs.DPFSLevel3FileIO(lv3)[source]
Bases:
RawIOBase- Parameters:
lv3 (DPFSLevel3)
- seek(offset, whence=0)[source]
Change the stream position to the given byte offset.
- offset
The stream position, relative to ‘whence’.
- whence
The relative position to seek from.
The offset is interpreted relative to the position indicated by whence. Values for whence are:
os.SEEK_SET or 0 – start of stream (the default); offset should be zero or positive
os.SEEK_CUR or 1 – current stream position; offset may be negative
os.SEEK_END or 2 – end of stream; offset is usually negative
Return the new absolute position.
- readable()[source]
Return whether object was opened for reading.
If False, read() will raise OSError.
- Return type:
- class pyctr.type.save.partdesc.dpfs.DPFSLevel3(fp, size, block_size, lv2)[source]
Bases:
objectReads the contents of DPFS Level 3. In the DPFS tree, this contains the actual data.
- Parameters:
fp (BinaryIO) – A file-like object with the DPFS Level 3 data.
size (int) – Size of the level. This should be the size of the final data, meaning the actual data read would be twice this size to account for the two chunks.
block_size (int) – Block size.
lv2 (DPFSLevel2) – Level 2 to read active bits from.