:py:mod:`dissect.apfs.objects.base` =================================== .. py:module:: dissect.apfs.objects.base Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.apfs.objects.base.Object .. py:class:: Object(container: dissect.apfs.apfs.APFS, address: int, *, block: bytes | None = None, cipher: dissect.fve.crypto.Cipher | None = None) Base class for APFS objects. The way we use this is a little unorthodox OOP-wise, but it works well for our use case. For the core of our APFS implementation we want to be able to read any object directly from a known type, but for interactive use it would also be nice to be able to read an object from its address and have it automatically be the correct subclass. Subclasses should define the ``__type__`` and ``__struct__`` class variables. :param container: The APFS container the object belongs to. :param address: The block address of the object within the container. :param block: Optionally, the raw block data of the object. If not provided, it will be read from the container. :param cipher: Optionally, a cipher to decrypt the object (or child objects). .. py:attribute:: __type__ .. py:attribute:: __struct__ .. py:attribute:: __known_types__ :type: ClassVar[dict[int, type[Object]]] .. py:method:: __init_subclass__() :classmethod: .. py:attribute:: container .. py:attribute:: address .. py:attribute:: block .. py:attribute:: cipher :value: None .. py:attribute:: object .. py:method:: __repr__() -> str .. py:method:: from_address(container: dissect.apfs.apfs.APFS, address: int, count: int = 1, *, cipher: dissect.fve.crypto.Cipher | None = None) -> Self :classmethod: Load an object from its address, automatically determining the correct subclass. .. py:method:: from_block(container: dissect.apfs.apfs.APFS, address: int, block: bytes, *, cipher: dissect.fve.crypto.Cipher | None = None) -> Self :classmethod: Load an object from its raw block data, automatically determining the correct subclass. .. py:property:: checksum :type: int The object's checksum. .. py:method:: is_valid() -> bool Check if the object's checksum is valid. .. py:property:: oid :type: int The object's ID. .. py:property:: xid :type: int The object's transaction ID. .. py:property:: type :type: dissect.apfs.c_apfs.c_apfs.OBJECT_TYPE The object's type. .. py:property:: type_flags :type: dissect.apfs.c_apfs.c_apfs.OBJ The object's type flags. .. py:property:: storage_type :type: dissect.apfs.c_apfs.c_apfs.OBJ The object's storage type. .. py:property:: is_virtual :type: bool Check if the object is stored as a virtual object. .. py:property:: is_ephemeral :type: bool Check if the object is stored as an ephemeral object. .. py:property:: is_physical :type: bool Check if the object is stored as a physical object. .. py:property:: is_encrypted :type: bool Check if the object is encrypted. .. py:property:: subtype :type: dissect.apfs.c_apfs.c_apfs.OBJECT_TYPE The object's subtype.