mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-04-28 12:03:11 -07:00
fix: use raw LZMA2 stream instead of XZ container for hcstat2 compression
hashcat's Lzma2Decode() expects a raw LZMA2 stream starting with 0xff chunk headers, not an XZ container format (0xfd 37 7a...). FORMAT_RAW with FILTER_LZMA2 produces the correct format.
This commit is contained in:
@@ -2126,8 +2126,12 @@ def hcatMarkovTrain(source_file, hcatHashFile):
|
||||
try:
|
||||
with open(hcstat2_path, "rb") as f_in:
|
||||
uncompressed_data = f_in.read()
|
||||
# Use XZ format which is LZMA2-based
|
||||
compressed_data = lzma.compress(uncompressed_data, format=lzma.FORMAT_XZ, preset=9)
|
||||
# Use raw LZMA2 stream (not XZ container) - hashcat decodes with Lzma2Decode()
|
||||
compressed_data = lzma.compress(
|
||||
uncompressed_data,
|
||||
format=lzma.FORMAT_RAW,
|
||||
filters=[{"id": lzma.FILTER_LZMA2, "preset": 9}],
|
||||
)
|
||||
with open(hcstat2_path, "wb") as f_out:
|
||||
f_out.write(compressed_data)
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user