Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
87owo authored Feb 11, 2024
1 parent 9b32fa6 commit 819742d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions PYAS.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ def protect_proc_thread(self):
for p in psutil.process_iter():
existing_processes.add(p.pid)
while self.proc_protect:
time.sleep(0.1)
time.sleep(0.01)
for p in psutil.process_iter():
try:
if p.pid not in existing_processes:
Expand Down Expand Up @@ -1295,15 +1295,17 @@ def protect_file_thread(self):
try:
fpath = str(f"C:/{file}").replace("\\", "/")
ftype = str(f".{fpath.split('.')[-1]}").lower()
if action == 2 and ":/Users" in fpath and ftype in alist:
if "/AppData/" not in fpath:
if action == 2 and ":/Users" in fpath and "/AppData/" not in fpath:
if ftype in alist:
self.proc.kill()
file = self.proc.exe().replace("\\", "/")
self.send_notify(self.trans("勒索行為攔截: ")+file)
elif action == 3 and ":/Windows" not in fpath and ftype in slist:
if os.path.getsize(fpath) <= 20971520 and self.api_scan(fpath):
os.remove(fpath)
self.send_notify(self.trans("惡意軟體刪除: ")+fpath)
elif action == 3 and os.path.getsize(fpath) <= 20971520 and ftype in slist:
if ":/Users" in fpath or ":/Windows" not in fpath:
if self.api_scan(fpath) or self.pe_scan(fpath):
os.remove(fpath)
self.send_notify(self.trans("惡意軟體刪除: ")+fpath)
gc.collect()
except:
pass

Expand Down

0 comments on commit 819742d

Please sign in to comment.