:py:mod:`dissect.squashfs` ========================== .. py:module:: dissect.squashfs Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 c_squashfs/index.rst compression/index.rst exceptions/index.rst squashfs/index.rst Package Contents ---------------- Classes ~~~~~~~ .. autoapisummary:: dissect.squashfs.FileStream dissect.squashfs.INode dissect.squashfs.SquashFS .. py:exception:: Error Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. .. py:exception:: FileNotFoundError Bases: :py:obj:`Error` Common base class for all non-exit exceptions. .. py:exception:: NotADirectoryError Bases: :py:obj:`Error` Common base class for all non-exit exceptions. .. py:exception:: NotAFileError Bases: :py:obj:`Error` Common base class for all non-exit exceptions. .. py:exception:: NotASymlinkError Bases: :py:obj:`Error` Common base class for all non-exit exceptions. .. py:class:: FileStream(inode: INode) Bases: :py:obj:`dissect.util.stream.RunlistStream` Create a stream from multiple runs on another file-like object. This is common in filesystems, where file data information is stored in "runs". A run is a ``(block_offset, block_count)`` tuple, meaning the amount of consecutive blocks from a specific starting block. A block_offset of ``None`` represents a sparse run, meaning it must simply return all ``\x00`` bytes. :param fh: The source file-like object. :param runlist: The runlist for this stream in block units. :param size: The size of the stream. This can be smaller than the total sum of blocks (to account for slack space). :param block_size: The block size in bytes. :param align: Optional alignment that differs from the block size, otherwise ``block_size`` is used as alignment. .. py:class:: INode(fs: SquashFS, block: int, offset: int, name: Optional[str] = None, type: Optional[int] = None, inode_number: Optional[int] = None, parent: Optional[INode] = None) .. py:property:: inode_number :type: int .. py:property:: type :type: int .. py:property:: mode :type: int .. py:property:: uid :type: int .. py:property:: guid :type: int .. py:property:: gid :type: int .. py:property:: mtime :type: datetime.datetime .. py:property:: size :type: Optional[int] .. py:method:: __repr__() -> str Return repr(self). .. py:method:: header() -> dissect.cstruct.Instance .. py:method:: data_block() -> int .. py:method:: data_offset() -> int .. py:method:: is_dir() -> bool .. py:method:: is_file() -> bool .. py:method:: is_symlink() -> bool .. py:method:: is_block_device() -> bool .. py:method:: is_character_device() -> bool .. py:method:: is_device() -> bool .. py:method:: is_fifo() -> bool .. py:method:: is_socket() -> bool .. py:method:: is_ipc() -> bool .. py:method:: link() -> str .. py:method:: link_inode() -> INode .. py:method:: listdir() -> dict[str, INode] .. py:method:: iterdir() -> Iterator[INode] .. py:method:: block_list() -> list[tuple[Optional[int], int]] .. py:method:: open() -> FileStream .. py:class:: SquashFS(fh: BinaryIO) .. py:method:: inode(block: int, offset: int, name: Optional[str] = None, type: Optional[int] = None, inode_number: Optional[int] = None, parent: Optional[INode] = None) -> INode .. py:method:: get(path: Union[str, int], node: Optional[INode] = None) -> INode .. py:method:: iter_inodes() -> Iterator[INode]