From 2d5df403d375c39d57ae1ac41cc39d1107b61a13 Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Mon, 23 Feb 2026 15:21:42 -0500 Subject: [PATCH] fix: handle KeyboardInterrupt in hashview_api without crashing Ctrl+C at the hashview customer ID prompt called quit_hc(), which calls cleanup(), but cleanup() assumed hcatHashFileOrig was set. When no hash file is loaded yet, this caused a TypeError. Now hashview_api returns to the main menu on KeyboardInterrupt (matching hashmob/weakpass behavior), and cleanup() guards against None hcatHashFileOrig defensively. Co-Authored-By: Claude Opus 4.6 --- hate_crack/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hate_crack/main.py b/hate_crack/main.py index 7042bca..5a0e0d3 100755 --- a/hate_crack/main.py +++ b/hate_crack/main.py @@ -2611,6 +2611,8 @@ def cleanup(): global pwdump_format global hcatHashFileOrig try: + if not hcatHashFileOrig: + return if hcatHashType == "1000" and pwdump_format: print("\nComparing cracked hashes to original file...") combine_ntlm_output() @@ -3252,7 +3254,8 @@ def hashview_api(): break except KeyboardInterrupt: - quit_hc() + print("\nKeyboard interrupt: Returning to main menu...") + return except Exception as e: print(f"\nError connecting to Hashview: {str(e)}")