dissect.squashfs
#
Submodules#
Package Contents#
Classes#
Create a stream from multiple runs on another file-like object. |
|
- exception dissect.squashfs.Error#
Bases:
Exception
Common base class for all non-exit exceptions.
- exception dissect.squashfs.FileNotFoundError#
Bases:
Error
Common base class for all non-exit exceptions.
- exception dissect.squashfs.NotADirectoryError#
Bases:
Error
Common base class for all non-exit exceptions.
- exception dissect.squashfs.NotAFileError#
Bases:
Error
Common base class for all non-exit exceptions.
- exception dissect.squashfs.NotASymlinkError#
Bases:
Error
Common base class for all non-exit exceptions.
- class dissect.squashfs.FileStream(inode: INode)#
Bases:
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 ofNone
represents a sparse run, meaning it must simply return all\x00
bytes.- Parameters:
fh – The source file-like object.
runlist – The runlist for this stream in block units.
size – The size of the stream. This can be smaller than the total sum of blocks (to account for slack space).
block_size – The block size in bytes.
- class dissect.squashfs.INode(fs: SquashFS, block: int, offset: int, name: Optional[str] = None, type: Optional[int] = None, inode_number: Optional[int] = None, parent: Optional[INode] = None)#
- property inode_number: int#
- property type: int#
- property mode: int#
- property uid: int#
- property guid: int#
- property gid: int#
- property mtime: datetime.datetime#
- property size: Optional[int]#
- __repr__() str #
Return repr(self).
- header() dissect.cstruct.Instance #
- is_dir() bool #
- is_file() bool #
- is_symlink() bool #
- is_block_device() bool #
- is_character_device() bool #
- is_device() bool #
- is_fifo() bool #
- is_socket() bool #
- is_ipc() bool #
- link() str #
- block_list() list[tuple[Optional[int], int]] #
- open() FileStream #