dissect.util.compression.lzfse

Module Contents

Classes

LZFSECompressedBlockHeader

LZFSE compressed block header.

DecoderEntry

Entry for one state in the decoder table.

ValueDecoderEntry

Entry for one state in the value decoder table.

Functions

decompress

LZFSE decompress from a file-like object or bytes.

Attributes

dissect.util.compression.lzfse.LZFSE_ENDOFSTREAM_BLOCK_MAGIC = b'bvx$'
dissect.util.compression.lzfse.LZFSE_UNCOMPRESSED_BLOCK_MAGIC = b'bvx-'
dissect.util.compression.lzfse.LZFSE_COMPRESSEDV1_BLOCK_MAGIC = b'bvx1'
dissect.util.compression.lzfse.LZFSE_COMPRESSEDV2_BLOCK_MAGIC = b'bvx2'
dissect.util.compression.lzfse.LZFSE_COMPRESSEDLZVN_BLOCK_MAGIC = b'bvxn'
dissect.util.compression.lzfse.LZFSE_ENCODE_L_SYMBOLS = 20
dissect.util.compression.lzfse.LZFSE_ENCODE_M_SYMBOLS = 20
dissect.util.compression.lzfse.LZFSE_ENCODE_D_SYMBOLS = 64
dissect.util.compression.lzfse.LZFSE_ENCODE_LITERAL_SYMBOLS = 256
dissect.util.compression.lzfse.LZFSE_ENCODE_L_STATES = 64
dissect.util.compression.lzfse.LZFSE_ENCODE_M_STATES = 64
dissect.util.compression.lzfse.LZFSE_ENCODE_D_STATES = 256
dissect.util.compression.lzfse.LZFSE_ENCODE_LITERAL_STATES = 1024
dissect.util.compression.lzfse.LZFSE_MATCHES_PER_BLOCK = 10000
dissect.util.compression.lzfse.LZFSE_LITERALS_PER_BLOCK = 40000
class dissect.util.compression.lzfse.LZFSECompressedBlockHeader

Bases: NamedTuple

LZFSE compressed block header.

__struct_v1__
__struct_v2__
n_raw_bytes: int
n_payload_bytes: int
n_literals: int
n_matches: int
n_literal_payload_bytes: int
n_lmd_payload_bytes: int
literal_bits: int
literal_state: tuple[int, int, int, int]
lmd_bits: int
l_state: int
m_state: int
d_state: int
l_freq: tuple[int, Ellipsis]
m_freq: tuple[int, Ellipsis]
d_freq: tuple[int, Ellipsis]
literal_freq: tuple[int, Ellipsis]
classmethod parse_v1(fh: BinaryIO) LZFSECompressedBlockHeader

Decode all fields from a v1 header.

classmethod parse_v2(fh: BinaryIO) LZFSECompressedBlockHeader

Decode all fields from a v2 header.

class dissect.util.compression.lzfse.DecoderEntry

Bases: NamedTuple

Entry for one state in the decoder table.

k: int
symbol: int
delta: int
class dissect.util.compression.lzfse.ValueDecoderEntry

Bases: NamedTuple

Entry for one state in the value decoder table.

total_bits: int
value_bits: int
delta: int
vbase: int
dissect.util.compression.lzfse.decompress(src: bytes | BinaryIO) bytes

LZFSE decompress from a file-like object or bytes.

Decompresses until EOF or EOS of the input data.

Parameters:

src – File-like object or bytes to decompress.

Returns:

The decompressed data.