fix crash

This commit is contained in:
2026-04-05 18:45:18 +10:00
parent a54bc2b107
commit 30e1c7a6dc
3 changed files with 2 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ class Hash(Detection):
console.print(f"[d] - MD5: {md5}\n - SHA1: {sha1}\n - SHA256: {sha256}[/]")
for virus_name, virus_hashes in hashes.items():
if virus_hashes["md5"] == md5 or virus_hashes["sha1"] == sha1 or virus_hashes["sha256"] == sha256:
if virus_hashes.get("md5", None) == md5 or virus_hashes.get("sha1", None) == sha1 or virus_hashes.get("sha256", None) == sha256:
console.print(f"[bold orange1]⚠️ HASH MATCH: {virus_name} DETECTED")
return True

View File

@@ -2,4 +2,4 @@ from scanner import Scanner
scanner = Scanner()
scanner.scan_file("virus")
scanner.scan_file("a.out")