From 07f7cad16faa235c92ea1f1c4e6d6c3f009c298f Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Wed, 18 Mar 2026 19:19:31 -0400 Subject: [PATCH] fix: pass hcstat2 output path as argument to hcstat2gen.bin - hcstat2gen.bin expects: hcstat2gen.bin < dictionary - Previously tried to write to stdout which caused 'usage' error - Now correctly passes output path as command argument - Markov training now works for both plain text and gzipped wordlists - Fixes 'Markov table generation failed' error --- hate_crack/main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hate_crack/main.py b/hate_crack/main.py index cfdc66f..605bbcc 100755 --- a/hate_crack/main.py +++ b/hate_crack/main.py @@ -2126,7 +2126,7 @@ def hcatMarkovTrain(source_file, hcatHashFile): try: with open(input_file, "rb") as stdin_f: hcatProcess = subprocess.Popen( - [hcstat2gen_bin], stdin=stdin_f, stdout=subprocess.PIPE, stderr=subprocess.PIPE + [hcstat2gen_bin, hcstat2_path], stdin=stdin_f, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) try: stdout_data, stderr_data = hcatProcess.communicate(timeout=300) @@ -2134,9 +2134,6 @@ def hcatMarkovTrain(source_file, hcatHashFile): err_msg = stderr_data.decode("utf-8", errors="replace") if stderr_data else "Unknown error" print(f"[!] hcstat2gen.bin failed with code {hcatProcess.returncode}: {err_msg}") return False - # Write stdout to hcstat2 file - with open(hcstat2_path, "wb") as f: - f.write(stdout_data) except subprocess.TimeoutExpired: print("[!] hcstat2gen.bin timed out after 300 seconds") hcatProcess.kill()