:py:mod:`dissect.util.compression.xz` ===================================== .. py:module:: dissect.util.compression.xz Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: dissect.util.compression.xz.repair_checksum Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.util.compression.xz.HEADER_FOOTER_SIZE dissect.util.compression.xz.CRC_SIZE .. py:data:: HEADER_FOOTER_SIZE :value: 12 .. py:data:: CRC_SIZE :value: 4 .. py:function:: repair_checksum(fh: BinaryIO) -> BinaryIO Repair CRC32 checksums for all headers in an XZ stream. FortiOS XZ files have (on purpose) corrupt streams which they read using a modified ``xz`` binary. The only thing changed are the CRC32 checksums, so partially parse the XZ file and fix all of them. .. rubric:: References - https://tukaani.org/xz/xz-file-format-1.1.0.txt - https://github.com/Rogdham/python-xz :param fh: A file-like object of an LZMA stream to repair.