Compare commits

..
29 Commits
Author SHA1 Message Date
PYDT b3f126181b Add files via upload 2023-11-02 14:35:57 +08:00
PYDT 6bd110cae7 Add files via upload 2023-11-02 14:30:26 +08:00
PYDT 635f4ccde3 Add files via upload 2023-11-02 10:52:47 +08:00
PYDT 01da2685a5 Add files via upload 2023-11-02 10:51:45 +08:00
PYDT b040aad8d1 Add files via upload 2023-11-02 08:47:53 +08:00
PYDT 84a0f08618 Add files via upload 2023-11-01 19:44:29 +08:00
PYDT 1f64c0d672 Add files via upload 2023-11-01 12:55:25 +08:00
PYDT 5bfff87e21 Add files via upload 2023-11-01 11:19:25 +08:00
PYDT 47db0e1c46 Delete PYAS_Scripts.py 2023-10-31 15:02:10 +08:00
PYDT 9a9fdc418f Delete PYAS_Function_Safe.zip 2023-10-31 15:01:31 +08:00
PYDT c30c89ed40 Add files via upload 2023-10-31 15:01:01 +08:00
PYDT d7bb89968f Add files via upload 2023-10-30 21:05:07 +08:00
PYDT f9b431d158 Add files via upload 2023-10-30 20:56:16 +08:00
PYDT a1364896af Add files via upload 2023-10-30 20:07:24 +08:00
PYDT 2870a999a2 Add files via upload 2023-10-30 20:05:04 +08:00
PYDT 98646a6bd9 Add files via upload 2023-10-29 15:47:10 +08:00
PYDT 8ec894f576 Add files via upload 2023-10-29 13:15:09 +08:00
PYDT 254a67b9a8 Add files via upload 2023-10-29 12:13:14 +08:00
PYDT eebfb79c27 Add files via upload 2023-10-29 11:56:02 +08:00
PYDT 1a1d7ec783 Add files via upload 2023-10-29 08:25:17 +08:00
PYDT 4482144b4d Add files via upload 2023-10-28 18:25:08 +08:00
PYDT 827279c9a8 Add files via upload 2023-10-28 15:32:10 +08:00
PYDT b1d3488842 Add files via upload 2023-10-27 18:57:00 +08:00
PYDT 90112ae1ae Add files via upload 2023-10-27 15:48:25 +08:00
PYDT 1f4b9390b9 Add files via upload 2023-10-27 10:53:02 +08:00
PYDT cc142aca40 Add files via upload 2023-10-27 08:28:38 +08:00
PYDT 89513b2c0d Add files via upload 2023-10-27 00:33:05 +08:00
PYDT bfcd00acec Add files via upload 2023-10-27 00:26:21 +08:00
PYDT 9833b28a50 Add files via upload 2023-10-27 00:03:41 +08:00
5 changed files with 48 additions and 53 deletions

No files matched your search

