:py:mod:`dissect.util.compression.lzfse` ======================================== .. py:module:: dissect.util.compression.lzfse Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.util.compression.lzfse.LZFSECompressedBlockHeader dissect.util.compression.lzfse.DecoderEntry dissect.util.compression.lzfse.ValueDecoderEntry Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: dissect.util.compression.lzfse.decompress Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.util.compression.lzfse.LZFSE_ENDOFSTREAM_BLOCK_MAGIC dissect.util.compression.lzfse.LZFSE_UNCOMPRESSED_BLOCK_MAGIC dissect.util.compression.lzfse.LZFSE_COMPRESSEDV1_BLOCK_MAGIC dissect.util.compression.lzfse.LZFSE_COMPRESSEDV2_BLOCK_MAGIC dissect.util.compression.lzfse.LZFSE_COMPRESSEDLZVN_BLOCK_MAGIC dissect.util.compression.lzfse.LZFSE_ENCODE_L_SYMBOLS dissect.util.compression.lzfse.LZFSE_ENCODE_M_SYMBOLS dissect.util.compression.lzfse.LZFSE_ENCODE_D_SYMBOLS dissect.util.compression.lzfse.LZFSE_ENCODE_LITERAL_SYMBOLS dissect.util.compression.lzfse.LZFSE_ENCODE_L_STATES dissect.util.compression.lzfse.LZFSE_ENCODE_M_STATES dissect.util.compression.lzfse.LZFSE_ENCODE_D_STATES dissect.util.compression.lzfse.LZFSE_ENCODE_LITERAL_STATES dissect.util.compression.lzfse.LZFSE_MATCHES_PER_BLOCK dissect.util.compression.lzfse.LZFSE_LITERALS_PER_BLOCK .. py:data:: LZFSE_ENDOFSTREAM_BLOCK_MAGIC :value: b'bvx$' .. py:data:: LZFSE_UNCOMPRESSED_BLOCK_MAGIC :value: b'bvx-' .. py:data:: LZFSE_COMPRESSEDV1_BLOCK_MAGIC :value: b'bvx1' .. py:data:: LZFSE_COMPRESSEDV2_BLOCK_MAGIC :value: b'bvx2' .. py:data:: LZFSE_COMPRESSEDLZVN_BLOCK_MAGIC :value: b'bvxn' .. py:data:: LZFSE_ENCODE_L_SYMBOLS :value: 20 .. py:data:: LZFSE_ENCODE_M_SYMBOLS :value: 20 .. py:data:: LZFSE_ENCODE_D_SYMBOLS :value: 64 .. py:data:: LZFSE_ENCODE_LITERAL_SYMBOLS :value: 256 .. py:data:: LZFSE_ENCODE_L_STATES :value: 64 .. py:data:: LZFSE_ENCODE_M_STATES :value: 64 .. py:data:: LZFSE_ENCODE_D_STATES :value: 256 .. py:data:: LZFSE_ENCODE_LITERAL_STATES :value: 1024 .. py:data:: LZFSE_MATCHES_PER_BLOCK :value: 10000 .. py:data:: LZFSE_LITERALS_PER_BLOCK :value: 40000 .. py:class:: LZFSECompressedBlockHeader Bases: :py:obj:`NamedTuple` LZFSE compressed block header. .. py:attribute:: __struct_v1__ .. py:attribute:: __struct_v2__ .. py:attribute:: n_raw_bytes :type: int .. py:attribute:: n_payload_bytes :type: int .. py:attribute:: n_literals :type: int .. py:attribute:: n_matches :type: int .. py:attribute:: n_literal_payload_bytes :type: int .. py:attribute:: n_lmd_payload_bytes :type: int .. py:attribute:: literal_bits :type: int .. py:attribute:: literal_state :type: tuple[int, int, int, int] .. py:attribute:: lmd_bits :type: int .. py:attribute:: l_state :type: int .. py:attribute:: m_state :type: int .. py:attribute:: d_state :type: int .. py:attribute:: l_freq :type: tuple[int, Ellipsis] .. py:attribute:: m_freq :type: tuple[int, Ellipsis] .. py:attribute:: d_freq :type: tuple[int, Ellipsis] .. py:attribute:: literal_freq :type: tuple[int, Ellipsis] .. py:method:: parse_v1(fh: BinaryIO) -> LZFSECompressedBlockHeader :classmethod: Decode all fields from a v1 header. .. py:method:: parse_v2(fh: BinaryIO) -> LZFSECompressedBlockHeader :classmethod: Decode all fields from a v2 header. .. py:class:: DecoderEntry Bases: :py:obj:`NamedTuple` Entry for one state in the decoder table. .. py:attribute:: k :type: int .. py:attribute:: symbol :type: int .. py:attribute:: delta :type: int .. py:class:: ValueDecoderEntry Bases: :py:obj:`NamedTuple` Entry for one state in the value decoder table. .. py:attribute:: total_bits :type: int .. py:attribute:: value_bits :type: int .. py:attribute:: delta :type: int .. py:attribute:: vbase :type: int .. py:function:: decompress(src: bytes | BinaryIO) -> bytes LZFSE decompress from a file-like object or bytes. Decompresses until EOF or EOS of the input data. :param src: File-like object or bytes to decompress. :returns: The decompressed data.