From 8209b4ff01cd0a1da1d1e183bcceb1b0487497e3 Mon Sep 17 00:00:00 2001 From: PYDT <85057800+87owo@users.noreply.github.com> Date: Fri, 19 Jan 2024 11:05:39 +0800 Subject: [PATCH] Add files via upload --- PYAS.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PYAS.py b/PYAS.py index 568efb9..d6eac01 100644 --- a/PYAS.py +++ b/PYAS.py @@ -1231,12 +1231,12 @@ class MainWindow_Controller(QMainWindow): while self.file_protect: for action, file in win32file.ReadDirectoryChangesW(hDir,10485760,True,win32con.FILE_NOTIFY_CHANGE_FILE_NAME|win32con.FILE_NOTIFY_CHANGE_DIR_NAME|win32con.FILE_NOTIFY_CHANGE_ATTRIBUTES|win32con.FILE_NOTIFY_CHANGE_SIZE|win32con.FILE_NOTIFY_CHANGE_LAST_WRITE|win32con.FILE_NOTIFY_CHANGE_SECURITY,None,None): try: - full_path = str(f"C:/Users/{file}").replace("\\", "/") - file_type = str(f".{full_path.split('.')[-1]}").lower() - if action == 3 and file_type in slist and os.path.getsize(full_path) <= 20971520: - if self.api_scan(full_path): - os.remove(full_path) - self.send_notify(self.trans("惡意軟體刪除: ")+full_path) + fpath = str(f"C:/Users/{file}").replace("\\", "/") + ftype = str(f".{full_path.split('.')[-1]}").lower() + if action == 3 and ftype in slist and os.path.getsize(fpath) <= 20971520: + if self.api_scan(fpath) or self.pe_scan(fpath): + os.remove(fpath) + self.send_notify(self.trans("惡意軟體刪除: ")+fpath) except: pass