mirror of
https://github.com/trustedsec/hate_crack.git
synced 2026-07-28 14:47:22 -07:00
fix: honor config.json hcatPath/hcatBin in Makefile preflight check
The submodules-pre hashcat check now reads hcatPath and hcatBin from config.json (mirroring main.py resolution logic) before falling back to PATH lookup and the vendored hate_crack/hashcat/hashcat binary.
This commit is contained in:
@@ -33,8 +33,21 @@ submodules:
|
||||
fi
|
||||
|
||||
submodules-pre:
|
||||
@command -v hashcat >/dev/null 2>&1 || { \
|
||||
echo "Error: hashcat not found. Install hashcat (e.g. apt install hashcat or brew install hashcat)."; exit 1; }
|
||||
@_hcat_bin="hashcat"; _hcat_path=""; \
|
||||
if [ -f config.json ] && command -v python3 >/dev/null 2>&1; then \
|
||||
_hcat_bin=$$(python3 -c "import json; d=json.load(open('config.json')); print(d.get('hcatBin','hashcat'))" 2>/dev/null || echo "hashcat"); \
|
||||
_hcat_path=$$(python3 -c "import json,os; d=json.load(open('config.json')); print(os.path.expanduser(d.get('hcatPath','')))" 2>/dev/null || echo ""); \
|
||||
fi; \
|
||||
_found=0; \
|
||||
if [ -n "$$_hcat_path" ] && [ -f "$$_hcat_path/$$_hcat_bin" ] && [ -x "$$_hcat_path/$$_hcat_bin" ]; then \
|
||||
_found=1; \
|
||||
elif command -v "$$_hcat_bin" >/dev/null 2>&1; then \
|
||||
_found=1; \
|
||||
elif [ -x "hate_crack/hashcat/hashcat" ]; then \
|
||||
_found=1; \
|
||||
fi; \
|
||||
[ "$$_found" = "1" ] || { \
|
||||
echo "Error: hashcat not found. Checked hcatPath=\"$$_hcat_path\" hcatBin=\"$$_hcat_bin\" and PATH. Install hashcat (e.g. apt install hashcat or brew install hashcat)."; exit 1; }
|
||||
@test -d hashcat-utils || { echo "Error: missing required directory: hashcat-utils"; exit 1; }
|
||||
@test -d princeprocessor || { echo "Error: missing required directory: princeprocessor"; exit 1; }
|
||||
@test -d omen || { echo "Warning: missing directory: omen (OMEN attacks will not be available)"; }
|
||||
|
||||
Reference in New Issue
Block a user