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 Jul 16, 2023
1 parent 026f96d commit a984be2
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions PYAS.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,34 +1190,27 @@ def protect_system_processes(self):
elif ":/Windows" in self.p_file or ":/Program" in self.p_file:
continue
elif self.high_sensitivity == 1 and self.sign_scan(self.p_file):
for p in psutil.process_iter(['name', 'exe']):
if p.info['name'] == self.p_name:
p.kill()
self.system_notification(self.text_Translate("無效簽名攔截: ")+self.p_name)
if self.protect_process_kill(self.p_name):
self.system_notification(self.text_Translate("無效簽名攔截: ")+self.p_name)
elif self.api_scan(self.p_file):
for p in psutil.process_iter(['name', 'exe']):
if p.info['name'] == self.p_name:
p.kill()
self.system_notification(self.text_Translate("惡意軟體攔截: ")+self.p_name)
if self.protect_process_kill(self.p_name):
self.system_notification(self.text_Translate("惡意軟體攔截: ")+self.p_name)
elif self.pe_scan(self.p_file):
for p in psutil.process_iter(['name', 'exe']):
if p.info['name'] == self.p_name:
p.kill()
self.system_notification(self.text_Translate("可疑檔案攔截: ")+self.p_name)
if self.protect_process_kill(self.p_name):
self.system_notification(self.text_Translate("可疑檔案攔截: ")+self.p_name)
else:
self.p_check = self.p_name
gc.collect()
existing_proc = current_proc
except:
pass

def protect_system_track(self,proc):
def protect_process_kill(self,proc):
try:
if self.is_process_running(proc):
for p in psutil.process_iter(['name', 'exe']):
if p.info['name'] == proc:
p.kill()
return True
for p in psutil.process_iter(['name', 'exe']):
if p.info['name'] == proc:
p.kill()
return True
return False
except:
return False
Expand All @@ -1240,7 +1233,7 @@ def protect_system_file(self,path):
os.remove(file)
self.system_notification(self.text_Translate("惡意軟體刪除: ")+file)
elif file_type in alist and self.last_file == file_name:
if self.protect_system_track(self.p_check):
if self.protect_process_kill(self.p_check):
self.system_notification(self.text_Translate("勒索軟體攔截: ")+self.p_check)
self.last_file = file_name
gc.collect()
Expand Down

0 comments on commit a984be2

Please sign in to comment.