+46 -50
View File
@@ -3,9 +3,7 @@ import hashlib, pefile, socket, msvcrt
import requests, pyperclip, win32file
import win32gui, win32api, win32con
import xml.etree.ElementTree as xmlet
from PYAS_Scripts import scripts_list
from PYAS_Function import function_list
from PYAS_Function_Safe import function_list_safe
from PYAS_Extension import slist, alist
from PYAS_Language import translate_dict
from PYAS_Interface import Ui_MainWindow
@@ -20,16 +18,17 @@ class MainWindow_Controller(QMainWindow):
self.setAttribute(Qt.WA_TranslucentBackground)
self.setWindowFlags(Qt.FramelessWindowHint)
self.pyas = str(sys.argv[0]).replace("\\", "/")
self.pyas_version = "2.8.9"
self.pyas_version = "2.9.0"
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.init_tray_icon()
self.init_virus_list()
self.init_state_safe()
self.init_config_path()
self.init_config_read()
self.init_config_json()
self.init_config_list()
self.init_config_boot()
self.init_config_json()
self.init_config_qtui()
self.init_change_lang()
self.init_control()
@@ -94,11 +93,18 @@ class MainWindow_Controller(QMainWindow):
except:
self.mbr_value = False
def init_config_json(self):
if not os.path.exists("C:/ProgramData/PYAS/PYAS.json"):
def init_config_read(self):
try:
if not os.path.exists("C:/ProgramData/PYAS/PYAS.json"):
self.write_config({"language":"en_US","high_sensitivity":0,"cloud_services":1})
with open("C:/ProgramData/PYAS/PYAS.json", "r", encoding="utf-8") as f:
self.json = json.load(f)
except:
self.write_config({"language":"en_US","high_sensitivity":0,"cloud_services":1})
with open("C:/ProgramData/PYAS/PYAS.json", "r", encoding="utf-8") as f:
self.json = json.load(f)
with open("C:/ProgramData/PYAS/PYAS.json", "r", encoding="utf-8") as f:
self.json = json.load(f)
def init_config_json(self):
self.high_sensitivity = self.json.get("high_sensitivity", 0)
if self.high_sensitivity == 1:
self.ui.high_sensitivity_switch_Button.setText(self.trans("已開啟"))
@@ -262,7 +268,7 @@ class MainWindow_Controller(QMainWindow):
self.ui.Window_Block_Button.setText(self.trans("軟體彈窗攔截"))
self.ui.Repair_System_Network_Button.setText(self.trans("系統網路修復"))
self.ui.About_Back.setText(self.trans("返回"))
self.ui.PYAS_Version.setText(self.trans(f"PYAS V{self.pyas_version} (ML Engine)"))
self.ui.PYAS_Version.setText(self.trans(f"PYAS V{self.pyas_version}"))
self.ui.GUI_Made_title.setText(self.trans("介面製作:"))
self.ui.GUI_Made_Name.setText(self.trans("mtkiao"))
self.ui.Core_Made_title.setText(self.trans("核心製作:"))
@@ -530,14 +536,15 @@ class MainWindow_Controller(QMainWindow):
def closeEvent(self, event):
if QMessageBox.warning(self,self.trans("警告"),self.trans("您確定要退出 PYAS 和所有防護嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
self.virus_scan_break()
event.accept()
else:
event.ignore()
def bug_event(self, error):
def bug_event(self, text):
try:
print(f"[Error] {error}")
QMessageBox.critical(self,self.trans("錯誤"),error,QMessageBox.Ok)
print(f"[Error] {text}")
QMessageBox.critical(self,self.trans("錯誤"), text, QMessageBox.Ok)
except:
pass
@@ -772,15 +779,11 @@ class MainWindow_Controller(QMainWindow):
self.write_scan(self.trans("惡意"),file)
elif self.pe_scan(file):
self.write_scan(self.trans("可疑"),file)
elif self.scr_scan(file):
self.write_scan(self.trans("可疑"),file)
elif file_type in slist and self.sign_scan(file):
if self.api_scan(file):
self.write_scan(self.trans("惡意"),file)
elif self.pe_scan(file):
self.write_scan(self.trans("可疑"),file)
elif self.scr_scan(file):
self.write_scan(self.trans("可疑"),file)
except:
pass
@@ -788,15 +791,15 @@ class MainWindow_Controller(QMainWindow):
for fd in os.listdir(path):
try:
file = str(os.path.join(path,fd)).replace("\\", "/")
self.ui.Virus_Scan_text.setText(self.trans(f"正在掃描: ")+file)
QApplication.processEvents()
if self.scan_file == False:
return
break
elif ":/Windows" in file:
continue
elif os.path.isdir(file):
self.traverse_path(file)
elif file not in self.whitelist:
self.ui.Virus_Scan_text.setText(self.trans(f"正在掃描: ")+file)
QApplication.processEvents()
self.start_scan(file)
gc.collect()
except:
@@ -821,29 +824,22 @@ class MainWindow_Controller(QMainWindow):
except:
return True
def scr_scan(self, text):
try:
if os.path.isfile(text):
with open(text, "r", encoding="utf-8") as f:
text = f.read()
return any(sn.lower() in str(text).lower() for sn in scripts_list)
except:
return False
def pe_scan(self, file):
try:
fn = set()
fn = []
with pefile.PE(file) as pe:
for entry in pe.DIRECTORY_ENTRY_IMPORT:
for func in entry.imports:
try:
fn.add(str(func.name, "utf-8"))
fn.append(str(func.name, "utf-8"))
except:
pass
max_vfl = max(len(set(fn) & set(vfl)) / len(set(fn) | set(vfl)) for vfl in function_list)
max_sfl = max(len(set(fn) & set(sfl)) / len(set(fn) | set(sfl)) for sfl in function_list_safe)
#print(f'Virus:{int(max_vfl * 100)}%, Safe:{int(max_sfl * 100)}%')
return int(max_vfl * 100) > int(max_sfl * 100)
max_vfl = []
for vfl in function_list:
QApplication.processEvents()
max_vfl.append(len(set(fn)&set(vfl))/len(set(fn)|set(vfl)))
print(f'Virus:{int(max(max_vfl)*100)}%')
return max(max_vfl) > 0.9
except:
return False
@@ -1179,22 +1175,22 @@ 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 ":/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(file) 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)
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 ":/Windows" in file and self.api_scan(cmd[-1]):
p.kill()
self.send_notify(self.trans("惡意軟體攔截: ")+name)
elif ":/Windows" not in file and ":/Program" not in file:
if file != self.pyas and file not in self.whitelist:
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()
except:
BIN
View File
Binary file not shown.
Binary file not shown.
-1
View File
@@ -1 +0,0 @@
scripts_list = ["%0|%0","ExclusionPath","cmdkey","eiculwo"]
+2 -2
View File
@@ -1,10 +1,10 @@
import pyinstaller_versionfile
pyinstaller_versionfile.create_versionfile(
output_file="versionfile.txt",
version='2.8.9',
version='2.9.0',
company_name="PYAS Security",
file_description="Python Antivirus Software",
internal_name="PYAS",
legal_copyright="© PYAS Security",
legal_copyright="PYAS Security",
original_filename="PYAS.exe",
product_name="PYAS")