:py:mod:`dissect.archive.wim` ============================= .. py:module:: dissect.archive.wim Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.archive.wim.WIM dissect.archive.wim.Resource dissect.archive.wim.Image dissect.archive.wim.SecurityBlock dissect.archive.wim.DirectoryEntry dissect.archive.wim.ReparsePoint dissect.archive.wim.CompressedStream Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.archive.wim.DEFAULT_CHUNK_SIZE .. py:data:: DEFAULT_CHUNK_SIZE :value: 32768 .. py:class:: WIM(fh: BinaryIO) Windows Imaging Format implementation. Supports reading resources and browsing images from WIM files. .. py:attribute:: fh .. py:attribute:: header .. py:property:: resources :type: dict[bytes, Resource] Return the table of resources in the WIM file. .. py:method:: images() -> collections.abc.Iterator[Image] Iterate over all images in the WIM file. .. py:class:: Resource(wim: WIM, size: int, flags: dissect.archive.c_wim.RESHDR_FLAG, offset: int, original_size: int, part_number: int | None = None, reference_count: int | None = None, hash: bytes | None = None) .. py:attribute:: __slots__ :value: ('flags', 'hash', 'offset', 'original_size', 'part_number', 'reference_count', 'size', 'wim') .. py:attribute:: wim .. py:attribute:: size .. py:attribute:: flags .. py:attribute:: offset .. py:attribute:: original_size .. py:attribute:: part_number :value: None .. py:attribute:: reference_count :value: None .. py:attribute:: hash :value: None .. py:method:: from_short_header(wim: WIM, reshdr: dissect.archive.c_wim.c_wim.RESHDR_DISK_SHORT) -> Resource :classmethod: .. py:method:: from_header(wim: WIM, reshdr: dissect.archive.c_wim.c_wim.RESHDR_DISK) -> Resource :classmethod: .. py:property:: is_metadata :type: bool .. py:property:: is_compressed :type: bool .. py:property:: is_spanned :type: bool .. py:method:: open() -> BinaryIO .. py:class:: Image(wim: WIM, fh: BinaryIO) .. py:attribute:: wim .. py:attribute:: security .. py:attribute:: root .. py:method:: __repr__() -> str .. py:method:: get(path: str, entry: DirectoryEntry | None = None) -> DirectoryEntry .. py:class:: SecurityBlock(fh: BinaryIO) .. py:attribute:: header .. py:attribute:: descriptors :value: [] .. py:class:: DirectoryEntry(image: Image, fh: BinaryIO) .. py:attribute:: image .. py:attribute:: fh .. py:attribute:: entry .. py:attribute:: name :value: None .. py:attribute:: short_name :value: None .. py:attribute:: extra :value: None .. py:attribute:: streams .. py:method:: __repr__() -> str .. py:method:: is_dir() -> bool Return whether this entry is a directory. .. py:method:: is_file() -> bool Return whether this entry is a regular file. .. py:method:: is_reparse_point() -> bool Return whether this entry is a reparse point. .. py:method:: is_symlink() -> bool Return whether this entry is a symlink reparse point. .. py:method:: is_mount_point() -> bool Return whether this entry is a mount point reparse point. .. py:property:: reparse_point :type: ReparsePoint Return parsed reparse point data if this directory entry is a reparse point. .. py:method:: readlink() -> str .. py:method:: size(name: str = '') -> int Return the entry size. .. py:property:: creation_time :type: datetime.datetime Return the creation time. .. py:property:: creation_time_ns :type: int Return the creation time in nanoseconds. .. py:property:: last_access_time :type: datetime.datetime Return the last access time. .. py:property:: last_access_time_ns :type: int Return the last access time in nanoseconds. .. py:property:: last_write_time :type: datetime.datetime Return the last write time. .. py:property:: last_write_time_ns :type: int Return the last write time in nanoseconds. .. py:method:: listdir() -> dict[str, DirectoryEntry] Return a directory listing. .. py:method:: iterdir() -> collections.abc.Iterator[DirectoryEntry] Iterate directory contents. .. py:method:: open(name: str = '') -> BinaryIO Return a file-like object for the contents of this directory entry. :param name: Optional alternate stream name to open. .. py:class:: ReparsePoint(tag: dissect.archive.c_wim.IO_REPARSE_TAG, fh: BinaryIO) Utility class for parsing reparse point buffers. :param tag: The type of reparse point to parse. :param fh: A file-like object of the reparse point buffer. .. py:attribute:: tag .. py:attribute:: info :value: None .. py:property:: substitute_name :type: str | None .. py:property:: print_name :type: str | None .. py:property:: absolute :type: bool .. py:property:: relative :type: bool .. py:class:: CompressedStream(fh: BinaryIO, offset: int, compressed_size: int, original_size: int, decompressor: collections.abc.Callable[[bytes], bytes], chunk_size: int = DEFAULT_CHUNK_SIZE) 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:: fh .. py:attribute:: offset .. py:attribute:: compressed_size .. py:attribute:: original_size .. py:attribute:: decompressor .. py:attribute:: chunk_size :value: 32768