:py:mod:`dissect.hypervisor.disk.vmdk` ====================================== .. py:module:: dissect.hypervisor.disk.vmdk Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.hypervisor.disk.vmdk.VMDK dissect.hypervisor.disk.vmdk.RawDisk dissect.hypervisor.disk.vmdk.SparseDisk dissect.hypervisor.disk.vmdk.SparseExtentHeader dissect.hypervisor.disk.vmdk.ExtentDescriptor dissect.hypervisor.disk.vmdk.DiskDescriptor Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: dissect.hypervisor.disk.vmdk.open_parent Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.hypervisor.disk.vmdk.log dissect.hypervisor.disk.vmdk.RE_EXTENT_DESCRIPTOR .. py:data:: log .. py:class:: VMDK(fh: BinaryIO | pathlib.Path | str | list[BinaryIO | pathlib.Path | str]) Bases: :py:obj:`dissect.util.stream.AlignedStream` Basic buffered stream that provides aligned reads. Must be subclassed for various stream implementations. Subclasses can implement: - :meth:`~AlignedStream._read` - :meth:`~AlignedStream._seek` The offset and length for ``_read`` are guaranteed to be aligned for streams of a known size. If your stream has an unknown size (i.e. ``size == None``), reads of length ``-1`` (i.e. read until EOF) will be passed through to your implementation of ``_read``. The only time that overriding ``_seek`` would make sense is if there's no known size of your stream, but still want to provide ``SEEK_END`` functionality. Most subclasses of ``AlignedStream`` take one or more file-like objects as source. Operations on these subclasses, like reading, will modify the source file-like object as a side effect. :param size: The size of the stream. This is used in read and seek operations. ``None`` if unknown. :param align: The alignment size. Read operations are aligned on this boundary. Also determines buffer size. .. automethod:: _read .. automethod:: _seek .. py:attribute:: disks :value: [] .. py:attribute:: parent :value: None .. py:attribute:: descriptor :value: None .. py:attribute:: sector_count :value: 0 .. py:method:: read_sectors(sector: int, count: int) -> bytes .. py:class:: RawDisk(fh: BinaryIO, size: int | None = None, offset: int = 0, sector_offset: int = 0) .. py:attribute:: fh .. py:attribute:: offset :value: 0 .. py:attribute:: sector_offset :value: 0 .. py:attribute:: sector_count .. py:attribute:: read .. py:attribute:: seek .. py:attribute:: tell .. py:method:: read_sectors(sector: int, count: int) -> bytes .. py:class:: SparseDisk(fh: BinaryIO, parent: VMDK | RawDisk | SparseDisk | None = None, offset: int = 0, sector_offset: int = 0) .. py:attribute:: fh .. py:attribute:: parent :value: None .. py:attribute:: offset :value: 0 .. py:attribute:: sector_offset :value: 0 .. py:attribute:: filesize .. py:attribute:: descriptor :value: None .. py:attribute:: header .. py:attribute:: size .. py:attribute:: sector_count .. py:method:: get_runs(sector: int, count: int) -> list[tuple[int, int, int, int | None]] .. py:method:: read_sectors(sector: int, count: int) -> bytes .. py:class:: SparseExtentHeader(fh: BinaryIO) .. py:method:: __getattr__(attr: str) -> Any .. py:data:: RE_EXTENT_DESCRIPTOR .. py:class:: ExtentDescriptor .. py:attribute:: raw :type: str .. py:attribute:: access_mode :type: str .. py:attribute:: sectors :type: int .. py:attribute:: type :type: str .. py:attribute:: filename :type: str | None :value: None .. py:attribute:: start_sector :type: int | None :value: None .. py:attribute:: partition_uuid :type: str | None :value: None .. py:attribute:: device_identifier :type: str | None :value: None .. py:method:: __post_init__() -> None .. py:method:: __repr__() -> str .. py:method:: __str__() -> str .. py:class:: DiskDescriptor(attr: dict, extents: list[ExtentDescriptor], disk_db: dict, sectors: int, raw_config: str | None = None) .. py:attribute:: attr .. py:attribute:: extents .. py:attribute:: ddb .. py:attribute:: sectors .. py:attribute:: raw :value: None .. py:method:: parse(vmdk_config: str) -> DiskDescriptor :classmethod: Return :class:`DiskDescriptor` based on the provided ``vmdk_config``. Resources: - https://github.com/libyal/libvmdk/blob/main/documentation/VMWare%20Virtual%20Disk%20Format%20(VMDK).asciidoc .. py:method:: __str__() -> str .. py:function:: open_parent(path: pathlib.Path, filename_hint: str) -> VMDK