Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20e037ab9e | ||
|
|
bc27036ba7 | ||
|
|
1cd470b90b | ||
|
|
64471e34bc | ||
|
|
f4c5d3de09 | ||
|
|
0dc59405e3 | ||
|
|
7c775bdc9b | ||
|
|
61400ff4d4 | ||
|
|
e119e34ebe | ||
|
|
6f059747bf | ||
|
|
24d72641fa | ||
|
|
b91fca3aa6 | ||
|
|
a6f1947837 | ||
|
|
6919131cef | ||
|
|
9186d801fc | ||
|
|
76e2f200bd | ||
|
|
1400bbd9ce | ||
|
|
fd37628ac2 | ||
|
|
4396d5afc4 | ||
|
|
f5faf80883 | ||
|
|
ba32da97c8 | ||
|
|
ec2de73d3a | ||
|
|
f4d032e5c7 | ||
|
|
4114aac6c3 | ||
|
|
0c43c6bb5f | ||
|
|
7b3c965b88 | ||
|
|
d1035268f6 | ||
|
|
8968f30bf9 | ||
|
|
84c2c29600 | ||
|
|
b2a59f261c | ||
|
|
363a330f8e | ||
|
|
1d2aa059ee | ||
|
|
f2bfa908a1 | ||
|
|
02a8de4696 | ||
|
|
22fa3eff71 | ||
|
|
69361209c3 | ||
|
|
ff0aeaa4ef | ||
|
|
3c461dfd4b | ||
|
|
c6beda383e | ||
|
|
3d59f3befd | ||
|
|
e54f0db239 | ||
|
|
0f877f2749 | ||
|
|
b69ba165d9 | ||
|
|
965076fe52 | ||
|
|
f4d6cb0430 | ||
|
|
19d412188c | ||
|
|
798d85978a | ||
|
|
819742d753 | ||
|
|
9b32fa6219 | ||
|
|
2c93661726 | ||
|
|
bddaca2a1e | ||
|
|
2f06f2e051 | ||
|
|
1d26e46bd9 | ||
|
|
fa0ff826a3 | ||
|
|
e1b3114c83 | ||
|
|
a655f075db | ||
|
|
13d4ebbf6b | ||
|
|
913d10b1ee | ||
|
|
eb541a0104 | ||
|
|
2063186994 | ||
|
|
860d571039 | ||
|
|
c6d79adf9a | ||
|
|
5453900ba1 | ||
|
|
5029ff1e37 | ||
|
|
47fb691339 | ||
|
|
dff9dd17bf | ||
|
|
5bc4a16b90 | ||
|
|
b1918953b0 | ||
|
|
6e89ed7007 | ||
|
|
744e8bc941 | ||
|
|
0b98ce7ffd | ||
|
|
ca8b293b06 | ||
|
|
e28d99a257 | ||
|
|
488feb6108 | ||
|
|
6cdb106f07 | ||
|
|
a7c5ccd27a | ||
|
|
136f9dbf0a | ||
|
|
16b45c3450 | ||
|
|
68330fad52 | ||
|
|
dca167518d | ||
|
|
bcc44422ef | ||
|
|
e080e03466 | ||
|
|
b6e75490de | ||
|
|
196c014576 | ||
|
|
236110df5e | ||
|
|
b2ae192056 | ||
|
|
f080969a62 | ||
|
|
69d969898d | ||
|
|
a21a766926 | ||
|
|
f11fdb6b96 | ||
|
|
c7445df4c6 | ||
|
|
2c45c9bc5b | ||
|
|
ae5ed27cb6 | ||
|
|
11f9fe3c8b | ||
|
|
e93ad3bd33 | ||
|
|
20c26ea0a8 | ||
|
|
5925a80d3b | ||
|
|
56cb95e523 | ||
|
|
a6e101cc5d | ||
|
|
e8292b6f81 | ||
|
|
37a4392c94 | ||
|
|
a897f75ecf | ||
|
|
79055d3779 | ||
|
|
3d39aa7f97 | ||
|
|
2c1d09affc | ||
|
|
4775358a79 | ||
|
|
cb5f8e8191 | ||
|
|
8209b4ff01 | ||
|
|
e110134d24 | ||
|
|
c2248fdd49 | ||
|
|
58fea5b0ca | ||
|
|
7a36946545 | ||
|
|
563d9a8a36 | ||
|
|
bdbd0617b5 | ||
|
|
67006d88cb | ||
|
|
ded2083462 | ||
|
|
87b7d044f8 | ||
|
|
9781cef29b | ||
|
|
52c393148b | ||
|
|
b98d617d6f | ||
|
|
b475573e0e | ||
|
|
ba3c85d5b2 | ||
|
|
410777efb3 | ||
|
|
0b3fb452b4 | ||
|
|
aaff565172 | ||
|
|
dd0786648e | ||
|
|
e145ffa111 | ||
|
|
b322468c1c | ||
|
|
992d8b909c | ||
|
|
d5327c6370 | ||
|
|
0d13bb5f8f | ||
|
|
3ad08a33a9 | ||
|
|
533e0ed736 | ||
|
|
e7ba77b600 | ||
|
|
f3b84b04f7 | ||
|
|
f4c948aca9 | ||
|
|
1507f5df5a | ||
|
|
0562d11a71 | ||
|
|
b3a9f5cce0 | ||
|
|
5974a3c85a | ||
|
|
78c732d2b8 | ||
|
|
d087b2dc16 | ||
|
|
16c5d014aa | ||
|
|
e661ff400f | ||
|
|
b8c8e2d04d | ||
|
|
8fc36f2b20 | ||
|
|
4b73a09a09 | ||
|
|
65c4d5d5b7 | ||
|
|
19d0702aee | ||
|
|
b74e8330de | ||
|
|
334b837d43 | ||
|
|
169cb37f08 | ||
|
|
8f29c3f0da | ||
|
|
bec5cc4a04 | ||
|
|
af627ee202 | ||
|
|
1e091a3e7c | ||
|
|
8840da91d7 | ||
|
|
1f4ff04ed3 | ||
|
|
60974e8f72 | ||
|
|
86f68994c2 | ||
|
|
21c4918486 | ||
|
|
c6a426ec25 | ||
|
|
db75a22c1c | ||
|
|
7e85d22ecd | ||
|
|
67adadc0a4 | ||
|
|
6b78562454 | ||
|
|
4f13afc867 | ||
|
|
c34e8f193f | ||
|
|
4bcb507eae | ||
|
|
a50d457d75 | ||
|
|
9f119265a9 | ||
|
|
0b121a624b | ||
|
|
0f47f5ec8f | ||
|
|
f89896d041 | ||
|
|
5e335fd5e8 | ||
|
|
fd245dec14 | ||
|
|
774cdc5de3 | ||
|
|
633cfad1a8 | ||
|
|
cb7875c320 | ||
|
|
7960a57fc0 | ||
|
|
a23f693921 | ||
|
|
c49cb8bc4a | ||
|
|
02c425cfc0 | ||
|
|
be96ba0a0e | ||
|
|
df5e00977a | ||
|
|
f055650365 | ||
|
|
b0baddda3b | ||
|
|
69359cba05 | ||
|
|
8b0b29e39b | ||
|
|
21ac50667d | ||
|
|
b843a438ba | ||
|
|
441cc30c0b | ||
|
|
85adf5dc80 | ||
|
|
0c48f0981d | ||
|
|
88b646e41c | ||
|
|
dc4c3e0a99 | ||
|
|
262f6d55a0 | ||
|
|
2d68400670 | ||
|
|
8acaae3f0d | ||
|
|
a5cb26528f | ||
|
|
ac2520a03f | ||
|
|
9c15cc7b33 | ||
|
|
c38f460163 | ||
|
|
9bda8c9e77 | ||
|
|
558be68bad | ||
|
|
6b9d27ce9b | ||
|
|
412745eede | ||
|
|
91ea771af1 | ||
|
|
238ab03db3 | ||
|
|
2d63da193d | ||
|
|
fa4c20a241 | ||
|
|
6294fc33d1 | ||
|
|
c4cf48a94b | ||
|
|
2934c7eb57 | ||
|
|
46ce454105 | ||
|
|
9ab06a0ea9 | ||
|
|
e6f742380a | ||
|
|
2686812470 | ||
|
|
cd11b5b7b2 | ||
|
|
aae35dc640 | ||
|
|
f0b669ff85 | ||
|
|
237605bb9f | ||
|
|
1778046581 | ||
|
|
ff10adfabb | ||
|
|
1cb0f8d7ba | ||
|
|
5813bbdcd1 | ||
|
|
b38e5b177e | ||
|
|
9d66cf248c | ||
|
|
ebcf90d426 | ||
|
|
51904db187 | ||
|
|
4fc8755b8d | ||
|
|
7afcbfaa26 | ||
|
|
55cb96d978 | ||
|
|
a1de099974 | ||
|
|
a0238732fe | ||
|
|
6c100b0679 | ||
|
|
e4d159840f | ||
|
|
0375b3ff02 | ||
|
|
746bae5103 | ||
|
|
70eb2c4500 | ||
|
|
69175f3ae1 | ||
|
|
ed5fab2c54 | ||
|
|
1425ff8e6c | ||
|
|
832ab549a1 | ||
|
|
4ec1661c26 | ||
|
|
ea27712b62 | ||
|
|
6f65efe2d8 | ||
|
|
8edcf60baf | ||
|
|
74f6aec367 | ||
|
|
62c65a766a | ||
|
|
acbcaa337e | ||
|
|
f4dbe57244 | ||
|
|
b494c64a2f | ||
|
|
321e086b95 | ||
|
|
fb60d6b867 | ||
|
|
8ff2e2074a | ||
|
|
1151a1c43f | ||
|
|
13bc6cecc4 | ||
|
|
a4ea572458 | ||
|
|
880df4dee9 | ||
|
|
b75e86dd11 | ||
|
|
75c84092ae | ||
|
|
c69db97da8 | ||
|
|
9c2a8892ae | ||
|
|
f92111563c | ||
|
|
0abb3e78cb | ||
|
|
fb83071419 | ||
|
|
f593c6df8b | ||
|
|
9b452b25c2 | ||
|
|
c835fcf99a | ||
|
|
e4373edc54 | ||
|
|
686c05785f | ||
|
|
994358a793 | ||
|
|
b02ca3757c | ||
|
|
164ec25415 | ||
|
|
8ee85cd9ca | ||
|
|
c07bf05754 | ||
|
|
2e2a08a765 | ||
|
|
10be5f442f | ||
|
|
0fcd8565d8 | ||
|
|
e07eee86dd | ||
|
|
f25d5d73c6 | ||
|
|
28b4d00d3c | ||
|
|
c75cf8a539 | ||
|
|
ff7199b857 | ||
|
|
5613fd81b7 | ||
|
|
c1458502f7 | ||
|
|
b2f620bd3d | ||
|
|
0e1030f186 | ||
|
|
ff4ffb8ec5 | ||
|
|
941458a381 | ||
|
|
560eb924b8 | ||
|
|
c3fab9e48b | ||
|
|
fc4dc74f9e | ||
|
|
35f0362910 | ||
|
|
27dfaa5f06 | ||
|
|
cf1866710a | ||
|
|
b3a5d06c4a | ||
|
|
7c904ff331 | ||
|
|
c7855a9dd1 |
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-2023 87owo (PYAS Security)
|
||||
Copyright (c) 2020-2024 87owo (PYAS Security)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import os, gc, sys, time, json, psutil
|
||||
import hashlib, pefile, socket, msvcrt
|
||||
import xml.etree.ElementTree as xmlet
|
||||
import requests, pyperclip, win32file
|
||||
import win32gui, win32api, win32con
|
||||
import xml.etree.ElementTree as xmlet
|
||||
from PYAS_Rules import pyasrule_dict
|
||||
from PYAS_Function import function_list
|
||||
from PYAS_Engine import ListSimHash
|
||||
from PYAS_Extension import slist, alist
|
||||
from PYAS_Language import translate_dict
|
||||
from PYAS_Interface import Ui_MainWindow
|
||||
@@ -18,22 +17,23 @@ class MainWindow_Controller(QMainWindow):
|
||||
super(MainWindow_Controller, self).__init__()
|
||||
self.setAttribute(Qt.WA_TranslucentBackground)
|
||||
self.setWindowFlags(Qt.FramelessWindowHint)
|
||||
self.pyas = str(sys.argv[0]).replace("\\", "/")
|
||||
self.pyas_version = "2.9.2"
|
||||
self.pyas = sys.argv[0].replace("\\", "/")
|
||||
self.dir = os.path.dirname(self.pyas)
|
||||
self.pyae_version = "SimHash Engine"
|
||||
self.pyas_version = "3.0.6"
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
self.init_show_pyas()
|
||||
self.init_data_base()
|
||||
self.init_read_json()
|
||||
self.init_tray_icon()
|
||||
self.init_virus_list()
|
||||
self.init_state_safe()
|
||||
self.init_config_path()
|
||||
self.init_config_read()
|
||||
self.init_config_boot()
|
||||
self.init_config_json()
|
||||
self.init_config_list()
|
||||
self.init_config_boot()
|
||||
self.init_config_qtui()
|
||||
self.init_change_lang()
|
||||
self.init_theme_color()
|
||||
self.init_control()
|
||||
self.show_pyas_ui()
|
||||
self.init_threads()
|
||||
|
||||
def init_threads(self):
|
||||
@@ -47,44 +47,18 @@ class MainWindow_Controller(QMainWindow):
|
||||
def init_tray_icon(self):
|
||||
self.tray_icon = QSystemTrayIcon(self)
|
||||
self.tray_icon.setIcon(QFileIconProvider().icon(QFileInfo(self.pyas)))
|
||||
self.tray_icon.activated.connect(self.show_pyas_ui)
|
||||
self.tray_icon.activated.connect(self.init_show_pyas)
|
||||
self.tray_icon.show()
|
||||
|
||||
def init_config_path(self):
|
||||
def init_data_base(self):
|
||||
try:
|
||||
if not os.path.exists("C:/ProgramData/PYAS"):
|
||||
os.makedirs("C:/ProgramData/PYAS")
|
||||
file_path = os.path.join(self.dir, "PYAS_Model.json")
|
||||
if os.path.exists(file_path):
|
||||
self.pe = ListSimHash()
|
||||
self.pe.load_model(file_path)
|
||||
except Exception as e:
|
||||
self.bug_event(e)
|
||||
|
||||
def write_config(self, config):
|
||||
try:
|
||||
with open("C:/ProgramData/PYAS/PYAS.json", "w", encoding="utf-8") as f:
|
||||
f.write(json.dumps(config, indent=4, ensure_ascii=False))
|
||||
except:
|
||||
pass
|
||||
|
||||
def init_virus_list(self):
|
||||
try:
|
||||
self.virus_lock = {}
|
||||
self.virus_list = []
|
||||
self.virus_list_ui = []
|
||||
except:
|
||||
pass
|
||||
|
||||
def init_config_list(self):
|
||||
try:
|
||||
self.whitelist = []
|
||||
if os.path.exists("C:/ProgramData/PYAS/Whitelist.ini"):
|
||||
with open("C:/ProgramData/PYAS/Whitelist.ini", "r", encoding="utf-8") as f:
|
||||
self.whitelist = [line.strip() for line in f.readlines()]
|
||||
self.blocklist = []
|
||||
if os.path.exists("C:/ProgramData/PYAS/Blocklist.ini"):
|
||||
with open("C:/ProgramData/PYAS/Blocklist.ini", "r", encoding="utf-8") as f:
|
||||
self.blocklist = [line.strip() for line in f.readlines()]
|
||||
except:
|
||||
pass
|
||||
|
||||
def init_config_boot(self):
|
||||
try:
|
||||
with open(r"\\.\PhysicalDrive0", "r+b") as f:
|
||||
@@ -94,40 +68,77 @@ class MainWindow_Controller(QMainWindow):
|
||||
except:
|
||||
self.mbr_value = False
|
||||
|
||||
def init_config_read(self):
|
||||
def write_config(self, config):
|
||||
try:
|
||||
with open("C:/ProgramData/PYAS/PYAS.json", "w") as f:
|
||||
f.write(json.dumps(config, indent=4, ensure_ascii=False))
|
||||
except Exception as e:
|
||||
self.bug_event(e)
|
||||
|
||||
def init_config_list(self):
|
||||
try:
|
||||
self.whitelist = []
|
||||
if os.path.exists("C:/ProgramData/PYAS/Whitelist.ini"):
|
||||
with open("C:/ProgramData/PYAS/Whitelist.ini", "r") as f:
|
||||
self.whitelist = [line.strip() for line in f.readlines()]
|
||||
self.blocklist = []
|
||||
if os.path.exists("C:/ProgramData/PYAS/Blocklist.ini"):
|
||||
with open("C:/ProgramData/PYAS/Blocklist.ini", "r") as f:
|
||||
self.blocklist = [line.strip() for line in f.readlines()]
|
||||
except:
|
||||
pass
|
||||
|
||||
def init_read_json(self):
|
||||
try:
|
||||
if not os.path.exists("C:/ProgramData/PYAS"):
|
||||
os.makedirs("C:/ProgramData/PYAS")
|
||||
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.write_config({"high_sensitive":0,"cloud_services":1,
|
||||
"language":"en_US","theme_color":"White","theme_custom":""})
|
||||
with open("C:/ProgramData/PYAS/PYAS.json", "r") 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.write_config({"high_sensitive":0,"cloud_services":1,
|
||||
"language":"en_US","theme_color":"White","theme_custom":""})
|
||||
with open("C:/ProgramData/PYAS/PYAS.json", "r") 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.json["high_sensitive"] = self.json.get("high_sensitive", 0)
|
||||
self.json["cloud_services"] = self.json.get("cloud_services", 1)
|
||||
self.json["language"] = self.json.get("language", "en_US")
|
||||
self.json["theme_color"] = self.json.get("theme_color", "White")
|
||||
self.json["theme_custom"] = self.json.get("theme_custom", "")
|
||||
if self.json["high_sensitive"] == 1:
|
||||
self.ui.high_sensitivity_switch_Button.setText(self.trans("已開啟"))
|
||||
self.ui.high_sensitivity_switch_Button.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,200,20,100);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,200,20,120);}""")
|
||||
self.cloud_services = self.json.get("cloud_services", 1)
|
||||
if self.cloud_services == 1:
|
||||
QPushButton{border:none;background-color:rgb(200, 250, 200);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(210, 250, 210);}""")
|
||||
if self.json["cloud_services"] == 1:
|
||||
self.ui.cloud_services_switch_Button.setText(self.trans("已開啟"))
|
||||
self.ui.cloud_services_switch_Button.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,200,20,100);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,200,20,120);}""")
|
||||
self.language = self.json.get("language", "en_US")
|
||||
if self.language == "zh_TW":
|
||||
QPushButton{border:none;background-color:rgb(200, 250, 200);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(210, 250, 210);}""")
|
||||
if self.json["language"] == "zh_TW":
|
||||
self.ui.Language_Traditional_Chinese.setChecked(True)
|
||||
elif self.language == "zh_CN":
|
||||
elif self.json["language"] == "zh_CN":
|
||||
self.ui.Language_Simplified_Chinese.setChecked(True)
|
||||
else:
|
||||
elif self.json["language"] == "en_US":
|
||||
self.ui.Language_English.setChecked(True)
|
||||
if self.json["theme_color"] == "White":
|
||||
self.ui.Theme_White.setChecked(True)
|
||||
elif self.json["theme_color"] == "Red":
|
||||
self.ui.Theme_Red.setChecked(True)
|
||||
elif self.json["theme_color"] == "Green":
|
||||
self.ui.Theme_Green.setChecked(True)
|
||||
elif self.json["theme_color"] == "Yellow":
|
||||
self.ui.Theme_Yellow.setChecked(True)
|
||||
elif self.json["theme_color"] == "Blue":
|
||||
self.ui.Theme_Blue.setChecked(True)
|
||||
elif self.json["theme_color"] == "Custom":
|
||||
self.ui.Theme_Customize.setChecked(True)
|
||||
|
||||
def init_control(self):
|
||||
self.ui.Theme_White.setChecked(True)
|
||||
self.ui.Close_Button.clicked.connect(self.close)
|
||||
self.ui.Minimize_Button.clicked.connect(self.showMinimized)
|
||||
self.ui.Menu_Button.clicked.connect(self.show_menu)
|
||||
@@ -165,7 +176,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.ui.Language_Simplified_Chinese.clicked.connect(self.init_change_lang)
|
||||
self.ui.Language_English.clicked.connect(self.init_change_lang)
|
||||
self.ui.Theme_White.clicked.connect(self.change_theme)
|
||||
self.ui.Theme_Black.clicked.connect(self.change_theme)
|
||||
self.ui.Theme_Customize.clicked.connect(self.change_theme)
|
||||
self.ui.Theme_Green.clicked.connect(self.change_theme)
|
||||
self.ui.Theme_Yellow.clicked.connect(self.change_theme)
|
||||
self.ui.Theme_Blue.clicked.connect(self.change_theme)
|
||||
@@ -229,8 +240,8 @@ class MainWindow_Controller(QMainWindow):
|
||||
return text
|
||||
|
||||
def init_lang_text(self):
|
||||
self.ui.State_title.setText(self.trans("此裝置已受到防護" if self.safe else "此裝置當前不安全"))
|
||||
self.ui.Window_title.setText(self.trans(f"PYAS V{self.pyas_version}"))
|
||||
self.ui.State_title.setText(self.trans("此裝置已受到防護"))
|
||||
self.ui.Window_title.setText(self.trans(f"PYAS Security"))
|
||||
self.ui.PYAS_CopyRight.setText(self.trans(f"Copyright© 2020-{max(int(time.strftime('%Y')), 2020)} PYAS Security"))
|
||||
self.ui.State_Button.setText(self.trans(" 狀態"))
|
||||
self.ui.Virus_Scan_Button.setText(self.trans(" 掃描"))
|
||||
@@ -269,7 +280,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.pyae_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("核心製作:"))
|
||||
@@ -290,8 +301,8 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.ui.Add_White_list_Button.setText(self.trans("選擇"))
|
||||
self.ui.Theme_title.setText(self.trans("顯色主題"))
|
||||
self.ui.Theme_illustrate.setText(self.trans("請選擇主題"))
|
||||
self.ui.Theme_Customize.setText(self.trans("自定主題"))
|
||||
self.ui.Theme_White.setText(self.trans("白色主題"))
|
||||
self.ui.Theme_Black.setText(self.trans("黑色主題"))
|
||||
self.ui.Theme_Yellow.setText(self.trans("黃色主題"))
|
||||
self.ui.Theme_Red.setText(self.trans("紅色主題"))
|
||||
self.ui.Theme_Green.setText(self.trans("綠色主題"))
|
||||
@@ -301,30 +312,70 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.ui.Language_illustrate.setText(self.trans("請選擇語言"))
|
||||
self.ui.License_terms_title.setText(self.trans("許可條款:"))
|
||||
|
||||
def init_theme_color(self):
|
||||
try:
|
||||
if self.json["theme_color"] == "White":
|
||||
self.ui.State_icon.setPixmap(QPixmap(":/icon/Check.png"))
|
||||
self.ui.Window_widget.setStyleSheet("QWidget#Window_widget {background-color:rgb(240,240,240);}")
|
||||
self.ui.Navigation_Bar.setStyleSheet("QWidget#Navigation_Bar {background-color:rgb(230,230,230);}")
|
||||
elif self.json["theme_color"] == "Red":
|
||||
self.ui.State_icon.setPixmap(QPixmap(":/icon/Check.png"))
|
||||
self.ui.Window_widget.setStyleSheet("QWidget#Window_widget {background-color:rgb(250,230,230);}")
|
||||
self.ui.Navigation_Bar.setStyleSheet("QWidget#Navigation_Bar {background-color:rgb(250,220,220);}")
|
||||
elif self.json["theme_color"] == "Yellow":
|
||||
self.ui.State_icon.setPixmap(QPixmap(":/icon/Check.png"))
|
||||
self.ui.Window_widget.setStyleSheet("QWidget#Window_widget {background-color:rgb(250,250,230);}")
|
||||
self.ui.Navigation_Bar.setStyleSheet("QWidget#Navigation_Bar {background-color:rgb(250,250,220);}")
|
||||
elif self.json["theme_color"] == "Green":
|
||||
self.ui.State_icon.setPixmap(QPixmap(":/icon/Check.png"))
|
||||
self.ui.Window_widget.setStyleSheet("QWidget#Window_widget {background-color:rgb(230,250,230);}")
|
||||
self.ui.Navigation_Bar.setStyleSheet("QWidget#Navigation_Bar {background-color:rgb(220,250,220);}")
|
||||
elif self.json["theme_color"] == "Blue":
|
||||
self.ui.State_icon.setPixmap(QPixmap(":/icon/Check.png"))
|
||||
self.ui.Window_widget.setStyleSheet("QWidget#Window_widget {background-color:rgb(230,250,250);}")
|
||||
self.ui.Navigation_Bar.setStyleSheet("QWidget#Navigation_Bar {background-color:rgb(220,250,250);}")
|
||||
elif self.json["theme_color"] == "Custom":
|
||||
with open(os.path.join(self.json["theme_custom"],"Color.ini"), "r") as f:
|
||||
self.themecolor = [line.strip() for line in f.readlines()]
|
||||
self.ui.Window_widget.setStyleSheet(self.themecolor[0])
|
||||
self.ui.Navigation_Bar.setStyleSheet(self.themecolor[1])
|
||||
file = os.path.join(self.json["theme_custom"],"Check.png")
|
||||
self.ui.State_icon.setPixmap(QPixmap(file))
|
||||
except:
|
||||
self.ui.Theme_White.setChecked(True)
|
||||
self.ui.State_icon.setPixmap(QPixmap(":/icon/Check.png"))
|
||||
self.ui.Window_widget.setStyleSheet("QWidget#Window_widget {background-color:rgb(240,240,240);}")
|
||||
self.ui.Navigation_Bar.setStyleSheet("QWidget#Navigation_Bar {background-color:rgb(230,230,230);}")
|
||||
|
||||
def read_custom_theme(self):
|
||||
try:
|
||||
path = str(QFileDialog.getExistingDirectory(self,self.trans("自定主題"),"C:/"))
|
||||
if os.path.exists(os.path.join(path,"Color.ini")):
|
||||
self.json["theme_custom"] = path
|
||||
except:
|
||||
pass
|
||||
|
||||
def change_theme(self):
|
||||
if self.ui.Theme_White.isChecked():
|
||||
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgb(240,240,240);}""")
|
||||
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgb(230,230,230);}""")
|
||||
self.json["theme_color"] = "White"
|
||||
elif self.ui.Theme_Red.isChecked():
|
||||
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgb(255,150,150);}""")
|
||||
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgb(255,140,140);}""")
|
||||
elif self.ui.Theme_Black.isChecked():
|
||||
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgb(150,150,150);}""")
|
||||
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgb(140,140,140);}""")
|
||||
self.json["theme_color"] = "Red"
|
||||
elif self.ui.Theme_Green.isChecked():
|
||||
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgb(150,255,150);}""")
|
||||
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgb(130,255,130);}""")
|
||||
self.json["theme_color"] = "Green"
|
||||
elif self.ui.Theme_Yellow.isChecked():
|
||||
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgb(255,255,150);}""")
|
||||
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgb(240,240,140);}""")
|
||||
self.json["theme_color"] = "Yellow"
|
||||
elif self.ui.Theme_Blue.isChecked():
|
||||
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgb(0,200,255);}""")
|
||||
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgb(0,190,255);}""")
|
||||
self.json["theme_color"] = "Blue"
|
||||
elif self.ui.Theme_Customize.isChecked():
|
||||
self.read_custom_theme()
|
||||
self.json["theme_color"] = "Custom"
|
||||
self.write_config(self.json)
|
||||
self.init_theme_color()
|
||||
|
||||
def change_animation(self,widget):
|
||||
x, y = 170, widget.pos().y()
|
||||
self.anim = QPropertyAnimation(widget, b"geometry")
|
||||
widget.setGeometry(QRect(x - 100,y, 671,481))
|
||||
widget.setGeometry(QRect(x - 100,y, 671, 481))
|
||||
self.anim.setKeyValueAt(0.2, QRect(x - 60,y,671,481))
|
||||
self.anim.setKeyValueAt(0.4, QRect(x - 10,y,671,481))
|
||||
self.anim.setKeyValueAt(0.7, QRect(x - 3,y,671,481))
|
||||
@@ -361,8 +412,8 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.timer.start(2)
|
||||
|
||||
def timeout(self):
|
||||
if self.opacity.i < 1:
|
||||
self.opacity.i += 0.02
|
||||
if self.opacity.i <= 1:
|
||||
self.opacity.i += 0.05
|
||||
self.opacity.setOpacity(self.opacity.i)
|
||||
else:
|
||||
self.timer.stop()
|
||||
@@ -371,8 +422,8 @@ class MainWindow_Controller(QMainWindow):
|
||||
x, y = widget.pos().x(), widget.pos().y()
|
||||
self.anim4 = QPropertyAnimation(widget, b"geometry")
|
||||
self.anim4.setDuration(time)
|
||||
self.anim4.setStartValue(QRect(x, y, 141, ny))
|
||||
self.anim4.setEndValue(QRect(x, y, 141, ny2))
|
||||
self.anim4.setStartValue(QRect(x, y, 131, ny))
|
||||
self.anim4.setEndValue(QRect(x, y, 131, ny2))
|
||||
self.anim4.start()
|
||||
|
||||
def change_animation_5(self,widget,x,y,nx,ny):
|
||||
@@ -506,10 +557,10 @@ class MainWindow_Controller(QMainWindow):
|
||||
rect.setHeight(rect.height()-10)
|
||||
pat2.drawRoundedRect(rect, 1, 1)
|
||||
|
||||
def show_pyas_ui(self):
|
||||
def init_show_pyas(self):
|
||||
def update_opacity():
|
||||
if self.pyas_opacity <= 100:
|
||||
self.pyas_opacity += 1
|
||||
self.pyas_opacity += 2
|
||||
self.setWindowOpacity(self.pyas_opacity/100)
|
||||
else:
|
||||
self.timer.stop()
|
||||
@@ -519,10 +570,10 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.timer.timeout.connect(update_opacity)
|
||||
self.timer.start(2)
|
||||
|
||||
def hide_pyas_ui(self):
|
||||
def init_hide_pyas(self):
|
||||
def update_opacity():
|
||||
if self.pyas_opacity >= 0:
|
||||
self.pyas_opacity -= 1
|
||||
self.pyas_opacity -= 2
|
||||
self.setWindowOpacity(self.pyas_opacity/100)
|
||||
else:
|
||||
self.timer.stop()
|
||||
@@ -532,11 +583,12 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.timer.start(2)
|
||||
|
||||
def showMinimized(self):
|
||||
self.hide_pyas_ui()
|
||||
self.send_notify(self.trans("PYAS 已最小化到系統托盤圖標"))
|
||||
if self.block_window:
|
||||
self.init_hide_pyas()
|
||||
self.send_notify(self.trans("PYAS 已最小化到系統托盤圖標"))
|
||||
|
||||
def closeEvent(self, event):
|
||||
if QMessageBox.warning(self,self.trans("警告"),self.trans("您確定要退出 PYAS 和所有防護嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
if self.question_event("您確定要退出 PYAS 和所有防護嗎?"):
|
||||
self.virus_scan_break()
|
||||
event.accept()
|
||||
else:
|
||||
@@ -544,16 +596,31 @@ class MainWindow_Controller(QMainWindow):
|
||||
|
||||
def bug_event(self, text):
|
||||
try:
|
||||
print(f"[Error] {text}")
|
||||
QMessageBox.critical(self,self.trans("錯誤"), text, QMessageBox.Ok)
|
||||
print(f"[Error] > {text}")
|
||||
QMessageBox.critical(self, "Error", str(text), QMessageBox.Ok)
|
||||
except:
|
||||
pass
|
||||
|
||||
def send_notify(self,text):
|
||||
def info_event(self, text):
|
||||
try:
|
||||
now_time = time.strftime('%Y/%m/%d %H:%M:%S')
|
||||
self.ui.State_output.append(f"[{now_time}] {text}")
|
||||
print(f"[Info] > {text}")
|
||||
QMessageBox.information(self, "Info", self.trans(str(text)), QMessageBox.Ok)
|
||||
except:
|
||||
pass
|
||||
|
||||
def question_event(self, text):
|
||||
try:
|
||||
print(f"[Quest] > {text}")
|
||||
return QMessageBox.question(self, "Quest", self.trans(str(text)),QMessageBox.Yes|QMessageBox.No) == 16384
|
||||
except:
|
||||
return False
|
||||
|
||||
def send_notify(self, text):
|
||||
try:
|
||||
now_time = time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
print(f"[Notify] > [{now_time}] {text}")
|
||||
self.tray_icon.showMessage(now_time, text, 5000)
|
||||
QMetaObject.invokeMethod(self.ui.State_output, "append", Qt.QueuedConnection, Q_ARG(str, f"[{now_time}] {text}"))
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -583,63 +650,48 @@ class MainWindow_Controller(QMainWindow):
|
||||
def change_sensitive(self):
|
||||
sw_state = self.ui.high_sensitivity_switch_Button.text()
|
||||
if sw_state == self.trans("已開啟"):
|
||||
self.high_sensitivity = 0
|
||||
self.json["high_sensitivity"] = 0
|
||||
self.json["high_sensitive"] = 0
|
||||
self.ui.high_sensitivity_switch_Button.setText(self.trans("已關閉"))
|
||||
self.ui.high_sensitivity_switch_Button.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,20,20,30);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,20,20,50);}""")
|
||||
elif QMessageBox.warning(self,self.trans("警告"),self.trans("此選項可能會誤報檔案,您確定要開啟嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
self.high_sensitivity = 1
|
||||
self.json["high_sensitivity"] = 1
|
||||
QPushButton{border:none;background-color:rgb(230,230,230);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(220,220,220);}""")
|
||||
elif self.question_event("此選項可能會誤報檔案,您確定要開啟嗎?"):
|
||||
self.json["high_sensitive"] = 1
|
||||
self.ui.high_sensitivity_switch_Button.setText(self.trans("已開啟"))
|
||||
self.ui.high_sensitivity_switch_Button.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,200,20,100);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,200,20,120);}""")
|
||||
QPushButton{border:none;background-color:rgb(200,250,200);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(210,250,210);}""")
|
||||
self.write_config(self.json)
|
||||
|
||||
def change_cloud_service(self):
|
||||
sw_state = self.ui.cloud_services_switch_Button.text()
|
||||
if sw_state == self.trans("已關閉"):
|
||||
self.cloud_services = 1
|
||||
self.json["cloud_services"] = 1
|
||||
self.ui.cloud_services_switch_Button.setText(self.trans("已開啟"))
|
||||
self.ui.cloud_services_switch_Button.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,200,20,100);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,200,20,120);}""")
|
||||
QPushButton{border:none;background-color:rgb(200,250,200);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(210,250,210);}""")
|
||||
elif sw_state == self.trans("已開啟"):
|
||||
self.cloud_services = 0
|
||||
self.json["cloud_services"] = 0
|
||||
self.ui.cloud_services_switch_Button.setText(self.trans("已關閉"))
|
||||
self.ui.cloud_services_switch_Button.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,20,20,30);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,20,20,50);}""")
|
||||
QPushButton{border:none;background-color:rgb(230,230,230);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(220,220,220);}""")
|
||||
self.write_config(self.json)
|
||||
|
||||
def init_state_safe(self):
|
||||
try:
|
||||
self.safe = True
|
||||
self.ui.State_icon.setPixmap(QPixmap(":/icon/Check.png"))
|
||||
self.ui.State_title.setText(self.trans("此裝置已受到防護"))
|
||||
except:
|
||||
pass
|
||||
|
||||
def init_state_unsafe(self):
|
||||
try:
|
||||
self.safe = False
|
||||
self.ui.State_icon.setPixmap(QPixmap(":/icon/Close.png"))
|
||||
self.ui.State_title.setText(self.trans("此裝置當前不安全"))
|
||||
except:
|
||||
pass
|
||||
|
||||
def init_scan(self):
|
||||
try:
|
||||
self.ui.Virus_Scan_text.setText(self.trans("正在初始化中"))
|
||||
QApplication.processEvents()
|
||||
for file in self.virus_list:
|
||||
self.unlock_file(file)
|
||||
try:
|
||||
for file in self.virus_list:
|
||||
self.lock_file(file, False)
|
||||
except:
|
||||
pass
|
||||
self.scan_file = True
|
||||
self.init_virus_list()
|
||||
self.virus_lock = {}
|
||||
self.virus_list = []
|
||||
self.virus_list_ui = []
|
||||
self.ui.Virus_Scan_Solve_Button.hide()
|
||||
self.ui.Virus_Scan_choose_widget.hide()
|
||||
self.ui.Virus_Scan_choose_Button.hide()
|
||||
@@ -654,23 +706,20 @@ class MainWindow_Controller(QMainWindow):
|
||||
for i in self.ui.Virus_Scan_output.selectedIndexes():
|
||||
item_row = self.virus_list[i.row()]
|
||||
if item_row:
|
||||
pyperclip.copy(item_row)
|
||||
pyperclip.copy(item_row.replace("/", "\\"))
|
||||
menu = QMenu()
|
||||
copyPath = menu.addAction(self.trans("複製路徑"))
|
||||
copyPath.triggered.connect(lambda: copyPathFunc())
|
||||
menu.exec_(self.ui.Virus_Scan_output.mapToGlobal(point))
|
||||
|
||||
def lock_file(self, file):
|
||||
def lock_file(self, file, lock):
|
||||
try:
|
||||
self.virus_lock[file] = os.open(file, os.O_RDWR)
|
||||
msvcrt.locking(self.virus_lock[file], msvcrt.LK_NBLCK, 0)
|
||||
except:
|
||||
pass
|
||||
|
||||
def unlock_file(self, file):
|
||||
try:
|
||||
msvcrt.locking(self.virus_lock[file], msvcrt.LK_UNLCK, 0)
|
||||
os.close(self.virus_lock[file])
|
||||
if lock:
|
||||
self.virus_lock[file] = os.open(file, os.O_RDWR)
|
||||
msvcrt.locking(self.virus_lock[file], msvcrt.LK_NBLCK, 0)
|
||||
else:
|
||||
msvcrt.locking(self.virus_lock[file], msvcrt.LK_UNLCK, 0)
|
||||
os.close(self.virus_lock[file])
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -682,14 +731,15 @@ class MainWindow_Controller(QMainWindow):
|
||||
if self.ui.Virus_Scan_output.findItems(file, Qt.MatchContains)[0].checkState() == Qt.Checked:
|
||||
self.ui.Virus_Scan_text.setText(self.trans("正在刪除: ")+file)
|
||||
QApplication.processEvents()
|
||||
self.unlock_file(file)
|
||||
self.lock_file(file, False)
|
||||
os.remove(file)
|
||||
else:
|
||||
self.unlock_file(file)
|
||||
self.lock_file(file, False)
|
||||
except:
|
||||
continue
|
||||
self.init_state_safe()
|
||||
self.init_virus_list()
|
||||
self.virus_lock = {}
|
||||
self.virus_list = []
|
||||
self.virus_list_ui = []
|
||||
self.ui.Virus_Scan_output.clear()
|
||||
self.ui.Virus_Scan_text.setText(self.trans("成功: 刪除成功"))
|
||||
except Exception as e:
|
||||
@@ -697,7 +747,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
|
||||
def write_scan(self, state, file):
|
||||
try:
|
||||
self.lock_file(file)
|
||||
self.lock_file(file, True)
|
||||
self.virus_list.append(file)
|
||||
self.virus_list_ui.append(f"[{state}] {file}")
|
||||
item = QListWidgetItem()
|
||||
@@ -711,14 +761,12 @@ class MainWindow_Controller(QMainWindow):
|
||||
def answer_scan(self):
|
||||
try:
|
||||
if self.virus_list:
|
||||
self.init_state_unsafe()
|
||||
self.ui.Virus_Scan_Solve_Button.show()
|
||||
self.ui.Virus_Scan_Break_Button.hide()
|
||||
self.ui.Virus_Scan_choose_Button.show()
|
||||
text = self.trans(f"當前發現 {len(self.virus_list)} 個病毒")
|
||||
else:
|
||||
self.virus_scan_break()
|
||||
self.init_state_safe()
|
||||
text = self.trans("當前未發現病毒")
|
||||
self.ui.Virus_Scan_text.setText(text)
|
||||
self.send_notify(text)
|
||||
@@ -775,12 +823,12 @@ class MainWindow_Controller(QMainWindow):
|
||||
def start_scan(self, file):
|
||||
try:
|
||||
file_type = str(f".{file.split('.')[-1]}").lower()
|
||||
if self.high_sensitivity and file != self.pyas:
|
||||
if self.json["high_sensitive"] and file != self.pyas:
|
||||
if self.api_scan(file):
|
||||
self.write_scan(self.trans("惡意"),file)
|
||||
elif self.pe_scan(file):
|
||||
self.write_scan(self.trans("可疑"),file)
|
||||
elif file_type in slist and self.sign_scan(file):
|
||||
elif file_type in slist and file != self.pyas:
|
||||
if self.api_scan(file):
|
||||
self.write_scan(self.trans("惡意"),file)
|
||||
elif self.pe_scan(file):
|
||||
@@ -794,8 +842,6 @@ class MainWindow_Controller(QMainWindow):
|
||||
file = str(os.path.join(path,fd)).replace("\\", "/")
|
||||
if self.scan_file == False:
|
||||
break
|
||||
elif ":/Windows" in file:
|
||||
continue
|
||||
elif os.path.isdir(file):
|
||||
self.traverse_path(file)
|
||||
elif file not in self.whitelist:
|
||||
@@ -808,11 +854,11 @@ class MainWindow_Controller(QMainWindow):
|
||||
|
||||
def api_scan(self, file):
|
||||
try:
|
||||
if self.cloud_services == 1:
|
||||
if self.json["cloud_services"]:
|
||||
with open(file, "rb") as f:
|
||||
text = str(hashlib.md5(f.read()).hexdigest())
|
||||
strBody = f'-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="md5s"\r\n\r\n{text}\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="format"\r\n\r\nXML\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="product"\r\n\r\n360zip\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="combo"\r\n\r\n360zip_main\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="v"\r\n\r\n2\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="osver"\r\n\r\n5.1\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="vk"\r\n\r\na03bc211\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="mid"\r\n\r\n8a40d9eff408a78fe9ec10a0e7e60f62\r\n-------------------------------7d83e2d7a141e--'
|
||||
response = requests.post('http://qup.f.360.cn/file_health_info.php', data=strBody, timeout=3)
|
||||
response = requests.post('http://qup.f.360.cn/file_health_info.php', data=strBody, timeout=5)
|
||||
return response.status_code == 200 and float(xmlet.fromstring(response.text).find('.//e_level').text) > 50
|
||||
return False
|
||||
except:
|
||||
@@ -835,27 +881,35 @@ class MainWindow_Controller(QMainWindow):
|
||||
fn.append(str(func.name, "utf-8"))
|
||||
except:
|
||||
pass
|
||||
max_vfl = []
|
||||
for vfl in function_list:
|
||||
QApplication.processEvents()
|
||||
max_vfl.append(len(set(fn)&set(vfl))/len(set(fn)|set(vfl)))
|
||||
if self.high_sensitivity and max(max_vfl) == 1.0:
|
||||
return True
|
||||
elif "_CorExeMain" not in fn and max(max_vfl) == 1.0:
|
||||
return True
|
||||
out = self.pe.predict_all(fn)
|
||||
v, w = out["Virus"], out["White"]
|
||||
print(v, w, file)
|
||||
if self.json["high_sensitive"]:
|
||||
return v >= w
|
||||
return v > w and v == 1.0
|
||||
except:
|
||||
return False
|
||||
|
||||
def proc_scan(self, p):
|
||||
try:
|
||||
for entry in psutil.Process(p.pid).memory_maps():
|
||||
file = entry.path.replace("\\", "/")
|
||||
if ":/Windows" not in file and ":/Program" not in file:
|
||||
if self.api_scan(file) or self.pe_scan(file):
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
return False
|
||||
|
||||
def repair_system(self):
|
||||
try:
|
||||
if QMessageBox.warning(self,self.trans("警告"),self.trans("您確定要修復系統檔案嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
if self.question_event("您確定要修復系統檔案嗎?"):
|
||||
self.repair_system_wallpaper()
|
||||
self.repair_system_restrict()
|
||||
self.repair_system_file_type()
|
||||
self.repair_system_file_icon()
|
||||
self.repair_system_image()
|
||||
QMessageBox.information(self,self.trans("成功"),self.trans("修復系統檔案成功"),QMessageBox.Ok)
|
||||
self.info_event("修復系統檔案成功")
|
||||
except Exception as e:
|
||||
self.bug_event(e)
|
||||
|
||||
@@ -948,6 +1002,8 @@ class MainWindow_Controller(QMainWindow):
|
||||
for i in Permission:
|
||||
try:
|
||||
win32api.RegDeleteValue(key,i)
|
||||
file = self.proc.exe().replace("\\", "/")
|
||||
self.kill_process(self.proc, "惡意行為攔截", file)
|
||||
except:
|
||||
pass
|
||||
win32api.RegCloseKey(key)
|
||||
@@ -965,12 +1021,12 @@ class MainWindow_Controller(QMainWindow):
|
||||
|
||||
def clean_system(self):
|
||||
try:
|
||||
if QMessageBox.warning(self,self.trans("警告"),self.trans("您確定要清理系統垃圾嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
if self.question_event("您確定要清理系統垃圾嗎?"):
|
||||
self.total_deleted_size = 0
|
||||
self.traverse_temp(f"C:/Users/{os.getlogin()}/AppData/Local/Temp/")
|
||||
self.traverse_temp(f"C:/Windows/Temp/")
|
||||
self.traverse_temp(f"C:/$Recycle.Bin/")
|
||||
QMessageBox.information(self,self.trans("成功"),self.trans(f"成功清理了 {self.total_deleted_size} 位元的系統垃圾"),QMessageBox.Ok)
|
||||
self.info_event(f"成功清理了 {self.total_deleted_size} 位元的系統垃圾")
|
||||
except Exception as e:
|
||||
self.bug_event(e)
|
||||
|
||||
@@ -992,44 +1048,44 @@ class MainWindow_Controller(QMainWindow):
|
||||
try:
|
||||
file = str(QFileDialog.getOpenFileName(self,self.trans("增加到白名單"),"C:/")[0]).replace("\\", "/")
|
||||
if file and file not in self.whitelist:
|
||||
if QMessageBox.warning(self,self.trans("警告"),self.trans("您確定要增加到白名單嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
if self.question_event("您確定要增加到白名單嗎?"):
|
||||
self.whitelist.append(file)
|
||||
with open("C:/ProgramData/PYAS/Whitelist.ini", "a+", encoding="utf-8") as f:
|
||||
with open("C:/ProgramData/PYAS/Whitelist.ini", "a+") as f:
|
||||
f.write(f"{file}\n")
|
||||
QMessageBox.information(self,self.trans("成功"),self.trans(f"成功增加到白名單: ")+file,QMessageBox.Ok)
|
||||
elif file and QMessageBox.warning(self,self.trans("警告"),self.trans("您確定要取消增加到白名單嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
self.info_event(f"成功增加到白名單: "+file)
|
||||
elif file and self.question_event("您確定要取消增加到白名單嗎?"):
|
||||
self.whitelist.remove(file)
|
||||
with open("C:/ProgramData/PYAS/Whitelist.ini", "w", encoding="utf-8") as f:
|
||||
with open("C:/ProgramData/PYAS/Whitelist.ini", "w") as f:
|
||||
for white_file in self.whitelist:
|
||||
f.write(f'{white_file}\n')
|
||||
QMessageBox.information(self,self.trans("成功"),self.trans(f"成功取消增加到白名單: ")+file,QMessageBox.Ok)
|
||||
self.info_event(f"成功取消增加到白名單: "+file)
|
||||
except Exception as e:
|
||||
self.bug_event(e)
|
||||
|
||||
def get_software_window(self):
|
||||
try:
|
||||
self.block_window = False
|
||||
if QMessageBox.warning(self,self.trans("警告"),self.trans("請選擇要攔截的軟體彈窗"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
if self.question_event("請選擇要攔截的軟體彈窗"):
|
||||
while not self.block_window:
|
||||
window_name = str(win32gui.GetWindowText(win32gui.GetForegroundWindow()))
|
||||
QApplication.processEvents()
|
||||
if window_name not in ["","PYAS",self.trans("警告")]:
|
||||
if window_name not in self.blocklist:
|
||||
if QMessageBox.warning(self,self.trans("警告"),self.trans(f"您確定要攔截 {window_name} 嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
if self.question_event(f"您確定要攔截 {window_name} 嗎?"):
|
||||
self.blocklist.append(window_name)
|
||||
with open("C:/ProgramData/PYAS/Blocklist.ini", "a+", encoding="utf-8") as f:
|
||||
with open("C:/ProgramData/PYAS/Blocklist.ini", "a+") as f:
|
||||
f.write(f'{window_name}\n')
|
||||
QMessageBox.information(self,self.trans("成功"),self.trans(f"成功增加到彈窗攔截: ")+window_name,QMessageBox.Ok)
|
||||
elif QMessageBox.warning(self,self.trans("警告"),self.trans(f"您確定要取消攔截 {window_name} 嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
self.info_event(f"成功增加到彈窗攔截: "+window_name)
|
||||
elif self.question_event(f"您確定要取消攔截 {window_name} 嗎?"):
|
||||
self.blocklist.remove(window_name)
|
||||
with open("C:/ProgramData/PYAS/Blocklist.ini", "w", encoding="utf-8") as f:
|
||||
with open("C:/ProgramData/PYAS/Blocklist.ini", "w") as f:
|
||||
for block_name in self.blocklist:
|
||||
f.write(f'{block_name}\n')
|
||||
QMessageBox.information(self,self.trans("成功"),self.trans(f"成功取消彈窗攔截: ")+window_name,QMessageBox.Ok)
|
||||
self.info_event(f"成功取消彈窗攔截: "+window_name)
|
||||
self.block_window = True
|
||||
self.block_window_init()
|
||||
except Exception as e:
|
||||
self.bug_event(e)
|
||||
self.bug_event(e)
|
||||
|
||||
def block_window_init(self):
|
||||
self.block_window = True
|
||||
@@ -1038,7 +1094,7 @@ class MainWindow_Controller(QMainWindow):
|
||||
def block_software_window(self):
|
||||
while self.block_window:
|
||||
try:
|
||||
time.sleep(0.5)
|
||||
time.sleep(0.2)
|
||||
for window_name in self.blocklist:
|
||||
win32gui.PostMessage(win32gui.FindWindow(None, window_name), 274, 61536, 0)
|
||||
except:
|
||||
@@ -1046,9 +1102,9 @@ class MainWindow_Controller(QMainWindow):
|
||||
|
||||
def repair_network(self):
|
||||
try:
|
||||
if QMessageBox.warning(self,self.trans("警告"),self.trans("您確定要修復系統網路嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
if self.question_event("您確定要修復系統網路嗎?"):
|
||||
os.system("netsh winsock reset")
|
||||
if QMessageBox.warning(self,self.trans("警告"),self.trans("使用此選項需要重啟,您確定要重啟嗎?"),QMessageBox.Yes|QMessageBox.No) == 16384:
|
||||
if self.question_event("使用此選項需要重啟,您確定要重啟嗎?"):
|
||||
os.system("shutdown -r -t 0")
|
||||
except Exception as e:
|
||||
self.bug_event(e)
|
||||
@@ -1087,7 +1143,11 @@ class MainWindow_Controller(QMainWindow):
|
||||
if self.Process_popMenu.exec_(self.ui.Process_list.mapToGlobal(pos)) == self.kill_Process:
|
||||
for p in psutil.process_iter():
|
||||
if p.pid == self.pid:
|
||||
p.kill()
|
||||
file = p.exe().replace("\\", "/")
|
||||
if file == self.pyas:
|
||||
self.close()
|
||||
else:
|
||||
p.kill()
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -1096,14 +1156,14 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.proc_protect = False
|
||||
self.ui.Protection_switch_Button.setText(self.trans("已關閉"))
|
||||
self.ui.Protection_switch_Button.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,20,20,30);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,20,20,50);}""")
|
||||
QPushButton{border:none;background-color:rgb(230, 230, 230);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(220, 220, 220);}""")
|
||||
else:
|
||||
self.proc_protect = True
|
||||
self.ui.Protection_switch_Button.setText(self.trans("已開啟"))
|
||||
self.ui.Protection_switch_Button.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,200,20,100);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,200,20,120);}""")
|
||||
QPushButton{border:none;background-color:rgb(200, 250, 200);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(210, 250, 210);}""")
|
||||
Thread(target=self.protect_proc_thread, daemon=True).start()
|
||||
|
||||
def protect_file_init(self):
|
||||
@@ -1111,14 +1171,14 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.file_protect = False
|
||||
self.ui.Protection_switch_Button_2.setText(self.trans("已關閉"))
|
||||
self.ui.Protection_switch_Button_2.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,20,20,30);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,20,20,50);}""")
|
||||
QPushButton{border:none;background-color:rgb(230, 230, 230);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(220, 220, 220);}""")
|
||||
else:
|
||||
self.file_protect = True
|
||||
self.ui.Protection_switch_Button_2.setText(self.trans("已開啟"))
|
||||
self.ui.Protection_switch_Button_2.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,200,20,100);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,200,20,120);}""")
|
||||
QPushButton{border:none;background-color:rgb(200, 250, 200);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(210, 250, 210);}""")
|
||||
Thread(target=self.protect_file_thread, daemon=True).start()
|
||||
|
||||
def protect_boot_init(self):
|
||||
@@ -1126,14 +1186,14 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.mbr_protect = False
|
||||
self.ui.Protection_switch_Button_3.setText(self.trans("已關閉"))
|
||||
self.ui.Protection_switch_Button_3.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,20,20,30);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,20,20,50);}""")
|
||||
QPushButton{border:none;background-color:rgb(230, 230, 230);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(220, 220, 220);}""")
|
||||
else:
|
||||
self.mbr_protect = True
|
||||
self.ui.Protection_switch_Button_3.setText(self.trans("已開啟"))
|
||||
self.ui.Protection_switch_Button_3.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,200,20,100);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,200,20,120);}""")
|
||||
QPushButton{border:none;background-color:rgb(200, 250, 200);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(210, 250, 210);}""")
|
||||
Thread(target=self.protect_boot_thread, daemon=True).start()
|
||||
|
||||
def protect_reg_init(self):
|
||||
@@ -1141,14 +1201,14 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.reg_protect = False
|
||||
self.ui.Protection_switch_Button_4.setText(self.trans("已關閉"))
|
||||
self.ui.Protection_switch_Button_4.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,20,20,30);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,20,20,50);}""")
|
||||
QPushButton{border:none;background-color:rgb(230, 230, 230);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(220, 220, 220);}""")
|
||||
else:
|
||||
self.reg_protect = True
|
||||
self.ui.Protection_switch_Button_4.setText(self.trans("已開啟"))
|
||||
self.ui.Protection_switch_Button_4.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,200,20,100);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,200,20,120);}""")
|
||||
QPushButton{border:none;background-color:rgb(200, 250, 200);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(210, 250, 210);}""")
|
||||
Thread(target=self.protect_reg_thread, daemon=True).start()
|
||||
|
||||
def protect_net_init(self):
|
||||
@@ -1156,90 +1216,104 @@ class MainWindow_Controller(QMainWindow):
|
||||
self.net_protect = False
|
||||
self.ui.Protection_switch_Button_5.setText(self.trans("已關閉"))
|
||||
self.ui.Protection_switch_Button_5.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,20,20,30);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,20,20,50);}""")
|
||||
QPushButton{border:none;background-color:rgb(230, 230, 230);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(220, 220, 220);}""")
|
||||
else:
|
||||
self.net_protect = True
|
||||
self.ui.Protection_switch_Button_5.setText(self.trans("已開啟"))
|
||||
self.ui.Protection_switch_Button_5.setStyleSheet("""
|
||||
QPushButton{border:none;background-color:rgba(20,200,20,100);border-radius: 15px;}
|
||||
QPushButton:hover{background-color:rgba(20,200,20,120);}""")
|
||||
QPushButton{border:none;background-color:rgb(200, 250, 200);border-radius: 10px;}
|
||||
QPushButton:hover{background-color:rgb(210, 250, 210);}""")
|
||||
Thread(target=self.protect_net_thread, daemon=True).start()
|
||||
|
||||
def protect_proc_thread(self):
|
||||
existing_processes = set()
|
||||
for p in psutil.process_iter():
|
||||
if p.pid not in existing_processes:
|
||||
existing_processes.add(p.pid)
|
||||
existing_processes.add(p.pid)
|
||||
psutil.Process(os.getpid()).nice(256)
|
||||
while self.proc_protect:
|
||||
time.sleep(0.05)
|
||||
time.sleep(0.01)
|
||||
for p in psutil.process_iter():
|
||||
try:
|
||||
if p.pid not in existing_processes:
|
||||
existing_processes.add(p.pid)
|
||||
psutil.Process(p.pid).suspend()
|
||||
if psutil.pid_exists(p.pid) and p.pid not in existing_processes:
|
||||
name, file, cmd = p.name(), p.exe().replace("\\", "/"), p.cmdline()
|
||||
if self.protect_proc_scan(name, file, cmd):
|
||||
p.kill()
|
||||
self.send_notify(self.trans("惡意軟體攔截: ")+file)
|
||||
elif ":/Windows" not in file and self.sign_scan(file):
|
||||
self.proc = p
|
||||
psutil.Process(p.pid).resume()
|
||||
gc.collect()
|
||||
if file != self.pyas and file not in self.whitelist:
|
||||
self.lock_process(p, True)
|
||||
if "powershell" in name and self.api_scan(cmd[-1].split("'")[-2]):
|
||||
file = cmd[-1].split("'")[-2].replace("\\", "/")
|
||||
self.kill_process(p, "惡意腳本攔截", file)
|
||||
elif "cmd.exe" in name and self.api_scan(" ".join(cmd[2:])):
|
||||
file = " ".join(cmd[2:]).replace("\\", "/")
|
||||
self.kill_process(p, "惡意腳本攔截", file)
|
||||
elif ":/Windows" in file and self.api_scan(cmd[-1]):
|
||||
file = cmd[-1].replace("\\", "/")
|
||||
self.kill_process(p, "惡意軟體攔截", file)
|
||||
elif ":/Windows" not in file and self.proc_scan(p):
|
||||
self.kill_process(p, "惡意軟體攔截", file)
|
||||
elif ":/Windows" not in file and self.sign_scan(file):
|
||||
self.proc = p
|
||||
self.lock_process(p, False)
|
||||
existing_processes.add(p.pid)
|
||||
except:
|
||||
pass
|
||||
self.lock_process(p, False)
|
||||
|
||||
def protect_proc_scan(self, name, file, cmd):
|
||||
def lock_process(self, p, lock):
|
||||
try:
|
||||
if file != self.pyas and file not in self.whitelist:
|
||||
if "powershell" in name:
|
||||
file = str(cmd[-1].split("'")[-2])
|
||||
elif "cmd.exe" in name:
|
||||
file = str(" ".join(cmd[2:]))
|
||||
elif ":/Windows" in file:
|
||||
file = str(cmd[-1])
|
||||
elif ":/Program" in file:
|
||||
file = str(cmd[-1])
|
||||
return self.api_scan(file) or self.pe_scan(file)
|
||||
if lock:
|
||||
psutil.Process(p.pid).suspend()
|
||||
else:
|
||||
psutil.Process(p.pid).resume()
|
||||
except:
|
||||
return False
|
||||
|
||||
def kill_process(self, parent, info, file):
|
||||
try:
|
||||
parent.kill()
|
||||
self.send_notify(self.trans(f"{info}: ")+file)
|
||||
for child in parent.children(recursive=True):
|
||||
child.kill()
|
||||
except:
|
||||
pass
|
||||
|
||||
def protect_file_thread(self):
|
||||
hDir = win32file.CreateFile("C:/Users/",win32con.GENERIC_READ,win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE|win32con.FILE_SHARE_DELETE,None,win32con.OPEN_EXISTING,win32con.FILE_FLAG_BACKUP_SEMANTICS,None)
|
||||
self.ransom_block = False
|
||||
hDir = win32file.CreateFile("C:/",win32con.GENERIC_READ,win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE|win32con.FILE_SHARE_DELETE,None,win32con.OPEN_EXISTING,win32con.FILE_FLAG_BACKUP_SEMANTICS,None)
|
||||
while self.file_protect:
|
||||
for action, file in win32file.ReadDirectoryChangesW(hDir,1024,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):
|
||||
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:
|
||||
if action == 2 and str(f".{file.split('.')[-1]}").lower() in alist:
|
||||
if self.ransom_block and "AppData" not in file:
|
||||
self.proc.kill()
|
||||
self.ransom_block = False
|
||||
self.send_notify(self.trans("勒索軟體攔截: ")+self.proc.name())
|
||||
self.ransom_block = True
|
||||
fpath = str(f"C:/{file}").replace("\\", "/")
|
||||
ftype = str(f".{fpath.split('.')[-1]}").lower()
|
||||
if action == 2 and ":/Users" in fpath and ftype in alist:
|
||||
file = self.proc.exe().replace("\\", "/")
|
||||
if "/AppData/" not in file and ":/Program" not in file:
|
||||
self.kill_process(self.proc, "勒索行為攔截", file)
|
||||
elif action == 3 and ":/Users" in fpath and "/AppData/" not in fpath:
|
||||
if os.path.getsize(fpath) <= 52428800 and ftype in slist:
|
||||
if self.api_scan(fpath) or self.pe_scan(fpath):
|
||||
os.remove(fpath)
|
||||
self.send_notify(self.trans("惡意軟體刪除: ")+fpath)
|
||||
except:
|
||||
pass
|
||||
|
||||
def protect_boot_thread(self):
|
||||
while self.mbr_protect and self.mbr_value:
|
||||
try:
|
||||
time.sleep(0.5)
|
||||
time.sleep(0.2)
|
||||
with open(r"\\.\PhysicalDrive0", "r+b") as f:
|
||||
if self.mbr_value[510:512] != b'\x55\xAA':
|
||||
self.proc.kill()
|
||||
self.send_notify(self.trans("惡意行為攔截: ")+self.proc.name())
|
||||
file = self.proc.exe().replace("\\", "/")
|
||||
self.kill_process(self.proc, "惡意行為攔截", file)
|
||||
elif f.read(512) != self.mbr_value:
|
||||
f.seek(0)
|
||||
f.write(self.mbr_value)
|
||||
self.proc.kill()
|
||||
self.send_notify(self.trans("惡意行為攔截: ")+self.proc.name())
|
||||
file = self.proc.exe().replace("\\", "/")
|
||||
self.kill_process(self.proc, "惡意行為攔截", file)
|
||||
except:
|
||||
pass
|
||||
|
||||
def protect_reg_thread(self):
|
||||
while self.reg_protect:
|
||||
try:
|
||||
time.sleep(0.5)
|
||||
time.sleep(0.2)
|
||||
self.repair_system_image()
|
||||
self.repair_system_restrict()
|
||||
self.repair_system_file_type()
|
||||
@@ -1250,11 +1324,13 @@ class MainWindow_Controller(QMainWindow):
|
||||
def protect_net_thread(self):
|
||||
while self.net_protect:
|
||||
try:
|
||||
time.sleep(0.5)
|
||||
time.sleep(0.2)
|
||||
local = socket.gethostbyname(socket.gethostname())
|
||||
for conn in self.proc.connections():
|
||||
if socket.gethostbyname(socket.gethostname()) == conn.laddr.ip:
|
||||
self.proc.kill()
|
||||
self.send_notify(self.trans("網路通訊攔截: ")+self.proc.name())
|
||||
file = self.proc.exe().replace("\\", "/")
|
||||
if "/AppData/" not in file and ":/Program" not in file:
|
||||
if conn.laddr.ip == local:
|
||||
self.kill_process(self.proc, "網路通訊攔截", file)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
import time, json, hashlib, numpy
|
||||
from collections import Counter
|
||||
|
||||
class ListSimHash:
|
||||
def __init__(self):
|
||||
self.model = {}
|
||||
|
||||
def save_model(self, file_name):
|
||||
with open(file_name, 'w') as f:
|
||||
json.dump(self.model, f)
|
||||
print(f"\nModel Is Saved In {file_name}")
|
||||
|
||||
def load_model(self, model_data):
|
||||
if isinstance(model_data, str):
|
||||
with open(model_data, 'r') as f:
|
||||
model_data = json.load(f)
|
||||
self.model = model_data
|
||||
|
||||
def get_model(self, label):
|
||||
return self.model[label]
|
||||
|
||||
def train_model(self, label, data):
|
||||
start = time.time()
|
||||
print(f"Convert {label}")
|
||||
if label not in self.model:
|
||||
self.model[label] = []
|
||||
for i, x in enumerate(data, 1):
|
||||
self.model[label].append(self.build_text(x))
|
||||
used = "{0:.2f}".format(time.time()-start)
|
||||
prefix, suffix = f'{i}/{len(data)}:', f'{used}s'
|
||||
self.progress_bar(i, len(data), prefix, suffix)
|
||||
|
||||
def build_text(self, content):
|
||||
sums, batch, count = [], [], 0
|
||||
features = dict(Counter(sorted(content)))
|
||||
for f, w in features.items():
|
||||
count += w
|
||||
batch.append(hashlib.md5(json.dumps(f).encode('utf-8')).digest() * w)
|
||||
if len(batch) >= 10000:
|
||||
sums.append(self.sum_hashes(batch))
|
||||
batch = []
|
||||
if batch:
|
||||
sums.append(self.sum_hashes(batch))
|
||||
combined_sums = numpy.sum(sums, 0)
|
||||
v = numpy.packbits(combined_sums > count / 2).tobytes()
|
||||
return int.from_bytes(v, 'big')
|
||||
|
||||
def sum_hashes(self, digests):
|
||||
bitarray = numpy.unpackbits(numpy.frombuffer(b''.join(digests), dtype='>B'))
|
||||
return numpy.sum(numpy.reshape(bitarray, (-1, 128)), 0)
|
||||
|
||||
def progress_bar(self, iteration, total, prefix='', suffix='', length=50, fill='█'):
|
||||
percent = min(100.0, max(0.0, 100 * (iteration / float(total))))
|
||||
end_char = '\n' if percent >= 100 else '\r'
|
||||
percent_string = "{0:.2f}".format(percent)
|
||||
filled_length = int(length * iteration // total)
|
||||
bar = fill * filled_length + ' ' * (length - filled_length)
|
||||
print(f'\r {prefix: <10} |{bar}| {percent_string}% {suffix}', end=end_char)
|
||||
|
||||
def predict_all(self, query):
|
||||
label_similarities = {}
|
||||
query_hash = self.build_text(query)
|
||||
for label in self.model:
|
||||
max_similarity = 0
|
||||
for data_point in self.model[label]:
|
||||
similarity = self.similar(data_point, query_hash)
|
||||
if similarity > max_similarity:
|
||||
max_similarity = similarity
|
||||
label_similarities[label] = max_similarity
|
||||
return label_similarities
|
||||
|
||||
def predict(self, query):
|
||||
max_similarity, max_label = 0, None
|
||||
query_hash = self.build_text(query)
|
||||
for label in self.model:
|
||||
for data_point in self.model[label]:
|
||||
similarity = self.similar(data_point, query_hash)
|
||||
if similarity > max_similarity:
|
||||
max_similarity, max_label = similarity, label
|
||||
return max_label, max_similarity
|
||||
|
||||
def similar(self, x, y):
|
||||
hamming_distance = bin(x ^ y).count('1')
|
||||
return 1 - hamming_distance / 128
|
||||
+2
-4
@@ -1,10 +1,8 @@
|
||||
slist = [".exe",".dll",".com",".msi",".scr",
|
||||
".bat",".cmd",".ps1",".vbs",".jar",
|
||||
".js",".elf",".doc",".xls",".xlsx"]
|
||||
".js",".bat",".cmd",".ps1",".vbs"]
|
||||
|
||||
alist = [".ppt",".pptx",".wps",".txt",".rtf",
|
||||
".pdf",".xls",".xlsx",".doc",".docx",
|
||||
".jpg",".jpeg",".png",".webp",".gif",
|
||||
".mp3",".wav",".aac",".ogg",".flac",
|
||||
".mp4",".avi",".mov",".wmv",".mkv",
|
||||
".zip",".7z",".rar",".tar",".gz"]
|
||||
".mp4",".avi",".mov",".wmv",".mkv"]
|
||||
Binary file not shown.
+221
-237
@@ -29,6 +29,7 @@ class Ui_MainWindow(object):
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.widget = QtWidgets.QWidget(self.centralwidget)
|
||||
self.widget.setGeometry(QtCore.QRect(0, 0, 851, 541))
|
||||
self.widget.setStyleSheet("")
|
||||
self.widget.setObjectName("widget")
|
||||
self.Protection_widget = QtWidgets.QWidget(self.widget)
|
||||
self.Protection_widget.setGeometry(QtCore.QRect(170, 50, 671, 481))
|
||||
@@ -37,7 +38,7 @@ class Ui_MainWindow(object):
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Protection_widget.setFont(font)
|
||||
self.Protection_widget.setStyleSheet("background-color:rgba(255, 255, 255,240);")
|
||||
self.Protection_widget.setStyleSheet("background-color: rgb(255, 255, 255);")
|
||||
self.Protection_widget.setObjectName("Protection_widget")
|
||||
self.Real_time_Protection_widget = QtWidgets.QWidget(self.Protection_widget)
|
||||
self.Real_time_Protection_widget.setGeometry(QtCore.QRect(40, 10, 591, 91))
|
||||
@@ -87,13 +88,14 @@ class Ui_MainWindow(object):
|
||||
self.Protection_switch_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
"}")
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Protection_switch_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Protection_switch_Button.setCheckable(False)
|
||||
self.Protection_switch_Button.setObjectName("Protection_switch_Button")
|
||||
@@ -145,13 +147,14 @@ class Ui_MainWindow(object):
|
||||
self.Protection_switch_Button_2.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
"}")
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Protection_switch_Button_2.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Protection_switch_Button_2.setCheckable(False)
|
||||
self.Protection_switch_Button_2.setObjectName("Protection_switch_Button_2")
|
||||
@@ -201,13 +204,14 @@ class Ui_MainWindow(object):
|
||||
self.Protection_switch_Button_3.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
"}")
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Protection_switch_Button_3.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Protection_switch_Button_3.setCheckable(False)
|
||||
self.Protection_switch_Button_3.setObjectName("Protection_switch_Button_3")
|
||||
@@ -257,13 +261,14 @@ class Ui_MainWindow(object):
|
||||
self.Protection_switch_Button_4.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
"}")
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Protection_switch_Button_4.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Protection_switch_Button_4.setCheckable(False)
|
||||
self.Protection_switch_Button_4.setObjectName("Protection_switch_Button_4")
|
||||
@@ -313,13 +318,14 @@ class Ui_MainWindow(object):
|
||||
self.Protection_switch_Button_5.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
"}")
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Protection_switch_Button_5.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Protection_switch_Button_5.setCheckable(False)
|
||||
self.Protection_switch_Button_5.setObjectName("Protection_switch_Button_5")
|
||||
@@ -330,14 +336,7 @@ class Ui_MainWindow(object):
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Navigation_Bar.setFont(font)
|
||||
self.Navigation_Bar.setStyleSheet("QWidget#Navigation_Bar\n"
|
||||
"{\n"
|
||||
" background-color:rgb(230, 230, 230);\n"
|
||||
" border-top-right-radius:2px;\n"
|
||||
" border-bottom-right-radius:2px;\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"")
|
||||
self.Navigation_Bar.setStyleSheet("background-color: rgb(230, 230, 230);")
|
||||
self.Navigation_Bar.setObjectName("Navigation_Bar")
|
||||
self.verticalLayoutWidget = QtWidgets.QWidget(self.Navigation_Bar)
|
||||
self.verticalLayoutWidget.setGeometry(QtCore.QRect(0, 0, 161, 481))
|
||||
@@ -365,8 +364,8 @@ class Ui_MainWindow(object):
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(0,0,0,0);\n"
|
||||
" border-top-left-radius:15px;\n"
|
||||
" border-bottom-left-radius:15px;\n"
|
||||
" border-top-left-radius:10px;\n"
|
||||
" border-bottom-left-radius:10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
@@ -376,7 +375,8 @@ class Ui_MainWindow(object):
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(255, 255, 255,110);\n"
|
||||
"}")
|
||||
"}\n"
|
||||
"")
|
||||
icon1 = QtGui.QIcon()
|
||||
icon1.addPixmap(QtGui.QPixmap(":/icon/State.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.State_Button.setIcon(icon1)
|
||||
@@ -403,8 +403,8 @@ class Ui_MainWindow(object):
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(0,0,0,0);\n"
|
||||
" border-top-left-radius:15px;\n"
|
||||
" border-bottom-left-radius:15px;\n"
|
||||
" border-top-left-radius:10px;\n"
|
||||
" border-bottom-left-radius:10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
@@ -414,7 +414,8 @@ class Ui_MainWindow(object):
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(255, 255, 255,110);\n"
|
||||
"}")
|
||||
"}\n"
|
||||
"")
|
||||
icon2 = QtGui.QIcon()
|
||||
icon2.addPixmap(QtGui.QPixmap(":/icon/Scan.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.Virus_Scan_Button.setIcon(icon2)
|
||||
@@ -444,8 +445,8 @@ class Ui_MainWindow(object):
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(0,0,0,0);\n"
|
||||
" border-top-left-radius:15px;\n"
|
||||
" border-bottom-left-radius:15px;\n"
|
||||
" border-top-left-radius:10px;\n"
|
||||
" border-bottom-left-radius:10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
@@ -455,7 +456,8 @@ class Ui_MainWindow(object):
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(255, 255, 255,110);\n"
|
||||
"}")
|
||||
"}\n"
|
||||
"")
|
||||
icon3 = QtGui.QIcon()
|
||||
icon3.addPixmap(QtGui.QPixmap(":/icon/Tool.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.Tools_Button.setIcon(icon3)
|
||||
@@ -482,8 +484,8 @@ class Ui_MainWindow(object):
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(0,0,0,0);\n"
|
||||
" border-top-left-radius:15px;\n"
|
||||
" border-bottom-left-radius:15px;\n"
|
||||
" border-top-left-radius:10px;\n"
|
||||
" border-bottom-left-radius:10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
@@ -493,7 +495,8 @@ class Ui_MainWindow(object):
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(255, 255, 255,110);\n"
|
||||
"}")
|
||||
"}\n"
|
||||
"")
|
||||
icon4 = QtGui.QIcon()
|
||||
icon4.addPixmap(QtGui.QPixmap(":/icon/Protect.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.Protection_Button.setIcon(icon4)
|
||||
@@ -526,7 +529,7 @@ class Ui_MainWindow(object):
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Virus_Scan_widget.setFont(font)
|
||||
self.Virus_Scan_widget.setStyleSheet("background-color:rgba(255, 255, 255,240);")
|
||||
self.Virus_Scan_widget.setStyleSheet("background-color: rgb(255, 255, 255);")
|
||||
self.Virus_Scan_widget.setObjectName("Virus_Scan_widget")
|
||||
self.Virus_Scan_title = QtWidgets.QLabel(self.Virus_Scan_widget)
|
||||
self.Virus_Scan_title.setGeometry(QtCore.QRect(45, 30, 281, 41))
|
||||
@@ -550,7 +553,7 @@ class Ui_MainWindow(object):
|
||||
self.Virus_Scan_text.setWordWrap(True)
|
||||
self.Virus_Scan_text.setObjectName("Virus_Scan_text")
|
||||
self.Virus_Scan_choose_Button = QtWidgets.QPushButton(self.Virus_Scan_widget)
|
||||
self.Virus_Scan_choose_Button.setGeometry(QtCore.QRect(480, 35, 141, 31))
|
||||
self.Virus_Scan_choose_Button.setGeometry(QtCore.QRect(490, 35, 131, 31))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
@@ -565,16 +568,8 @@ class Ui_MainWindow(object):
|
||||
self.Virus_Scan_choose_Button.setTabletTracking(False)
|
||||
self.Virus_Scan_choose_Button.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.Virus_Scan_choose_Button.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.Virus_Scan_choose_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(100,200,100,200);\n"
|
||||
" border-radius: 3px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(100,220,100,200);\n"
|
||||
"}")
|
||||
self.Virus_Scan_choose_Button.setStyleSheet("QPushButton{border:none;background-color:rgb(190,250,190);border-radius: 10px;}QPushButton:hover{background-color:rgb(200,250,200);}\n"
|
||||
"")
|
||||
self.Virus_Scan_choose_Button.setIconSize(QtCore.QSize(10, 10))
|
||||
self.Virus_Scan_choose_Button.setCheckable(False)
|
||||
self.Virus_Scan_choose_Button.setAutoRepeat(False)
|
||||
@@ -585,16 +580,19 @@ class Ui_MainWindow(object):
|
||||
self.Virus_Scan_choose_Button.setFlat(False)
|
||||
self.Virus_Scan_choose_Button.setObjectName("Virus_Scan_choose_Button")
|
||||
self.Virus_Scan_choose_widget = QtWidgets.QWidget(self.Virus_Scan_widget)
|
||||
self.Virus_Scan_choose_widget.setGeometry(QtCore.QRect(480, 67, 141, 31))
|
||||
self.Virus_Scan_choose_widget.setGeometry(QtCore.QRect(490, 67, 131, 31))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.Virus_Scan_choose_widget.sizePolicy().hasHeightForWidth())
|
||||
self.Virus_Scan_choose_widget.setSizePolicy(sizePolicy)
|
||||
self.Virus_Scan_choose_widget.setStyleSheet("background-color:rgba(200, 200, 200,200);")
|
||||
self.Virus_Scan_choose_widget.setStyleSheet("QWidget {\n"
|
||||
" background-color: rgb(230, 230, 230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
" }")
|
||||
self.Virus_Scan_choose_widget.setObjectName("Virus_Scan_choose_widget")
|
||||
self.verticalLayoutWidget_3 = QtWidgets.QWidget(self.Virus_Scan_choose_widget)
|
||||
self.verticalLayoutWidget_3.setGeometry(QtCore.QRect(0, 0, 141, 101))
|
||||
self.verticalLayoutWidget_3.setGeometry(QtCore.QRect(0, 0, 131, 101))
|
||||
self.verticalLayoutWidget_3.setObjectName("verticalLayoutWidget_3")
|
||||
self.Virus_Scan_choose_verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget_3)
|
||||
self.Virus_Scan_choose_verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
|
||||
@@ -616,17 +614,18 @@ class Ui_MainWindow(object):
|
||||
self.File_Scan_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(0,0,0,0);\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 5px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(50, 50, 50,50);\n"
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(50, 50, 50,90);\n"
|
||||
"}")
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.File_Scan_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.File_Scan_Button.setCheckable(False)
|
||||
self.File_Scan_Button.setObjectName("File_Scan_Button")
|
||||
@@ -646,17 +645,18 @@ class Ui_MainWindow(object):
|
||||
self.Path_Scan_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(0,0,0,0);\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 5px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(50, 50, 50,50);\n"
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(50, 50, 50,90);\n"
|
||||
"}")
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Path_Scan_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Path_Scan_Button.setCheckable(False)
|
||||
self.Path_Scan_Button.setObjectName("Path_Scan_Button")
|
||||
@@ -676,23 +676,24 @@ class Ui_MainWindow(object):
|
||||
self.Disk_Scan_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(0,0,0,0);\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 5px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(50, 50, 50,50);\n"
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(50, 50, 50,90);\n"
|
||||
"}")
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Disk_Scan_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Disk_Scan_Button.setCheckable(False)
|
||||
self.Disk_Scan_Button.setObjectName("Disk_Scan_Button")
|
||||
self.Virus_Scan_choose_verticalLayout.addWidget(self.Disk_Scan_Button)
|
||||
self.Virus_Scan_Solve_Button = QtWidgets.QPushButton(self.Virus_Scan_widget)
|
||||
self.Virus_Scan_Solve_Button.setGeometry(QtCore.QRect(330, 35, 141, 31))
|
||||
self.Virus_Scan_Solve_Button.setGeometry(QtCore.QRect(350, 35, 131, 31))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
@@ -707,16 +708,8 @@ class Ui_MainWindow(object):
|
||||
self.Virus_Scan_Solve_Button.setTabletTracking(False)
|
||||
self.Virus_Scan_Solve_Button.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.Virus_Scan_Solve_Button.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.Virus_Scan_Solve_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(230,70,70,200);\n"
|
||||
" border-radius: 3px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(255,70,70,200);\n"
|
||||
"}")
|
||||
self.Virus_Scan_Solve_Button.setStyleSheet("QPushButton{border:none;background-color:rgb(250,190,190);border-radius: 10px;}QPushButton:hover{background-color:rgb(250,200,200);}\n"
|
||||
"")
|
||||
self.Virus_Scan_Solve_Button.setIconSize(QtCore.QSize(10, 10))
|
||||
self.Virus_Scan_Solve_Button.setCheckable(False)
|
||||
self.Virus_Scan_Solve_Button.setAutoRepeat(False)
|
||||
@@ -727,7 +720,7 @@ class Ui_MainWindow(object):
|
||||
self.Virus_Scan_Solve_Button.setFlat(False)
|
||||
self.Virus_Scan_Solve_Button.setObjectName("Virus_Scan_Solve_Button")
|
||||
self.Virus_Scan_Break_Button = QtWidgets.QPushButton(self.Virus_Scan_widget)
|
||||
self.Virus_Scan_Break_Button.setGeometry(QtCore.QRect(480, 35, 141, 31))
|
||||
self.Virus_Scan_Break_Button.setGeometry(QtCore.QRect(490, 35, 131, 31))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
@@ -742,16 +735,8 @@ class Ui_MainWindow(object):
|
||||
self.Virus_Scan_Break_Button.setTabletTracking(False)
|
||||
self.Virus_Scan_Break_Button.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.Virus_Scan_Break_Button.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.Virus_Scan_Break_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(230,70,70,200);\n"
|
||||
" border-radius: 3px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(255,70,70,200);\n"
|
||||
"}")
|
||||
self.Virus_Scan_Break_Button.setStyleSheet("QPushButton{border:none;background-color:rgb(250,190,190);border-radius: 10px;}QPushButton:hover{background-color:rgb(250,200,200);}\n"
|
||||
"")
|
||||
self.Virus_Scan_Break_Button.setIconSize(QtCore.QSize(10, 10))
|
||||
self.Virus_Scan_Break_Button.setCheckable(False)
|
||||
self.Virus_Scan_Break_Button.setAutoRepeat(False)
|
||||
@@ -800,6 +785,13 @@ class Ui_MainWindow(object):
|
||||
self.Virus_Scan_output.setUniformItemSizes(False)
|
||||
self.Virus_Scan_output.setSelectionRectVisible(False)
|
||||
self.Virus_Scan_output.setObjectName("Virus_Scan_output")
|
||||
self.Virus_Scan_title.raise_()
|
||||
self.Virus_Scan_text.raise_()
|
||||
self.Virus_Scan_choose_widget.raise_()
|
||||
self.Virus_Scan_Solve_Button.raise_()
|
||||
self.Virus_Scan_output.raise_()
|
||||
self.Virus_Scan_Break_Button.raise_()
|
||||
self.Virus_Scan_choose_Button.raise_()
|
||||
self.State_widget = QtWidgets.QWidget(self.widget)
|
||||
self.State_widget.setGeometry(QtCore.QRect(170, 49, 671, 481))
|
||||
font = QtGui.QFont()
|
||||
@@ -807,7 +799,7 @@ class Ui_MainWindow(object):
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.State_widget.setFont(font)
|
||||
self.State_widget.setStyleSheet("background-color:rgb(255, 255, 255);")
|
||||
self.State_widget.setStyleSheet("background-color: rgb(255, 255, 255);")
|
||||
self.State_widget.setObjectName("State_widget")
|
||||
self.State_title = QtWidgets.QLabel(self.State_widget)
|
||||
self.State_title.setGeometry(QtCore.QRect(50, 210, 571, 41))
|
||||
@@ -823,14 +815,24 @@ class Ui_MainWindow(object):
|
||||
self.State_title.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.State_title.setObjectName("State_title")
|
||||
self.State_icon = QtWidgets.QLabel(self.State_widget)
|
||||
self.State_icon.setGeometry(QtCore.QRect(250, 30, 171, 171))
|
||||
self.State_icon.setGeometry(QtCore.QRect(240, 20, 191, 191))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.State_icon.sizePolicy().hasHeightForWidth())
|
||||
self.State_icon.setSizePolicy(sizePolicy)
|
||||
self.State_icon.setMinimumSize(QtCore.QSize(0, 171))
|
||||
self.State_icon.setMaximumSize(QtCore.QSize(16777215, 16777215))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(1)
|
||||
font.setStrikeOut(False)
|
||||
font.setKerning(True)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.State_icon.setFont(font)
|
||||
self.State_icon.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
|
||||
self.State_icon.setToolTip("")
|
||||
self.State_icon.setStyleSheet("")
|
||||
self.State_icon.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.State_icon.setLineWidth(1)
|
||||
self.State_icon.setText("")
|
||||
@@ -853,6 +855,8 @@ class Ui_MainWindow(object):
|
||||
self.State_output.setFont(font)
|
||||
self.State_output.setAutoFillBackground(False)
|
||||
self.State_output.setStyleSheet("")
|
||||
self.State_output.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||
self.State_output.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
self.State_output.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustIgnored)
|
||||
self.State_output.setUndoRedoEnabled(True)
|
||||
self.State_output.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse)
|
||||
@@ -876,7 +880,7 @@ class Ui_MainWindow(object):
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.About_widget.setFont(font)
|
||||
self.About_widget.setStyleSheet("background-color:rgba(255, 255, 255,255);")
|
||||
self.About_widget.setStyleSheet("background-color: rgb(255, 255, 255);")
|
||||
self.About_widget.setObjectName("About_widget")
|
||||
self.About_Back = QtWidgets.QPushButton(self.About_widget)
|
||||
self.About_Back.setGeometry(QtCore.QRect(20, 10, 101, 41))
|
||||
@@ -891,17 +895,7 @@ class Ui_MainWindow(object):
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.About_Back.setFont(font)
|
||||
self.About_Back.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.About_Back.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(0,0,0,0);\n"
|
||||
" color:rgba(60,60,60,200);\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" color:rgba(60,60,60,255);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.About_Back.setStyleSheet("QPushButton{border:none; background-color:rgba(0,0,0,0); color:rgba(60,60,60,200);} QPushButton:hover{ color:rgba(60,60,60,255);}")
|
||||
icon5 = QtGui.QIcon()
|
||||
icon5.addPixmap(QtGui.QPixmap(":/icon/Back.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
self.About_Back.setIcon(icon5)
|
||||
@@ -1026,7 +1020,13 @@ class Ui_MainWindow(object):
|
||||
font.setPointSize(11)
|
||||
self.License_terms.setFont(font)
|
||||
self.License_terms.setStyleSheet("")
|
||||
self.License_terms.setFrameShape(QtWidgets.QFrame.StyledPanel)
|
||||
self.License_terms.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
|
||||
self.License_terms.setSizeAdjustPolicy(QtWidgets.QAbstractScrollArea.AdjustIgnored)
|
||||
self.License_terms.setTabChangesFocus(False)
|
||||
self.License_terms.setLineWrapColumnOrWidth(0)
|
||||
self.License_terms.setReadOnly(True)
|
||||
self.License_terms.setOverwriteMode(False)
|
||||
self.License_terms.setObjectName("License_terms")
|
||||
self.License_terms_title = QtWidgets.QLabel(self.About_widget)
|
||||
self.License_terms_title.setGeometry(QtCore.QRect(45, 260, 581, 31))
|
||||
@@ -1046,10 +1046,7 @@ class Ui_MainWindow(object):
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Window_widget.setFont(font)
|
||||
self.Window_widget.setStyleSheet("QWidget#Window_widget\n"
|
||||
"{\n"
|
||||
"background-color:rgb(240, 240, 240);\n"
|
||||
"}")
|
||||
self.Window_widget.setStyleSheet("background-color: rgb(240, 240, 240);")
|
||||
self.Window_widget.setObjectName("Window_widget")
|
||||
self.Close_Button = QtWidgets.QPushButton(self.Window_widget)
|
||||
self.Close_Button.setGeometry(QtCore.QRect(790, 5, 31, 31))
|
||||
@@ -1172,7 +1169,7 @@ class Ui_MainWindow(object):
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Process_widget.setFont(font)
|
||||
self.Process_widget.setStyleSheet("background-color:rgba(255, 255, 255,240);")
|
||||
self.Process_widget.setStyleSheet("background-color: rgb(255, 255, 255);")
|
||||
self.Process_widget.setObjectName("Process_widget")
|
||||
self.Process_Tools_Back = QtWidgets.QPushButton(self.Process_widget)
|
||||
self.Process_Tools_Back.setGeometry(QtCore.QRect(20, 10, 101, 41))
|
||||
@@ -1187,17 +1184,7 @@ class Ui_MainWindow(object):
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Process_Tools_Back.setFont(font)
|
||||
self.Process_Tools_Back.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.Process_Tools_Back.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(0,0,0,0);\n"
|
||||
" color:rgba(60,60,60,200);\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" color:rgba(60,60,60,255);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Process_Tools_Back.setStyleSheet("QPushButton{border:none; background-color:rgba(0,0,0,0); color:rgba(60,60,60,200);} QPushButton:hover{ color:rgba(60,60,60,255);}")
|
||||
self.Process_Tools_Back.setIcon(icon5)
|
||||
self.Process_Tools_Back.setIconSize(QtCore.QSize(20, 20))
|
||||
self.Process_Tools_Back.setCheckable(False)
|
||||
@@ -1265,7 +1252,7 @@ class Ui_MainWindow(object):
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Tools_widget.setFont(font)
|
||||
self.Tools_widget.setStyleSheet("background-color:rgba(255, 255, 255,240);")
|
||||
self.Tools_widget.setStyleSheet("background-color: rgb(255, 255, 255);")
|
||||
self.Tools_widget.setObjectName("Tools_widget")
|
||||
self.More_Tools_Back_Button = QtWidgets.QPushButton(self.Tools_widget)
|
||||
self.More_Tools_Back_Button.setGeometry(QtCore.QRect(20, 10, 101, 41))
|
||||
@@ -1280,13 +1267,7 @@ class Ui_MainWindow(object):
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.More_Tools_Back_Button.setFont(font)
|
||||
self.More_Tools_Back_Button.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.More_Tools_Back_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(0,0,0,0);\n"
|
||||
" color:rgba(60,60,60,200);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.More_Tools_Back_Button.setStyleSheet("QPushButton{border:none; background-color:rgba(0,0,0,0); color:rgba(60,60,60,200);} QPushButton:hover{ color:rgba(60,60,60,255);}")
|
||||
self.More_Tools_Back_Button.setIconSize(QtCore.QSize(20, 20))
|
||||
self.More_Tools_Back_Button.setCheckable(False)
|
||||
self.More_Tools_Back_Button.setObjectName("More_Tools_Back_Button")
|
||||
@@ -1312,17 +1293,18 @@ class Ui_MainWindow(object):
|
||||
self.System_Process_Manage_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,70);\n"
|
||||
"}")
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.System_Process_Manage_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.System_Process_Manage_Button.setCheckable(False)
|
||||
self.System_Process_Manage_Button.setObjectName("System_Process_Manage_Button")
|
||||
@@ -1342,17 +1324,18 @@ class Ui_MainWindow(object):
|
||||
self.Clean_System_Files_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,70);\n"
|
||||
"}")
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Clean_System_Files_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Clean_System_Files_Button.setCheckable(False)
|
||||
self.Clean_System_Files_Button.setObjectName("Clean_System_Files_Button")
|
||||
@@ -1372,17 +1355,18 @@ class Ui_MainWindow(object):
|
||||
self.Repair_System_Files_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,70);\n"
|
||||
"}")
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Repair_System_Files_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Repair_System_Files_Button.setCheckable(False)
|
||||
self.Repair_System_Files_Button.setObjectName("Repair_System_Files_Button")
|
||||
@@ -1402,17 +1386,18 @@ class Ui_MainWindow(object):
|
||||
self.Repair_System_Network_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,70);\n"
|
||||
"}")
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Repair_System_Network_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Repair_System_Network_Button.setCheckable(False)
|
||||
self.Repair_System_Network_Button.setObjectName("Repair_System_Network_Button")
|
||||
@@ -1432,25 +1417,22 @@ class Ui_MainWindow(object):
|
||||
self.Window_Block_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"QPushButton:pressed\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,70);\n"
|
||||
"}")
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Window_Block_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Window_Block_Button.setCheckable(False)
|
||||
self.Window_Block_Button.setObjectName("Window_Block_Button")
|
||||
self.System_verticalLayout.addWidget(self.Window_Block_Button)
|
||||
self.widget_2 = QtWidgets.QWidget(self.widget)
|
||||
self.widget_2.setGeometry(QtCore.QRect(170, 50, 671, 481))
|
||||
self.widget_2.setStyleSheet("background-color:rgb(255, 255, 255);")
|
||||
self.widget_2.setObjectName("widget_2")
|
||||
self.Setting_widget = QtWidgets.QWidget(self.widget)
|
||||
self.Setting_widget.setGeometry(QtCore.QRect(10, 50, 831, 481))
|
||||
font = QtGui.QFont()
|
||||
@@ -1458,7 +1440,7 @@ class Ui_MainWindow(object):
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Setting_widget.setFont(font)
|
||||
self.Setting_widget.setStyleSheet("background-color:rgba(255, 255, 255,255);")
|
||||
self.Setting_widget.setStyleSheet("background-color: rgb(255, 255, 255);")
|
||||
self.Setting_widget.setObjectName("Setting_widget")
|
||||
self.Show_high_sensitivity = QtWidgets.QWidget(self.Setting_widget)
|
||||
self.Show_high_sensitivity.setGeometry(QtCore.QRect(30, 50, 781, 81))
|
||||
@@ -1505,13 +1487,14 @@ class Ui_MainWindow(object):
|
||||
self.high_sensitivity_switch_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
"}")
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.high_sensitivity_switch_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.high_sensitivity_switch_Button.setCheckable(False)
|
||||
self.high_sensitivity_switch_Button.setObjectName("high_sensitivity_switch_Button")
|
||||
@@ -1559,6 +1542,14 @@ class Ui_MainWindow(object):
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
|
||||
self.gridLayout.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.Language_English = QtWidgets.QRadioButton(self.gridLayoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Language_English.setFont(font)
|
||||
self.Language_English.setObjectName("Language_English")
|
||||
self.gridLayout.addWidget(self.Language_English, 1, 2, 1, 1)
|
||||
self.Language_Traditional_Chinese = QtWidgets.QRadioButton(self.gridLayoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
@@ -1575,14 +1566,6 @@ class Ui_MainWindow(object):
|
||||
self.Language_Simplified_Chinese.setFont(font)
|
||||
self.Language_Simplified_Chinese.setObjectName("Language_Simplified_Chinese")
|
||||
self.gridLayout.addWidget(self.Language_Simplified_Chinese, 1, 1, 1, 1)
|
||||
self.Language_English = QtWidgets.QRadioButton(self.gridLayoutWidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Language_English.setFont(font)
|
||||
self.Language_English.setObjectName("Language_English")
|
||||
self.gridLayout.addWidget(self.Language_English, 1, 2, 1, 1)
|
||||
self.Language_illustrate.raise_()
|
||||
self.Language_Choose_widget.raise_()
|
||||
self.Language_title.raise_()
|
||||
@@ -1631,13 +1614,14 @@ class Ui_MainWindow(object):
|
||||
self.cloud_services_switch_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
"}")
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.cloud_services_switch_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.cloud_services_switch_Button.setCheckable(False)
|
||||
self.cloud_services_switch_Button.setObjectName("cloud_services_switch_Button")
|
||||
@@ -1657,17 +1641,7 @@ class Ui_MainWindow(object):
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Setting_Back.setFont(font)
|
||||
self.Setting_Back.setFocusPolicy(QtCore.Qt.StrongFocus)
|
||||
self.Setting_Back.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(0,0,0,0);\n"
|
||||
" color:rgba(60,60,60,200);\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" color:rgba(60,60,60,255);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Setting_Back.setStyleSheet("QPushButton{border:none; background-color:rgba(0,0,0,0); color:rgba(60,60,60,200);} QPushButton:hover{ color:rgba(60,60,60,255);}")
|
||||
self.Setting_Back.setIcon(icon5)
|
||||
self.Setting_Back.setIconSize(QtCore.QSize(20, 20))
|
||||
self.Setting_Back.setCheckable(False)
|
||||
@@ -1717,13 +1691,14 @@ class Ui_MainWindow(object):
|
||||
self.Add_White_list_Button.setStyleSheet("QPushButton\n"
|
||||
"{\n"
|
||||
" border:none;\n"
|
||||
" background-color:rgba(20,20,20,30);\n"
|
||||
" border-radius: 15px;\n"
|
||||
" background-color:rgb(230,230,230);\n"
|
||||
" border-radius: 10px;\n"
|
||||
"}\n"
|
||||
"QPushButton:hover\n"
|
||||
"{\n"
|
||||
" background-color:rgba(20,20,20,50);\n"
|
||||
"}")
|
||||
" background-color:rgb(220,220,220);\n"
|
||||
"}\n"
|
||||
"")
|
||||
self.Add_White_list_Button.setIconSize(QtCore.QSize(16, 16))
|
||||
self.Add_White_list_Button.setCheckable(False)
|
||||
self.Add_White_list_Button.setObjectName("Add_White_list_Button")
|
||||
@@ -1769,22 +1744,6 @@ class Ui_MainWindow(object):
|
||||
self.gridLayout_2 = QtWidgets.QGridLayout(self.gridLayoutWidget_2)
|
||||
self.gridLayout_2.setContentsMargins(0, 0, 0, 0)
|
||||
self.gridLayout_2.setObjectName("gridLayout_2")
|
||||
self.Theme_Black = QtWidgets.QRadioButton(self.gridLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Theme_Black.setFont(font)
|
||||
self.Theme_Black.setObjectName("Theme_Black")
|
||||
self.gridLayout_2.addWidget(self.Theme_Black, 1, 1, 1, 1)
|
||||
self.Theme_White = QtWidgets.QRadioButton(self.gridLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Theme_White.setFont(font)
|
||||
self.Theme_White.setObjectName("Theme_White")
|
||||
self.gridLayout_2.addWidget(self.Theme_White, 1, 0, 1, 1)
|
||||
self.Theme_Yellow = QtWidgets.QRadioButton(self.gridLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
@@ -1793,13 +1752,37 @@ class Ui_MainWindow(object):
|
||||
self.Theme_Yellow.setFont(font)
|
||||
self.Theme_Yellow.setObjectName("Theme_Yellow")
|
||||
self.gridLayout_2.addWidget(self.Theme_Yellow, 1, 2, 1, 1)
|
||||
self.Theme_Green = QtWidgets.QRadioButton(self.gridLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
self.Theme_Green.setFont(font)
|
||||
self.Theme_Green.setObjectName("Theme_Green")
|
||||
self.gridLayout_2.addWidget(self.Theme_Green, 2, 0, 1, 1)
|
||||
self.Theme_Blue = QtWidgets.QRadioButton(self.gridLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Theme_Blue.setFont(font)
|
||||
self.Theme_Blue.setObjectName("Theme_Blue")
|
||||
self.gridLayout_2.addWidget(self.Theme_Blue, 2, 0, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.Theme_Blue, 2, 1, 1, 1)
|
||||
self.Theme_Customize = QtWidgets.QRadioButton(self.gridLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Theme_Customize.setFont(font)
|
||||
self.Theme_Customize.setObjectName("Theme_Customize")
|
||||
self.gridLayout_2.addWidget(self.Theme_Customize, 2, 2, 1, 1)
|
||||
self.Theme_White = QtWidgets.QRadioButton(self.gridLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Theme_White.setFont(font)
|
||||
self.Theme_White.setObjectName("Theme_White")
|
||||
self.gridLayout_2.addWidget(self.Theme_White, 1, 0, 1, 1)
|
||||
self.Theme_Red = QtWidgets.QRadioButton(self.gridLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
@@ -1807,27 +1790,23 @@ class Ui_MainWindow(object):
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Theme_Red.setFont(font)
|
||||
self.Theme_Red.setObjectName("Theme_Red")
|
||||
self.gridLayout_2.addWidget(self.Theme_Red, 2, 1, 1, 1)
|
||||
self.Theme_Green = QtWidgets.QRadioButton(self.gridLayoutWidget_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
font.setStyleStrategy(QtGui.QFont.PreferAntialias)
|
||||
self.Theme_Green.setFont(font)
|
||||
self.Theme_Green.setObjectName("Theme_Green")
|
||||
self.gridLayout_2.addWidget(self.Theme_Green, 2, 2, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.Theme_Red, 1, 1, 1, 1)
|
||||
self.Theme_illustrate.raise_()
|
||||
self.Language_Choose_widget_2.raise_()
|
||||
self.Theme_title.raise_()
|
||||
self.Protection_widget.raise_()
|
||||
self.Setting_widget.raise_()
|
||||
self.About_widget.raise_()
|
||||
self.Tools_widget.raise_()
|
||||
self.widget_2 = QtWidgets.QWidget(self.widget)
|
||||
self.widget_2.setGeometry(QtCore.QRect(170, 50, 671, 481))
|
||||
self.widget_2.setStyleSheet("background-color: rgb(255, 255, 255);")
|
||||
self.widget_2.setObjectName("widget_2")
|
||||
self.widget_2.raise_()
|
||||
self.Setting_widget.raise_()
|
||||
self.Tools_widget.raise_()
|
||||
self.Process_widget.raise_()
|
||||
self.Virus_Scan_widget.raise_()
|
||||
self.About_widget.raise_()
|
||||
self.Protection_widget.raise_()
|
||||
self.Window_widget.raise_()
|
||||
self.Navigation_Bar.raise_()
|
||||
self.Virus_Scan_widget.raise_()
|
||||
self.State_widget.raise_()
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
|
||||
@@ -1873,16 +1852,21 @@ class Ui_MainWindow(object):
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
|
||||
self.State_log.setText(_translate("MainWindow", "日誌:"))
|
||||
self.About_Back.setText(_translate("MainWindow", "返回"))
|
||||
self.PYAS_Version.setText(_translate("MainWindow", "PYAS v2.3.5"))
|
||||
self.PYAS_Version.setText(_translate("MainWindow", "PYAS V0.0.0 (0000-00-00)"))
|
||||
self.GUI_Made_title.setText(_translate("MainWindow", "介面製作:"))
|
||||
self.GUI_Made_Name.setText(_translate("MainWindow", "mtkiao129#3921"))
|
||||
self.GUI_Made_Name.setText(_translate("MainWindow", "mtkiao"))
|
||||
self.Core_Made_title.setText(_translate("MainWindow", "核心製作:"))
|
||||
self.Core_Made_Name.setText(_translate("MainWindow", "PYAS_Dev#0629"))
|
||||
self.Core_Made_Name.setText(_translate("MainWindow", "87owo"))
|
||||
self.Testers_title.setText(_translate("MainWindow", "測試人員:"))
|
||||
self.Testers_Name.setText(_translate("MainWindow", "PYAS_Dev#0629"))
|
||||
self.Testers_Name.setText(_translate("MainWindow", "87owo"))
|
||||
self.PYAS_URL_title.setText(_translate("MainWindow", "官方網站:"))
|
||||
self.PYAS_URL.setText(_translate("MainWindow", "<html><head/><body><p><a href=\"https://xiaomi69ai.wixsite.com/pyas\"><span style=\" text-decoration: underline; color:#0000ff;\">https://xiaomi69ai.wixsite.com/pyas</span></a></p></body></html>"))
|
||||
self.PYAS_CopyRight.setText(_translate("MainWindow", "Copyright© 2020-2022 PYAS Security"))
|
||||
self.PYAS_URL.setText(_translate("MainWindow", "<html><head/><body><p><a href=\"https://github.com/87owo/PYAS\"><span style=\" text-decoration: underline; color:#000000;\">https://github.com/87owo/PYAS</span></a></p></body></html>"))
|
||||
self.PYAS_CopyRight.setText(_translate("MainWindow", "Copyright© 0000-9999 PYAS Security"))
|
||||
self.License_terms.setHtml(_translate("MainWindow", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
|
||||
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
|
||||
"p, li { white-space: pre-wrap; }\n"
|
||||
"</style></head><body style=\" font-family:\'MS Shell Dlg 2\'; font-size:11pt; font-weight:400; font-style:normal;\">\n"
|
||||
"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><br /></p></body></html>"))
|
||||
self.License_terms_title.setText(_translate("MainWindow", "許可條款:"))
|
||||
self.Window_title.setText(_translate("MainWindow", "PYAS V0.0.0"))
|
||||
self.Process_Tools_Back.setText(_translate("MainWindow", "返回"))
|
||||
@@ -1896,26 +1880,26 @@ class Ui_MainWindow(object):
|
||||
self.high_sensitivity_title.setText(_translate("MainWindow", "高靈敏度模式"))
|
||||
self.high_sensitivity_illustrate.setText(_translate("MainWindow", "啟用此選項可以提高引擎的靈敏度"))
|
||||
self.high_sensitivity_switch_Button.setText(_translate("MainWindow", "已關閉"))
|
||||
self.Language_title.setText(_translate("MainWindow", "語言"))
|
||||
self.Language_title.setText(_translate("MainWindow", "顯示語言"))
|
||||
self.Language_illustrate.setText(_translate("MainWindow", "請選擇語言"))
|
||||
self.Language_English.setText(_translate("MainWindow", "English"))
|
||||
self.Language_Traditional_Chinese.setText(_translate("MainWindow", "繁體中文"))
|
||||
self.Language_Simplified_Chinese.setText(_translate("MainWindow", "简体中文"))
|
||||
self.Language_English.setText(_translate("MainWindow", "English"))
|
||||
self.cloud_services_title.setText(_translate("MainWindow", "高靈敏度模式"))
|
||||
self.cloud_services_illustrate.setText(_translate("MainWindow", "啟用此選項可以提高引擎的靈敏度"))
|
||||
self.cloud_services_title.setText(_translate("MainWindow", "雲端掃描服務"))
|
||||
self.cloud_services_illustrate.setText(_translate("MainWindow", "啟用此選項可以連接雲端掃描服務"))
|
||||
self.cloud_services_switch_Button.setText(_translate("MainWindow", "已關閉"))
|
||||
self.Setting_Back.setText(_translate("MainWindow", "返回"))
|
||||
self.Add_White_list_title.setText(_translate("MainWindow", "高靈敏度模式"))
|
||||
self.Add_White_list_illustrate.setText(_translate("MainWindow", "啟用此選項可以提高引擎的靈敏度"))
|
||||
self.Add_White_list_title.setText(_translate("MainWindow", "增加到白名單"))
|
||||
self.Add_White_list_illustrate.setText(_translate("MainWindow", "此選項可以選擇檔案並增加到白名單"))
|
||||
self.Add_White_list_Button.setText(_translate("MainWindow", "已關閉"))
|
||||
self.Theme_title.setText(_translate("MainWindow", "顯色主題"))
|
||||
self.Theme_illustrate.setText(_translate("MainWindow", "請選擇主題"))
|
||||
self.Theme_Black.setText(_translate("MainWindow", "黑色主題"))
|
||||
self.Theme_White.setText(_translate("MainWindow", "白色主題"))
|
||||
self.Theme_Yellow.setText(_translate("MainWindow", "粉色主題"))
|
||||
self.Theme_Blue.setText(_translate("MainWindow", "藍色主題"))
|
||||
self.Theme_Red.setText(_translate("MainWindow", "紅色主題"))
|
||||
self.Theme_Yellow.setText(_translate("MainWindow", "黃色主題"))
|
||||
self.Theme_Green.setText(_translate("MainWindow", "綠色主題"))
|
||||
self.Theme_Blue.setText(_translate("MainWindow", "藍色主題"))
|
||||
self.Theme_Customize.setText(_translate("MainWindow", "自訂主題"))
|
||||
self.Theme_White.setText(_translate("MainWindow", "白色主題"))
|
||||
self.Theme_Red.setText(_translate("MainWindow", "紅色主題"))
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
|
||||
+54
-53
@@ -1,53 +1,54 @@
|
||||
translate_dict = {"zh_TW": {"已开启":"已開啟","已关闭":"已關閉","On":"已開啟","Off":"已關閉"},
|
||||
"zh_CN": {"已開啟":"已开启","已關閉":"已关闭","On":"已开启","Off":"已关闭",
|
||||
"軟體":"软件","檔案":"文件","確定":"确认","設定":"设置","關於":"关于",
|
||||
"錯誤":"错误","實時":"实时","發現":"发现","關閉":"关闭","裝置":"设备",
|
||||
"總數":"总数","註冊":"注册","圖標":"图标","路徑":"路径","網路":"网络",
|
||||
"位元":"字节","彈窗":"弹窗","靈敏":"敏感","誤報":"误报","複製":"复制",
|
||||
"訊":"讯","項":"项","掃":"扫","試":"试","黃":"黄","嗎":"吗","防":"保",
|
||||
"鑰":"钥","當":"当","後":"后","護":"护","導":"导","區":"区","復":"复",
|
||||
"攔":"拦","請":"请","統":"统","刪":"删","進":"进","個":"个","選":"选",
|
||||
"啟":"启","監":"监","並":"并","徑":"径","盤":"盘","隱":"隐","動":"动",
|
||||
"狀":"状","誌":"志","這":"这","會":"会","題":"题","擇":"择","語":"语",
|
||||
"無":"无","顯":"显","變":"变","戶":"户","碼":"码","雲":"云","訂":"订",
|
||||
"稱":"称","類":"类","輸":"输","執":"执","數":"数","尋":"寻","網":"网",
|
||||
"詢":"询","製":"制","員":"员","許":"许","條":"条","藍":"蓝","紅":"红",
|
||||
"綠":"绿","態":"态","務":"务","連":"连","檢":"检","測":"测","關":"关",
|
||||
"強":"强","驅":"驱","為":"为","腳":"脚","增":"增","單":"单","開":"开",
|
||||
"惡":"恶",},
|
||||
"en_US": {"已開啟":"On","已關閉":"Off","已开启":"On","已关闭":"Off",",":", ",
|
||||
"立即刪除":"Delete Now","安全模式":"Safe Mode","官方網站":"Website",
|
||||
"惡意檔案":"Virus ","惡意軟體":"Malware ","勒索軟體":"Ransom ",
|
||||
"惡意腳本":"Script ","惡意行為":"Behavior ","可疑軟體":"Suspicious ",
|
||||
"許可條款":"License Terms","惡意":"Malicious","可疑":"Suspicious",
|
||||
"啟用":"Enable ","禁用":"Disable ","正在初始化中":"Initializing ",
|
||||
"正在掃描":"Scanning ","正在刪除":"Deleting ","最小化到":"Minimize To ",
|
||||
"確定要":"Sure Want To ","靈敏度":"Sensitivity ","更新":"Update",
|
||||
"白色主題":"White","黑色主題":"Black","黃色主題":"Yellow","紅色主題":"Red",
|
||||
"藍色主題":"Blue","綠色主題":"Green","語言":"Language ","製作":"Make",
|
||||
"測試人員":"Testers","版本資訊":"Information","通訊":"Communication ",
|
||||
"註冊表":"Registry ","退出":"Quit ","檔案":"File ","當前":"Currently ",
|
||||
"狀態":"State ","掃描":"Scan ","工具":"Tools ","防護":"Protect ",
|
||||
"失敗":"Failed ","請":"Please ","路徑":"Path ","方式":"Method ",
|
||||
"需要":"Need ","病毒":"Virus ","選擇":"Select ","返回":"Back",
|
||||
"受到":"Been ","錯誤":"Error","完成":"Complete ","引擎":"Engine ",
|
||||
"托盤":"Tray ","圖標":"Icon ","不安全":"Unsafe","增強":"Enhanced ",
|
||||
"系統":"System ","雲端":"Cloud ","重啟":"Reboot ","修復":"Repair ",
|
||||
"裝置":"Device ","發現":"Found ","成功":"Success ","清理":"Cleanup ",
|
||||
"確定":"OK","執行":"Execute ","警告":"Warning ","使用":"Use ",
|
||||
"網路":"Network ","變更":"Change ","總數":"Total","結束":"End ",
|
||||
"選項":"Options ","監控":"Monitor ","連接":"Connect ","可以":"To ",
|
||||
"進程":"Process ","攔截":"Block ","引導":"Boot ","刪除":"Delete ",
|
||||
"分區":"Partition ","設定":"Settings","關於":"About","模式":"Mode ",
|
||||
"提高":"Improve ","安全":"Security ","顯色":"Color ","主題":"Themes ",
|
||||
"風險":"Risk ","介面":"GUI ","核心":"Core ","服務":"Services ",
|
||||
"管理":"Manage","所有":"All ","全盤":"Full ","取消":"Cancel ",
|
||||
"垃圾":"Junk ","位元":"byte ","本機":"Computer ","停止":"Stop ",
|
||||
"增加到":"Add File To ","白名單":"White List ","軟體":"Software ",
|
||||
"增加":"Add","移除":"Delete","項目":"Items ","生成":"Create ","稱":"",
|
||||
"開啟":"Open ","您":"You ","此":"This ","並":"And ","未":"Not ",
|
||||
"高":"High ","新":"New ","和":"And ","可能會":"Possible ","會":"Can ",
|
||||
"日誌":"Log","已":"Has ","彈窗":"Window ","要":"To ","驅動":"Drive ",
|
||||
"的":"","顯示":"","個":"","嗎":"","中":"","了":"","行":"","立即":"",
|
||||
"密鑰":"Key ","檢測":"Detect ","誤報":"False Positive "," ":" ",
|
||||
"複製":"Copy "}}
|
||||
translate_dict = {
|
||||
"zh_TW": {"已开启":"已開啟","已关闭":"已關閉","On":"已開啟","Off":"已關閉"},
|
||||
"zh_CN": {"已開啟":"已开启","已關閉":"已关闭","On":"已开启","Off":"已关闭",
|
||||
"軟體":"软件","檔案":"文件","確定":"确认","設定":"设置","關於":"关于",
|
||||
"錯誤":"错误","實時":"实时","發現":"发现","關閉":"关闭","裝置":"设备",
|
||||
"總數":"总数","註冊":"注册","圖標":"图标","路徑":"路径","網路":"网络",
|
||||
"位元":"字节","彈窗":"弹窗","靈敏":"敏感","誤報":"误报","複製":"复制",
|
||||
"訊":"讯","項":"项","掃":"扫","試":"试","黃":"黄","嗎":"吗","防":"保",
|
||||
"鑰":"钥","當":"当","後":"后","護":"护","導":"导","區":"区","復":"复",
|
||||
"攔":"拦","請":"请","統":"统","刪":"删","進":"进","個":"个","選":"选",
|
||||
"啟":"启","監":"监","並":"并","徑":"径","盤":"盘","隱":"隐","動":"动",
|
||||
"狀":"状","誌":"志","這":"这","會":"会","題":"题","擇":"择","語":"语",
|
||||
"無":"无","顯":"显","變":"变","戶":"户","碼":"码","雲":"云","介":"界",
|
||||
"稱":"称","類":"类","輸":"输","執":"执","數":"数","尋":"寻","網":"网",
|
||||
"詢":"询","製":"制","員":"员","許":"许","條":"条","藍":"蓝","紅":"红",
|
||||
"綠":"绿","態":"态","務":"务","連":"连","檢":"检","測":"测","關":"关",
|
||||
"強":"强","驅":"驱","為":"为","腳":"脚","增":"增","單":"单","開":"开",
|
||||
"惡":"恶","據":"据","庫":"库","經":"经","敗":"败"},
|
||||
"en_US": {"已開啟":"On","已關閉":"Off","已开启":"On","已关闭":"Off",",":", ",
|
||||
"立即刪除":"Delete Now","安全模式":"Safe Mode","官方網站":"Website",
|
||||
"惡意檔案":"Virus ","惡意軟體":"Malware ","勒索行為":"Ransom ",
|
||||
"惡意腳本":"Script ","惡意行為":"Behavior ","可疑軟體":"Suspicious ",
|
||||
"許可條款":"License Terms","惡意":"Malicious","可疑":"Suspicious",
|
||||
"啟用":"Enable ","禁用":"Disable ","正在初始化中":"Initializing ",
|
||||
"正在掃描":"Scanning ","正在刪除":"Deleting ","最小化到":"Minimize To ",
|
||||
"確定要":"Sure Want To ","靈敏度":"Sensitivity ","更新":"Update ",
|
||||
"白色主題":"White","黃色主題":"Yellow","紅色主題":"Red","語言":"Language ",
|
||||
"藍色主題":"Blue","綠色主題":"Green","自定主題":"Custom","最新":"Latest ",
|
||||
"測試人員":"Testers","版本資訊":"Information","通訊":"Communication ",
|
||||
"註冊表":"Registry ","退出":"Quit ","檔案":"File ","當前":"Currently ",
|
||||
"狀態":"State ","掃描":"Scan ","工具":"Tools ","防護":"Protect ",
|
||||
"失敗":"Failed ","請":"Please ","路徑":"Path ","方式":"Method ",
|
||||
"需要":"Need ","病毒":"Virus ","選擇":"Select ","返回":"Back",
|
||||
"受到":"Been ","錯誤":"Error","完成":"Complete ","引擎":"Engine ",
|
||||
"托盤":"Tray ","圖標":"Icon ","不安全":"Unsafe","增強":"Enhanced ",
|
||||
"系統":"System ","雲端":"Cloud ","重啟":"Reboot ","修復":"Repair ",
|
||||
"裝置":"Device ","發現":"Found ","成功":"Success ","清理":"Cleanup ",
|
||||
"確定":"OK","執行":"Execute ","警告":"Warning ","使用":"Use ",
|
||||
"網路":"Network ","變更":"Change ","總數":"Total","結束":"End ",
|
||||
"選項":"Options ","監控":"Monitor ","連接":"Connect ","可以":"To ",
|
||||
"進程":"Process ","攔截":"Block ","引導":"Boot ","刪除":"Delete ",
|
||||
"分區":"Partition ","設定":"Settings","關於":"About","模式":"Mode ",
|
||||
"提高":"Improve ","安全":"Security ","顯色":"Color ","主題":"Themes ",
|
||||
"風險":"Risk ","介面":"GUI ","核心":"Core ","服務":"Services ",
|
||||
"管理":"Manage","所有":"All ","您":"You ","取消":"Cancel ","未":"Not ",
|
||||
"垃圾":"Junk ","位元":"byte ","本機":"Computer ","停止":"Stop ",
|
||||
"增加到":"Add File To ","白名單":"White List ","軟體":"Software ",
|
||||
"增加":"Add","移除":"Delete","項目":"Items ","生成":"Create ","稱":"",
|
||||
"複製":"Copy ","開啟":"Open ","此":"This ","並":"And ","全盤":"Full ",
|
||||
"已經是":"Already ","數據庫":"Database ","誤報":"False Positive ",
|
||||
"高":"High ","新":"New ","和":"And ","可能會":"Possible ","會":"Can ",
|
||||
"日誌":"Log","已":"Has ","彈窗":"Window ","要":"To ","驅動":"Drive ",
|
||||
"的":"","顯示":"","個":"","嗎":"","中":"","了":"","行":"","立即":"",
|
||||
"密鑰":"Key ","檢測":"Detect ","製作":"Make"," ":" "}}
|
||||
@@ -0,0 +1 @@
|
||||
{"Virus": [261318414186602332274638176436767278092, 138027491891768042595443233665640385515, 110357087572968576943094470150101987119, 9625936089192481713091234633207548145, 89628141614819275279501592421270658611, 146573019333239184433892013297795962994, 264541877314875483358485439014616010241, 270110569967616684464025230399867156597, 317767290038007567692141082439138927345, 89378687258170412207570345845754816506, 295491687946453794463476073658069199320, 95651985866123533435079044203969354868, 127221069722257753511418504633757572348, 95651985871075295954016225919772204788, 95067756796967225976055101492886444145, 105638824952820428052005376209508641704, 18885788501897915917239730749935859793, 5340774248576581325353819949912031489, 10415246439899713411029597770193411184, 115920025419090664908814181482465136245, 230418814927598623996991522865620895293, 264555963058906459534362468816145940272, 116667039230079911205687280113439840357, 188173655331549916271106901837471791624, 10580035239361434345353152238353587444, 94568728460636955139799806421985758457, 799868415884320332536138129537778698, 307822865305226887780395456446154510073, 894545638663197114170691953086909252, 307408049865722049855100904733744729280, 281395069059347277039468499503754758797, 292376319578571219959135358926367053520, 22744055344958721368630687581251847176, 315759149185061187179391478424305256898, 255349869106614732679810651086278546442, 95562399119788972561845288789790891122, 145716650028545025053236635988099140033, 95315785306000038407304639293114375376, 133237106118017744142061791759548170883, 10159525814797641639514752130410024305, 273929518968914349238520945266572101465, 6803412338476848613694005563166320666, 94821380653995263056920242811808354032, 110684881900941951709859261701564766961, 105787286451833022929870383496648011249, 201783522381387157888199381457569830339, 105453663146661214242864956330772860016, 171522714730243767599747450471850906780, 106285815540718769887458629487913147505, 95232708608642156662699453866682554993, 106285815540717561551934825217444224113, 95559052534575041823542189821460810608, 173324173206867137081876750353781475864, 106280623246394143467097978838728292593, 305010456281757544171469123445447117681, 222253752239577871278657531622986138289, 95563048166632561463187231032275512432, 95559057605177442847140260259121040241, 108010814655804390841927389574188560953, 95318319972117721345303221798918291186, 94820584548412181705953186602301163257, 106198844586809641198104478887777078384, 94818541689698630943530703193593974512, 106119662154515582210221674170892663408, 143088668467296939342778818474878950647, 20881613063668797611160339818896853168, 179710050855676845982141937253360453053, 31018193447326218505924275935240096368, 105455042350511842344155948214062747248, 89670460543521034706908097860639104624, 105949568716338471638768471668461534962, 137521268273704145345759177480636558327, 107244620726926889373575057027717450762, 106201415362574605111426884001172884597, 110684892675972091428741019788518218489, 10332169700047182535948410013892054257, 105576376886969565715901422869178687219, 95145598865408927095247444731707367024, 105039010693725170460743583068113023705, 94987377577609631169063907051139341428, 100629312664727978741143555078594927795, 110684882592911957008875737340312369917, 148748393343889971317559945312215468786, 93989806751692355346109462915386284256, 100878647073583869926186814218125905113, 94662072863013290725024950240040430327, 105949568706125465724368274041836011250, 114380135952416886874949645426965728392, 94987377598500779420569757831453449840, 20215706740235798874506125693183790832, 110684912958381676190945511157408029425, 300558662558418689647121992472167150144, 132011016412170201801452237305311191441, 109023346904934388839803760995464461049, 336983008266790509743060629130917677774, 143175020845977086618208175741834533027, 172003113737697601641723035082316482624, 105787367661937540200783035652543688177, 95319034907171535697107975830043465952, 127216527016950104546694906326424083058, 124017012583193473160915936873388365506, 95065159985079431125978131216282192112, 10580035240599374384629243014119103732, 10496943991486934504031035936730090609, 31018193447326218505924275935240096368, 10248965448213412269216028810651597936, 100963036754215599502702416838888975610, 79036768232931406417351794113275712068, 105532141803327881065557146349585635569, 162357332045345094604141502928937491106, 116582703050825520068375122378543716978, 95150935027941497330695649661434404081, 176177498613631404614794194516575496896, 95484514342568128463910419849540603504, 105867687984072457600475937752904732400, 66833476002653370931812317778542555093, 9915421242395013439142248483403569396, 136271405179532594000996159423307548914, 47343025305025541868952332865095320248, 169502105399457292840800686344751518387, 274028058373054263663577471026209984675, 95650044561417669529155573147468110960, 100968228555433537808235270915390512872, 26Line truncated
|
||||
+5649
-6472
File diff suppressed because it is too large.
Load diff
+2
-1
@@ -1,7 +1,8 @@
|
||||
import pyinstaller_versionfile
|
||||
|
||||
pyinstaller_versionfile.create_versionfile(
|
||||
output_file="versionfile.txt",
|
||||
version='2.9.2',
|
||||
version='3.0.6',
|
||||
company_name="PYAS Security",
|
||||
file_description="Python Antivirus Software",
|
||||
internal_name="PYAS",
|
||||
|
||||
@@ -1,22 +1,176 @@
|
||||
# PYAS (Python Antivirus Software)
|
||||

|
||||
|
||||

|
||||
|
||||
## Readme Language
|
||||
|
||||
[繁體中文](https://github.com/zackzheng1121/PYAS/blob/main/README_zh.md)
|
||||
|
||||
## File Information
|
||||
|
||||
PYAS.py -> Main PYAS Program (including animation, scanning, protection functions, etc.)
|
||||
|
||||
PYAS_Engine.py -> Conversion Database (used to convert database dict and list to and from each other)
|
||||
|
||||
PYAS_Extension.py -> File Extension (including scanned file extensions and common file extensions)
|
||||
|
||||
PYAS_Model.* -> Virus Database (the virus database must be placed in the same directory)
|
||||
|
||||
PYAS_Interface.py -> PyQt5 Interface (designed by QT designer, must be matched with the main program)
|
||||
|
||||
PYAS_Resource.py -> PyQt5 Resource (status pictures, icon packages, button icons, etc.)
|
||||
|
||||
PYAS_Language.py -> Translate Dict (Traditional Chinese, Simplified Chinese, English)
|
||||
|
||||
PYAS_Version.py -> Pyinstaller Info (file information, version information, original name, etc.)
|
||||
|
||||
## Requirements
|
||||
|
||||
Use pip install requirements to install import module
|
||||
|
||||
```
|
||||
psutil==5.9.5
|
||||
pefile==2023.2.7
|
||||
requests==2.31.0
|
||||
pyperclip==1.8.2
|
||||
pywin32==306
|
||||
PyQt5==5.15.9
|
||||
```
|
||||
|
||||
## Hash Scanning
|
||||
|
||||
Use Qihoo 360 cloud service to scan known malicious files
|
||||
|
||||
```
|
||||
import hashlib, requests
|
||||
import xml.etree.ElementTree as xmlet
|
||||
|
||||
def hash_scan(file):
|
||||
try:
|
||||
with open(file, "rb") as f:
|
||||
text = str(hashlib.md5(f.read()).hexdigest())
|
||||
strBody = f'-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="md5s"\r\n\r\n{text}\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="format"\r\n\r\nXML\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="product"\r\n\r\n360zip\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="combo"\r\n\r\n360zip_main\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="v"\r\n\r\n2\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="osver"\r\n\r\n5.1\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="vk"\r\n\r\na03bc211\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="mid"\r\n\r\n8a40d9eff408a78fe9ec10a0e7e60f62\r\n-------------------------------7d83e2d7a141e--'
|
||||
response = requests.post('http://qup.f.360.cn/file_health_info.php', data=strBody, timeout=3)
|
||||
if response.status_code == 200:
|
||||
level = float(xmlet.fromstring(response.text).find('.//e_level').text)
|
||||
if level > 50:
|
||||
return "Virus"
|
||||
elif level <= 10:
|
||||
return "Safe"
|
||||
return "Unknown"
|
||||
return f"Error: {response.status_code}"
|
||||
except Exception as e:
|
||||
return f"Error: {e}"
|
||||
|
||||
info = hash_scan("path to file")
|
||||
print(info)
|
||||
```
|
||||
|
||||
## Pefile Scanning
|
||||
|
||||
Get the pefile file function import table for scanning
|
||||
|
||||
```
|
||||
import pefile
|
||||
|
||||
def pe_scan(file):
|
||||
try:
|
||||
fn = []
|
||||
with pefile.PE(file) as pe:
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for func in entry.imports:
|
||||
try:
|
||||
fn.append(str(func.name, "utf-8"))
|
||||
except:
|
||||
pass
|
||||
if fn in known_malicious_list:
|
||||
return "Virus"
|
||||
return "Safe"
|
||||
return "Unknown"
|
||||
except Exception as e:
|
||||
return f"Error: {e}"
|
||||
|
||||
info = pe_scan("path to file")
|
||||
print(info)
|
||||
```
|
||||
|
||||
## Process Detect
|
||||
|
||||
Show the new process name, file path, cmd line, pid
|
||||
|
||||
```
|
||||
import psutil, time
|
||||
|
||||
def proc_detect():
|
||||
existing_processes = set()
|
||||
for p in psutil.process_iter():
|
||||
if p.pid not in existing_processes:
|
||||
existing_processes.add(p.pid)
|
||||
while True:
|
||||
time.sleep(0.1)
|
||||
for p in psutil.process_iter():
|
||||
try:
|
||||
if p.pid not in existing_processes:
|
||||
existing_processes.add(p.pid)
|
||||
name, file, cmd = p.name(), p.exe(), p.cmdline()
|
||||
print(f"Name: {name}")
|
||||
print(f"File: {file}")
|
||||
print(f"Pid: {p.pid}")
|
||||
print(f"Cmd: {cmd}")
|
||||
elif not psutil.pid_exists(p.pid):
|
||||
existing_processes.remove(p.pid)
|
||||
except:
|
||||
pass
|
||||
|
||||
proc_detect()
|
||||
```
|
||||
|
||||
## File Detect
|
||||
|
||||
Monitor file changes under the specified path
|
||||
|
||||
```
|
||||
import os, win32file, win32con
|
||||
|
||||
def file_detect(path):
|
||||
hDir = win32file.CreateFile(path,win32con.GENERIC_READ,win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE|win32con.FILE_SHARE_DELETE,None,win32con.OPEN_EXISTING,win32con.FILE_FLAG_BACKUP_SEMANTICS,None)
|
||||
while True:
|
||||
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:
|
||||
fpath = os.path.join(path, file)
|
||||
if action == 1:
|
||||
print(f"File Create: {fpath}")
|
||||
elif action == 2:
|
||||
print(f"File Delete: {fpath}")
|
||||
elif action == 3:
|
||||
print(f"File Modify: {fpath}")
|
||||
elif action == 4:
|
||||
print(f"File Rename: {fpath}")
|
||||
elif action == 5:
|
||||
print(f"File Rename: {fpath}")
|
||||
except:
|
||||
pass
|
||||
|
||||
file_detect("path")
|
||||
```
|
||||
|
||||
## Official Website
|
||||
https://pyantivirus.wixsite.com/pyas , https://github.com/87owo/PYAS
|
||||
|
||||
## MIT License
|
||||
https://pyantivirus.wixsite.com/pyas
|
||||
|
||||
https://github.com/87owo/PYAS
|
||||
|
||||
## MIT license
|
||||
|
||||
https://github.com/87owo/PYAS/blob/main/LICENSE.md
|
||||
|
||||
## Support System
|
||||
|
||||
Windows 8.1, 10, 11 (64-bit), Ram 1GB, Rom 1GB or higher
|
||||
|
||||
## Requirements
|
||||
psutil==5.9.5, pefile==2023.2.7, requests==2.31.0, pyperclip==1.8.2, pywin32==306, PyQt5==5.15.9
|
||||
|
||||
## Import Module
|
||||
os, gc, sys, time, json, psutil, hashlib, pefile, socket, msvcrt, requests, pyperclip, win32file, win32gui, win32api, win32con, xml, PYAS_Scripts, PYAS_Function, PYAS_Extension, PYAS_Language, PYAS_Interface, threading, PyQt5
|
||||
Other systems may experience software malfunctions or crash
|
||||
|
||||
## Special Thanks
|
||||
360, Wix, VirusShare, mtkiao129, LenStevens
|
||||
360, Wix, VirusShare, mtkiao129, AV-T Team of LisectGroup
|
||||
|
||||
Copyright© 2020~2023 PYAS Security By 87owo
|
||||
Copyright© 2020~2024 PYAS Security By 87owo
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
# PYAS (Python 防毒軟體)
|
||||
|
||||

|
||||
|
||||
## 文件訊息
|
||||
|
||||
PYAS.py -> PYAS主程式(包括動畫、掃描、保護功能等)
|
||||
|
||||
PYAS_Engine.py -> 轉換資料庫(用於相互轉換資料庫字典和清單)
|
||||
|
||||
PYAS_Extension.py -> 檔案副檔名(包括掃描檔案副檔名和常用檔案副檔名)
|
||||
|
||||
PYAS_Model.* -> 病毒庫(病毒庫必須放在同一目錄下)
|
||||
|
||||
PYAS_Interface.py -> PyQt5 Interface(由QT設計師設計,必須與主程式相符)
|
||||
|
||||
PYAS_Resource.py -> PyQt5資源(狀態圖片、圖示包、按鈕圖示等)
|
||||
|
||||
PYAS_Language.py -> 翻譯字典(繁體中文、簡體中文、英文)
|
||||
|
||||
PYAS_Version.py -> Pyinstaller Info(檔案資訊、版本資訊、原名等)
|
||||
|
||||
## 要求
|
||||
|
||||
使用 pip install requirements 來安裝需要的模組
|
||||
|
||||
```
|
||||
psutil==5.9.5
|
||||
pefile==2023.2.7
|
||||
requests==2.31.0
|
||||
pyperclip==1.8.2
|
||||
pywin32==306
|
||||
PyQt5==5.15.9
|
||||
```
|
||||
|
||||
## 哈希掃描
|
||||
|
||||
使用奇虎360雲端服務掃描已知惡意文件
|
||||
|
||||
```
|
||||
import hashlib, requests
|
||||
import xml.etree.ElementTree as xmlet
|
||||
|
||||
def hash_scan(file):
|
||||
try:
|
||||
with open(file, "rb") as f:
|
||||
text = str(hashlib.md5(f.read()).hexdigest())
|
||||
strBody = f'-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="md5s"\r\n\r\n{text}\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="format"\r\n\r\nXML\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="product"\r\n\r\n360zip\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="combo"\r\n\r\n360zip_main\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="v"\r\n\r\n2\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="osver"\r\n\r\n5.1\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="vk"\r\n\r\na03bc211\r\n-------------------------------7d83e2d7a141e\r\nContent-Disposition: form-data; name="mid"\r\n\r\n8a40d9eff408a78fe9ec10a0e7e60f62\r\n-------------------------------7d83e2d7a141e--'
|
||||
response = requests.post('http://qup.f.360.cn/file_health_info.php', data=strBody, timeout=3)
|
||||
if response.status_code == 200:
|
||||
level = float(xmlet.fromstring(response.text).find('.//e_level').text)
|
||||
if level > 50:
|
||||
return "Virus"
|
||||
elif level <= 10:
|
||||
return "Safe"
|
||||
return "Unknown"
|
||||
return f"Error: {response.status_code}"
|
||||
except Exception as e:
|
||||
return f"Error: {e}"
|
||||
|
||||
info = hash_scan("path to file")
|
||||
print(info)
|
||||
```
|
||||
|
||||
## 文件掃描
|
||||
|
||||
取得pefile檔案函數導入表進行掃描
|
||||
|
||||
```
|
||||
import pefile
|
||||
|
||||
def pe_scan(file):
|
||||
try:
|
||||
fn = []
|
||||
with pefile.PE(file) as pe:
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for func in entry.imports:
|
||||
try:
|
||||
fn.append(str(func.name, "utf-8"))
|
||||
except:
|
||||
pass
|
||||
if fn in known_malicious_list:
|
||||
return "Virus"
|
||||
return "Safe"
|
||||
return "Unknown"
|
||||
except Exception as e:
|
||||
return f"Error: {e}"
|
||||
|
||||
info = pe_scan("path to file")
|
||||
print(info)
|
||||
```
|
||||
|
||||
## 進程偵測
|
||||
|
||||
顯示新進程名稱、檔案路徑、cmd 行、pid
|
||||
```
|
||||
import psutil, time
|
||||
|
||||
def proc_detect():
|
||||
existing_processes = set()
|
||||
for p in psutil.process_iter():
|
||||
if p.pid not in existing_processes:
|
||||
existing_processes.add(p.pid)
|
||||
while True:
|
||||
time.sleep(0.1)
|
||||
for p in psutil.process_iter():
|
||||
try:
|
||||
if p.pid not in existing_processes:
|
||||
existing_processes.add(p.pid)
|
||||
name, file, cmd = p.name(), p.exe(), p.cmdline()
|
||||
print(f"Name: {name}")
|
||||
print(f"File: {file}")
|
||||
print(f"Pid: {p.pid}")
|
||||
print(f"Cmd: {cmd}")
|
||||
except:
|
||||
pass
|
||||
|
||||
proc_detect()
|
||||
```
|
||||
|
||||
## 檔案偵測
|
||||
|
||||
監控指定路徑下的檔案變化
|
||||
```
|
||||
import os, win32file, win32con
|
||||
|
||||
def file_detect(path):
|
||||
hDir = win32file.CreateFile(path,win32con.GENERIC_READ,win32con.FILE_SHARE_READ|win32con.FILE_SHARE_WRITE|win32con.FILE_SHARE_DELETE,None,win32con.OPEN_EXISTING,win32con.FILE_FLAG_BACKUP_SEMANTICS,None)
|
||||
while True:
|
||||
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:
|
||||
fpath = os.path.join(path, file)
|
||||
if action == 1:
|
||||
print(f"File Create: {fpath}")
|
||||
elif action == 2:
|
||||
print(f"File Delete: {fpath}")
|
||||
elif action == 3:
|
||||
print(f"File Modify: {fpath}")
|
||||
elif action == 4:
|
||||
print(f"File Rename: {fpath}")
|
||||
elif action == 5:
|
||||
print(f"File Rename: {fpath}")
|
||||
except:
|
||||
pass
|
||||
|
||||
file_detect("path")
|
||||
```
|
||||
|
||||
## 官方網頁
|
||||
|
||||
https://pyantivirus.wixsite.com/pyas
|
||||
|
||||
https://github.com/87owo/PYAS
|
||||
|
||||
## 開源許可證
|
||||
|
||||
https://github.com/87owo/PYAS/blob/main/LICENSE.md
|
||||
|
||||
## 支援的系統
|
||||
|
||||
Windows 8.1, 10, 11 (64-bit),記憶體 1GB, 磁碟容量 1GB 或更高
|
||||
Other systems may experience software malfunctions or crash
|
||||
|
||||
## Special Thanks
|
||||
360, Wix, VirusShare, mtkiao129, AV-T Team of LisectGroup
|
||||
|
||||
Copyright© 2020~2024 PYAS Security By 87owo
|
||||
Reference in new issue
Block a user