From f4bd2174455e39ee520e1fc56a0a6a317f784805 Mon Sep 17 00:00:00 2001 From: PYDT <85057800+87owo@users.noreply.github.com> Date: Fri, 13 Oct 2023 18:28:58 +0800 Subject: [PATCH] Add files via upload --- PYAS.py | 27 ++++++++++++++------------- PYAS_Interface.py | 9 +++++---- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/PYAS.py b/PYAS.py index 4f8b060..248a166 100644 --- a/PYAS.py +++ b/PYAS.py @@ -1157,23 +1157,24 @@ class MainWindow_Controller(QMainWindow): existing_processes.add(p.pid) psutil.Process(p.pid).suspend() name, file, cmd = p.name(), p.exe().replace("\\", "/"), p.cmdline() - if "powershell" in name and self.api_scan(cmd[-1].split("'")[-2]): - p.kill() - self.send_notify(self.trans("惡意腳本攔截: ")+name) - elif "cmd.exe" in name and self.api_scan(" ".join(cmd[2:])): - p.kill() - self.send_notify(self.trans("惡意腳本攔截: ")+name) - elif self.scr_scan(cmd) or self.api_scan(cmd[-1]): - p.kill() - self.send_notify(self.trans("惡意軟體攔截: ")+name) + if ":/Windows" in file or ":/Program" in file: + if "powershell" in name and self.api_scan(cmd[-1].split("'")[-2]): + p.kill() + self.send_notify(self.trans("惡意腳本攔截: ")+name) + elif "cmd.exe" in name and self.api_scan(" ".join(cmd[2:])): + p.kill() + self.send_notify(self.trans("惡意腳本攔截: ")+name) + elif self.scr_scan(cmd) or self.api_scan(cmd[-1]): + p.kill() + self.send_notify(self.trans("惡意軟體攔截: ")+name) elif file != self.pyas and file not in self.whitelist: + if self.sign_scan(file): + self.proc = p if self.api_scan(file) or self.pe_scan(file): p.kill() self.send_notify(self.trans("惡意軟體攔截: ")+name) - elif self.sign_scan(file): - self.proc = p - psutil.Process(p.pid).resume() - gc.collect() + psutil.Process(p.pid).resume() + gc.collect() except: pass diff --git a/PYAS_Interface.py b/PYAS_Interface.py index 3d96d2e..2f9920f 100644 --- a/PYAS_Interface.py +++ b/PYAS_Interface.py @@ -1,5 +1,8 @@ from PyQt5 import QtCore, QtGui, QtWidgets -import PYAS_Resource, sys +from PyQt5.QtGui import * +from PyQt5.QtCore import * +from PyQt5.QtWidgets import * +import sys, PYAS_Resource class Ui_MainWindow(object): def setupUi(self, MainWindow): @@ -11,9 +14,7 @@ class Ui_MainWindow(object): font.setStyleStrategy(QtGui.QFont.PreferAntialias) MainWindow.setFont(font) MainWindow.setFocusPolicy(QtCore.Qt.TabFocus) - icon = QtGui.QIcon() - icon.addPixmap(QtGui.QPixmap(":/icon/Icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) - MainWindow.setWindowIcon(icon) + MainWindow.setWindowIcon(QtGui.QIcon(QFileIconProvider().icon(QFileInfo(str(sys.argv[0]))))) MainWindow.setIconSize(QtCore.QSize(64, 64)) MainWindow.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly) MainWindow.setDocumentMode(False)