dissect.squashfs.squashfs

Module Contents

Classes

SquashFS

INode

FileStream

Create a stream from multiple runs on another file-like object.

class dissect.squashfs.squashfs.SquashFS(fh: BinaryIO)
fh
sb
mkfs_time
block_size
block_log
flags
major
minor
size
id_table
lookup_table
fragment_table
root
inode(block: int, offset: int, name: str | None = None, type: int | None = None, inode_number: int | None = None, parent: INode | None = None) INode
get(path: str | int, node: INode | None = None) INode
iter_inodes() Iterator[INode]
class dissect.squashfs.squashfs.INode(fs: SquashFS, block: int, offset: int, name: str | None = None, type: int | None = None, inode_number: int | None = None, parent: INode | None = None)
fs
block
offset
name
parent
__repr__() str
property header: dissect.squashfs.c_squashfs.c_squashfs.squashfs_base_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_dir_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_reg_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_symlink_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_dev_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_dev_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_base_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_base_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_ldir_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_lreg_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_symlink_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_ldev_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_ldev_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_lipc_inode_header | dissect.squashfs.c_squashfs.c_squashfs.squashfs_lipc_inode_header
property data_block: int
property data_offset: int
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: int | None
is_dir() bool
is_file() bool
is_block_device() bool
is_character_device() bool
is_device() bool
is_fifo() bool
is_socket() bool
is_ipc() bool
listdir() dict[str, INode]
iterdir() Iterator[INode]
property block_list: list[tuple[int | None, int]]
open() FileStream
class dissect.squashfs.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 of None 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.

  • align – Optional alignment that differs from the block size, otherwise block_size is used as alignment.

inode
fs
start_block
fragment
fragment_offset