Merhabalar.
Ben bir çeşit anti-virüs yazdım (konularda bulabilirsiniz) çok güzel de çalışıyor ama işini yapıyor mu bilmiyorum yani DB ye aktardığım (DBl listesi ile) verileri düzdün şekilde işliyor mu anlayamadım (DB’nin gücünü sorun etmeyin onu güçlendireceğim) siz bir bakın lütfen.
from colorama import Fore
from hashlib import sha256
import colorama
import time
import sys
import json
colorama.init()
def scan(file):
with open(file, "rb") as f:
if sha256(f.read()).hexdigest() in DB:
return True
else:
return False
DBl = ["listener", "Listener", "LISTENER", "virus" ,"Virus" ,"VİRUS" ,"ransomware", "Ransomware", "RANSOMWARE" ,"ransom", "Ransom", "RANSOM", "locker", "Locker", "LOCKER", "lock", "Lock", "LOCK", "crypto", "Crypto", "CRYPTO", "crypter", "Crypter", "CRYPTER", "hacked", "Hacked", "HACKED", "hack", "Hack", "HACK"]
DB = DBı
print("welcome the py anti")
print("")
print(Fore.YELLOW)
print("""
|-------- | |
| | | |
| | | |
|-------- |
| | anti
| |
| |
""")
a=1
while a==1:
print(Fore.WHITE)
print("")
print("1 = scan a file")
print("")
print("2 = exit")
print("")
c1 = input(">>>")
if c1 == "2":
sys.exit()
if c1 == "1":
a=0
print("")
loc = input("file location: ")
if scan(loc):
print(Fore.RED)
print(f"Virus found in file! location: '{loc}'")
print(Fore.WHITE)
time.sleep(5)
a=1
else:
print(Fore.GREEN)
print("Dosya temiz.")
time.sleep(5)
a=1
Kodumuz bu bu python 3 kodudur hata bulursanız lütfen düzeltin.