Compare commits

...
17 Commits
Author SHA1 Message Date
PYDT e8e4cb5ebe Add files via upload 2023-03-03 11:42:29 +08:00
mtkiao129 87175e6e89 優化PYAS.py檔案 2023-03-02 17:47:21 +08:00
PYDT 301340b512 Add files via upload 2023-03-02 17:43:18 +08:00
PYDT e4388201c2 Add files via upload 2023-03-02 15:10:14 +08:00
PYDT ac3b2b7c80 Add files via upload 2023-03-01 18:46:09 +08:00
PYDT 5e79354705 Add files via upload 2023-03-01 13:18:12 +08:00
PYDT d39ef0693f Add files via upload 2023-03-01 13:17:11 +08:00
PYDT 2577333d79 Delete Library/PYAS/Audio directory 2023-03-01 13:14:11 +08:00
PYDT 115c335916 Delete Askaction.ogg 2023-03-01 13:13:56 +08:00
PYDT 4bfbdf476f Delete Viruslist.func 2023-03-01 13:13:13 +08:00
PYDT faea8cd616 Add files via upload 2023-03-01 10:56:54 +08:00
PYDT 6f1db7f9ef Delete PYAS_api.py 2023-03-01 10:55:48 +08:00
PYDT 204977cc49 Add files via upload 2023-02-26 18:12:02 +08:00
PYDT 8e825a58f0 Update PYAS_api.py 2023-02-26 10:04:04 +08:00
PYDT 3e567c6ffb Update PYAS_api.py 2023-02-25 22:45:00 +08:00
PYDT 8845f2a964 Add files via upload 2023-02-25 22:16:18 +08:00
PYDT a1400992af Update README.md 2023-02-25 20:15:49 +08:00
10 changed files with 265 additions and 369 deletions

No files matched your search

-30
View File
@@ -1,30 +0,0 @@
GetSystemDirectory
BroadcastSystemMessage
BroadcastSystemMessage
CreateIcon
RegOpenCurrentUser
RegSetValue
RegCreateKey
RegDeleteValue
RegisterClass
RegisterHotKey
RegisterClipboardFormat
RegisterWindowMessage
RegisterClass
CryptDestroyKey
CryptGenKey
CryptDecrypt
CryptEncrypt
CryptImportKey
CryptSetKeyParam
CryptDeriveKey
CryptCreateHash
CryptHashData
CryptStringToBinary
CryptBinaryToString
CryptGetKeyParam
CryptGetHashParam
CryptDestroyHash
CryptImportPublicKeyInfo
UnlockFile
LockFile
Binary file not shown.
Binary file not shown.
Binary file not shown.
+243 -318
View File
@@ -12,7 +12,6 @@
import os, sys, time, json, psutil, subprocess, requests
import win32api, win32con, socket, cryptocode, platform
from configparser import RawConfigParser
from pefile import PE, DIRECTORY_ENTRY
from hashlib import md5, sha1, sha256
from PYAS_English import english_list
@@ -24,7 +23,6 @@ from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5 import QtWidgets, QtGui, QtCore
from PYAS_UI import Ui_MainWindow
start_m = time.process_time()
###################################### 錯誤日誌 #####################################
@@ -63,61 +61,27 @@ def pyas_library():
except Exception as e:
pyas_bug_log(e)
##################################### 更新資料庫 ####################################
def pyas_vl_update():
try:
with open('Library/PYAE/Hashes/Viruslist.num', 'r') as f:
v = int(f.read())
except:
v = 0
for i in range(v, 10000):
try:
y = f'VirusShare_{i:05}.md5'
url = f'https://virusshare.com/hashfiles/{y}'
content = requests.get(url, allow_redirects=True).content
hash_value = md5(content).hexdigest()
if hash_value != '449a34c34a7507dffe1d39afad3eeac9':
with open(f'Library/PYAE/Hashes/{y}', 'wb') as f:
f.write(content)
with open(f'Library/PYAE/Hashes/{y}', 'r') as f:
lines = f.readlines()[6:]
with open('Library/PYAE/Hashes/Viruslist.md5', 'a') as vlist:
for line in lines:
vlist.write(line[:10] + '\n')
os.remove(f'Library/PYAE/Hashes/{y}')
v = i + 1
else:
v = i
print(f'[INFO] Hashes Update Complete (V{v - 1})')
break
with open('Library/PYAE/Hashes/Viruslist.num', 'w') as f:
f.write(str(v))
except Exception as e:
print(e)
print(f'[INFO] Hashes Update Fail (V{i - 1})')
break
###################################### 密鑰認證 #####################################
def pyas_key():
try:
if os.path.isfile('Library/PYAS/Setup/PYAS.key'):
with open('Library/PYAS/Setup/PYAS.key', 'r') as f:
fe = f.read()
try:
with open('PYAS.exe', 'rb') as f:
bytes = f.read()
f.close()
except:
with open('PYAS.py', 'rb') as f:
bytes = f.read()
f.close()
if fe == str(md5(bytes).hexdigest()):
return True
return False
except Exception as e:
pyas_bug_log(e)
with open(sys.argv[0], 'rb') as f:
file_md5 = str(md5(f.read()).hexdigest())
try:
response = requests.get("http://27.147.30.238:5001/key", params={'key': file_md5})
if response.status_code == 200:
if response.text == 'True':
with open('Library/PYAS/Setup/PYAS.key', 'w') as fc:
fc.write(file_md5)
return True
return False
except:
if os.path.isfile('Library/PYAS/Setup/PYAS.key'):
with open('Library/PYAS/Setup/PYAS.key', 'r') as fc:
if file_md5 == str(fc.read()):
return True
return False
except:
return False
###################################### 主要程式 #####################################
@@ -126,6 +90,11 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
def __init__(self):
super(MainWindow_Controller, self).__init__()
self.ui = Ui_MainWindow() #繼承
try:
with open('Library/PYAE/Hashes/Viruslist.num', 'r') as f:
self.ui.vl = int(f.read())-1
except:
self.ui.vl = -1
self.ui.pyas_opacity = 100
self.setAttribute(Qt.WA_TranslucentBackground) #去掉邊框
self.setWindowFlags(Qt.FramelessWindowHint) #取消使用Windows預設得窗口模式
@@ -133,10 +102,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.setupUi(self)
self.setup_control()
def resizeEvent(self, event):
width, height = event.size().width(), event.size().height()
print(f'[INFO] {event.size()}')
def writeConfig(self, config):
with open('Library/PYAS/Setup/PYAS.json', 'w', encoding='utf-8') as f:
f.write(json.dumps(config, indent=4, ensure_ascii=False))
@@ -213,40 +178,39 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.Theme_Red.clicked.connect(self.Change_Theme)
def init(self):
self.Safe = True
self.Virus_Scan = 0
self.ui.widget_2.lower()
self.ui.Navigation_Bar.raise_()
self.ui.Window_widget.raise_()
self.ui.Virus_Scan_choose_widget.raise_()
self.Process_sim = QStringListModel()
self.Process_quantity = []
self.Virus_Scan = 0
self.Safe = True
self.Process_Timer = QTimer()
self.Process_Timer.timeout.connect(self.Process_list)
if (not os.path.exists('Library/PYAS/Setup/PYAS.json')):
config = {"high_sensitivity":0,"language":"english"}
self.writeConfig(config)
if not os.path.exists('Library/PYAS/Setup/PYAS.json'):
self.writeConfig({"high_sensitivity":0,"language":"english"})
with open('Library/PYAS/Setup/PYAS.json', 'r', encoding='utf-8') as f:
self.pyasConfig = json.load(f)
try:
self.ui.Theme_White.setChecked(True)
if self.pyasConfig['language'] == "zh_TW":
self.lang_init_zh_tw()
self.ui.Language_Traditional_Chinese.setChecked(True)
self.lang_init_zh_tw()
elif self.pyasConfig['language'] == "zh_CN":
self.lang_init_zh_cn()
self.ui.Language_Simplified_Chinese.setChecked(True)
self.lang_init_zh_cn()
else:
self.lang_init_en()
self.ui.Languahe_English.setChecked(True)
self.lang_init_en()
except:
config = {"high_sensitivity":0,"language":"english"}
self.writeConfig(config)
self.writeConfig({"high_sensitivity":0,"language":"english"})
self.pyasConfig['language'] = "english"
self.lang_init_en()
self.ui.Languahe_English.setChecked(True)
self.lang_init_en()
try:
Thread(target = pyas_vl_update).start()
Thread(target = self.pyas_protect_init_zh).start()
Thread(target = self.pyas_vl_update).start()
if self.pyasConfig['high_sensitivity'] == 1:
self.show_virus_scan_progress_bar = 1
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate("已開啟"))
@@ -295,16 +259,46 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.Customize_REG_Command_widget.hide()
self.ui.Setting_widget.hide()
##################################### 更新資料庫 ####################################
def pyas_vl_update(self):
for i in range(self.ui.vl, 100000):
try:
y = f'VirusShare_{i:05}.md5'
content = requests.get(f'https://virusshare.com/hashfiles/{y}', allow_redirects=True).content
if md5(content).hexdigest() != '449a34c34a7507dffe1d39afad3eeac9':
with open(f'Library/PYAE/Hashes/{y}', 'wb') as f:
f.write(content)
with open(f'Library/PYAE/Hashes/{y}', 'r') as f:
lines = f.readlines()[6:]
with open('Library/PYAE/Hashes/Viruslist.md5', 'a') as vlist:
for line in lines:
vlist.write(line[:10]+'\n')
os.remove(f'Library/PYAE/Hashes/{y}')
self.ui.vl = i + 1
else:
self.ui.vl = i
print(f'[INFO] Hashes Update Complete (V{self.ui.vl - 1})')
break
with open('Library/PYAE/Hashes/Viruslist.num', 'w') as f:
f.write(str(self.ui.vl))
except:
print(f'[INFO] Hashes Update Fail (V{i - 1})')
break
##################################### 英文初始化 ####################################
def lang_init_en(self):
_translate = QtCore.QCoreApplication.translate
self.ui.State_output.clear()
if self.Safe:
self.ui.State_title.setText(_translate("MainWindow", "This device has been protected"))
else:
self.ui.State_title.setText(_translate("MainWindow", "This device is currently unsafe"))
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [Warning] PYAS Security Key Error')
if pyas_key():
self.ui.Window_title.setText(_translate("MainWindow", f"PYAS V{pyas_version}"))
else:
self.ui.Window_title.setText(_translate("MainWindow", f"PYAS V{pyas_version} (Security Key Error)"))
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [Warning] PYAS Security Key Error')
self.ui.State_Button.setText(_translate("MainWindow", "State"))
self.ui.Virus_Scan_Button.setText(_translate("MainWindow", "Scan"))
self.ui.Tools_Button.setText(_translate("MainWindow", "Tools"))
@@ -319,14 +313,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.Virus_Scan_Break_Button.setText(_translate("MainWindow", "Stop Scan"))
self.ui.Protection_title.setText(_translate("MainWindow", "Real-time protection"))
self.ui.Protection_illustrate.setText(_translate("MainWindow", "Enable this option to monitor and remove malware in the system in real time."))
if self.ui.Protection_switch_Button.text() == self.text_Translate("已開啟"):
self.ui.Protection_switch_Button.setText(_translate("MainWindow", "On"))
else:
self.ui.Protection_switch_Button.setText(_translate("MainWindow", "Off"))
if self.Safe:
self.ui.State_title.setText(_translate("MainWindow", "This device has been protected"))
else:
self.ui.State_title.setText(_translate("MainWindow", "This device is currently unsafe"))
self.ui.Protection_switch_Button.setText(self.text_Translate(self.ui.Protection_switch_Button.text()))
self.ui.State_log.setText(_translate("MainWindow", "Log:"))
self.ui.System_Tools_Button.setText(_translate("MainWindow", "System Tools"))
self.ui.Privacy_Tools_Button.setText(_translate("MainWindow", "Privacy Tools"))
@@ -385,12 +372,12 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
cy = str('2020')
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", f"Copyright© 2020-{cy} 87owo (PYAS Security)"))
try:
with open('Library/PYAE/Hashes/Viruslist.num','r') as vl:
if int(vl.read())-1 < 0:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (Downloading Library...)"))
else:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (Library Version: "+str(int(vl.read())-1)+")"))
except:
if self.ui.vl < 0:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (Downloading Library...)"))
else:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (Library Version: "+str(self.ui.vl)+")"))
except Exception as e:
print(e)
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (Downloading Library...)"))
self.ui.Change_Users_Password_Back.setText(_translate("MainWindow", "Back"))
self.ui.Change_Users_Password_New_Password_title.setText(_translate("MainWindow", "New password:"))
@@ -405,10 +392,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.Value_HEKY_title.setText(_translate("MainWindow", "Value HEKY:"))
self.ui.Show_Virus_Scan_Progress_Bar_title.setText(_translate("MainWindow", "High Sensitivity Mode"))
self.ui.Show_Virus_Scan_Progress_Bar_illustrate.setText(_translate("MainWindow", "Enable this option can improve scanning sensitivity,\nbut it can also cause manslaughter."))
if self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text() == self.text_Translate("已開啟"):
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(_translate("MainWindow", "On"))
else:
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(_translate("MainWindow", "Off"))
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate(self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text()))
self.ui.Setting_Back.setText(_translate("MainWindow", "Back"))
self.ui.Language_title.setText(_translate("MainWindow", "Language"))
self.ui.Language_illustrate.setText(_translate("MainWindow", "Please select language"))
@@ -426,7 +410,10 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
def lang_init_zh_cn(self):
_translate = QtCore.QCoreApplication.translate
self.ui.State_output.clear()
if self.Safe:
self.ui.State_title.setText(_translate("MainWindow", "这部装置已受到保护"))
else:
self.ui.State_title.setText(_translate("MainWindow", "这部装置目前不安全"))
if pyas_key():
self.ui.Window_title.setText(_translate("MainWindow", f"PYAS V{pyas_version}"))
else:
@@ -446,14 +433,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.Virus_Scan_Break_Button.setText(_translate("MainWindow", "停止扫描"))
self.ui.Protection_title.setText(_translate("MainWindow", "实时防护"))
self.ui.Protection_illustrate.setText(_translate("MainWindow", "启用该选项可以实时监控进程中的恶意软体并清除。"))
if self.ui.Protection_switch_Button.text() == self.text_Translate("已開啟"):
self.ui.Protection_switch_Button.setText(_translate("MainWindow", "已开启"))
else:
self.ui.Protection_switch_Button.setText(_translate("MainWindow", "已关闭"))
if self.Safe:
self.ui.State_title.setText(_translate("MainWindow", "这部装置已受到保护"))
else:
self.ui.State_title.setText(_translate("MainWindow", "这部装置目前不安全"))
self.ui.Protection_switch_Button.setText(self.text_Translate(self.ui.Protection_switch_Button.text()))
self.ui.State_log.setText(_translate("MainWindow", "日志:"))
self.ui.System_Tools_Button.setText(_translate("MainWindow", "系统工具"))
self.ui.Privacy_Tools_Button.setText(_translate("MainWindow", "隐私工具"))
@@ -512,11 +492,10 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
cy = str('2020')
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", f"Copyright© 2020-{cy} 87owo (PYAS Security)"))
try:
with open('Library/PYAE/Hashes/Viruslist.num','r') as vl:
if int(vl.read())-1 < 0:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (正在下载数据庫...)"))
else:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (数据庫版本: "+str(int(vl.read())-1)+")"))
if self.ui.vl < 0:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (正在下载数据庫...)"))
else:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (数据庫版本: "+str(self.ui.vl)+")"))
except:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (正在下载数据庫...)"))
self.ui.Change_Users_Password_Back.setText(_translate("MainWindow", "返回"))
@@ -532,10 +511,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.Value_HEKY_title.setText(_translate("MainWindow", "值HEKY:"))
self.ui.Show_Virus_Scan_Progress_Bar_title.setText(_translate("MainWindow", "高灵敏度模式"))
self.ui.Show_Virus_Scan_Progress_Bar_illustrate.setText(_translate("MainWindow", "启用该选项可以提高扫描灵敏度,但这也可能会造成误杀。"))
if self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text() == self.text_Translate("已開啟"):
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(_translate("MainWindow", "已开启"))
else:
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(_translate("MainWindow", "已关闭"))
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate(self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text()))
self.ui.Setting_Back.setText(_translate("MainWindow", "返回"))
self.ui.Language_title.setText(_translate("MainWindow", "语言"))
self.ui.Language_illustrate.setText(_translate("MainWindow", "请选择语言"))
@@ -553,7 +529,10 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
def lang_init_zh_tw(self):
_translate = QtCore.QCoreApplication.translate
self.ui.State_output.clear()
if self.Safe:
self.ui.State_title.setText(_translate("MainWindow", "這部裝置已受到保護"))
else:
self.ui.State_title.setText(_translate("MainWindow", "這部裝置目前不安全"))
if pyas_key():
self.ui.Window_title.setText(_translate("MainWindow", f"PYAS V{pyas_version}"))
else:
@@ -573,14 +552,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.Virus_Scan_Break_Button.setText(_translate("MainWindow", "停止掃描"))
self.ui.Protection_title.setText(_translate("MainWindow", "實時防護"))
self.ui.Protection_illustrate.setText(_translate("MainWindow", "啟用該選項可以實時監控進程中的惡意軟體並清除。"))
if self.ui.Protection_switch_Button.text() == self.text_Translate("已开启"):
self.ui.Protection_switch_Button.setText(_translate("MainWindow", "已開啟"))
else:
self.ui.Protection_switch_Button.setText(_translate("MainWindow", "已關閉"))
if self.Safe:
self.ui.State_title.setText(_translate("MainWindow", "這部裝置已受到保護"))
else:
self.ui.State_title.setText(_translate("MainWindow", "這部裝置目前不安全"))
self.ui.Protection_switch_Button.setText(self.text_Translate(self.ui.Protection_switch_Button.text()))
self.ui.State_log.setText(_translate("MainWindow", "日誌:"))
self.ui.System_Tools_Button.setText(_translate("MainWindow", "系統工具"))
self.ui.Privacy_Tools_Button.setText(_translate("MainWindow", "隱私工具"))
@@ -639,11 +611,10 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
cy = str('2020')
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", f"Copyright© 2020-{cy} 87owo (PYAS Security)"))
try:
with open('Library/PYAE/Hashes/Viruslist.num','r') as vl:
if int(vl.read())-1 < 0:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (正在下載資料庫...)"))
else:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (資料庫版本: "+str(int(vl.read())-1)+")"))
if self.ui.vl < 0:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (正在下載資料庫...)"))
else:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (資料庫版本: "+str(self.ui.vl)+")"))
except:
self.ui.PYAE_Version.setText(_translate("MainWindow", f"PYAE V{pyae_version} (正在下載資料庫...)"))
self.ui.Change_Users_Password_Back.setText(_translate("MainWindow", "返回"))
@@ -659,10 +630,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.Value_HEKY_title.setText(_translate("MainWindow", "值HEKY:"))
self.ui.Show_Virus_Scan_Progress_Bar_title.setText(_translate("MainWindow", "高靈敏度模式"))
self.ui.Show_Virus_Scan_Progress_Bar_illustrate.setText(_translate("MainWindow", "啟用該選項可以提高掃描靈敏度,但這也可能會造成誤殺。"))
if self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text() == self.text_Translate("已开启"):
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(_translate("MainWindow", "已開啟"))
else:
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(_translate("MainWindow", "已關閉"))
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate(self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text()))
self.ui.Setting_Back.setText(_translate("MainWindow", "返回"))
self.ui.Language_title.setText(_translate("MainWindow", "語言"))
self.ui.Language_illustrate.setText(_translate("MainWindow", "請選擇語言"))
@@ -679,18 +647,21 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
####################################### 翻譯 #####################################
def text_Translate(self, text):
if self.pyasConfig['language'] == "zh_CN":
translations = {"嗎": "吗","項": "项","護": "护","攔": "拦","請": "请",
"後": "后","鑰": "钥","統": "统","當": "当","確": "确",
"復": "复","掃描": "扫描","檔案": "文件","錯誤": "错误",
"實時": "实时","發現": "发现","權限": "权限","軟體": "软件",
"惡意": "恶意","設定": "设置","關於": "关于","開啟": "开启",
"關閉": "关闭",}
if self.pyasConfig['language'] == "zh_TW":
translations = {"已开启": "已開啟","已关闭": "已關閉","On": "已開啟","Off": "已關閉"}
for k, v in translations.items():
text = text.replace(k, v)
return text
elif self.pyasConfig['language'] == "zh_CN":
translations = {"嗎": "吗","項": "项","復": "复","攔": "拦","請": "请","後": "后","鑰": "钥","統": "统",
"當": "当","確定": "确认","掃描": "扫描","檔案": "文件","錯誤": "错误","實時": "实时",
"發現": "发现","權限": "权限","惡意": "恶意","設定": "设置","關於": "关于","防護": "保护",
"已開啟": "已开启","已關閉": "已关闭","On": "已开启","Off": "已关闭","軟體": "软件"}
for k, v in translations.items():
text = text.replace(k, v)
return text
elif self.pyasConfig['language'] == "english":
return english_list[text]
return text
################################### 視窗動畫特效 ####################################
@@ -895,15 +866,16 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
def Virus_Solve(self):
try:
for line in self.Virus_List:
if ':/Windows' in str(line):
pass
else:
self.ui.Virus_Scan_text.setText(self.text_Translate('正在刪除: ')+str(line))
QApplication.processEvents()
try:
try:
if ':/Windows' not in str(line):
self.ui.Virus_Scan_text.setText(self.text_Translate('正在刪除: ')+str(line))
QApplication.processEvents()
os.remove(str(line))
except:
continue
except:
continue
self.Virus_List = []
self.Virus_List_output.setStringList(self.Virus_List)
self.ui.Virus_Scan_output.setModel(self.Virus_List_output)
self.ui.Virus_Scan_text.setText(self.text_Translate('✔成功: 已執行成功。'))
self.ui.Virus_Scan_Solve_Button.hide()
self.ui.State_icon.setPixmap(QtGui.QPixmap(":/icon/Icon/check.png"))
@@ -914,32 +886,17 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.Safe = False
self.ui.Virus_Scan_text.setText(self.text_Translate("✖錯誤: 執行失敗。"))
def list_allfile(self, path, all_files=[]):
if not os.path.exists(path):
print('[Error] This path does not exist')
return False
for file in os.listdir(path):
abs_path = os.path.abspath(os.path.join(path, file))
if os.path.isfile(abs_path):
all_files.append(abs_path)
elif os.path.isdir(abs_path):
all_files = self.list_allfile(abs_path, all_files)
return all_files
def api_scan(self, types, file):
try:
with open(file, "rb") as f:
file_md5 = str(md5(f.read()).hexdigest())
response = requests.get("http://27.147.30.238:5001/pyas", params={types: file_md5})
if response.status_code == 200:
if response.text == 'True':
return 1
else:
return 0
else:
return -1
response = requests.get("http://27.147.30.238:5001/pyas", params={types: file_md5})
if response.status_code == 200:
if response.text == 'True':
return True
return False
except:
return -1
return False
def pyas_scan_start(self, file, rfp):
try:
@@ -955,7 +912,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
pe.close()
for entry in pe.DIRECTORY_ENTRY_IMPORT:#函數檢測
for function in entry.imports:
if '_CorExeMain' in str(function.name):# or 'CreateRemoteThread' in x or 'WriteProcessMemory' in x or 'VirtualAlloc' in x:
if '_CorExeMain' in str(function.name):
return True
return False
except:
@@ -967,25 +924,23 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
pe.close()
if pe.OPTIONAL_HEADER.DATA_DIRECTORY[DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_SECURITY']].VirtualAddress == 0:
return True # 未簽名
else:
return False # 已簽名
return False # 已簽名
except:
return True # 未簽名
#定義紀錄掃描
def pyas_scan_write_en(self,file):
try:
with open('Library/PYAS/Temp/PYASV.tmp','a',encoding='utf-8') as ft:
ft.write(f'{file}\n')
self.Virus_List.append(file)
self.Virus_List_output.setStringList(self.Virus_List)
self.ui.Virus_Scan_output.setModel(self.Virus_List_output)
except Exception as e:
pyas_bug_log(e)
except:
pass
#定義讀取紀錄
def pyas_scan_read_en(self):
if os.path.isfile('Library/PYAS/Temp/PYASV.tmp'):
def pyas_scan_answer_en(self):
if self.Virus_List != []:
print('[SCAN] Malware has been detected')
self.Virus_List_output.setStringList(self.Virus_List)
self.ui.Virus_Scan_output.setModel(self.Virus_List_output)
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + self.text_Translate(" > [病毒掃描] 掃描出") + str(len(self.Virus_List)) + self.text_Translate("個病毒"))
@@ -996,37 +951,21 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.Virus_Scan_Break_Button.hide()
self.Virus_Scan = 0
self.Safe = False
print('[SCAN] Malware has been detected')
ToastNotifier().show_toast("PYAS Security",self.text_Translate("✖當前已發現惡意軟體共{}項。").format(len(self.Virus_List)),icon_path="Library/PYAS/Icon/ICON.ico",threaded=True)
return self.text_Translate("✖當前已發現惡意軟體共{}項。").format(len(self.Virus_List))
self.ui.Virus_Scan_text.setText(self.text_Translate("✖當前已發現惡意軟體共{}項。").format(len(self.Virus_List)))
else:
print('[SCAN] No malware currently found')
self.ui.Virus_Scan_Break_Button.hide()
self.ui.Virus_Scan_choose_Button.show()
self.Virus_Scan = 0
self.Safe = True
print('[SCAN] No malware currently found')
ToastNotifier().show_toast("PYAS Security",self.text_Translate('✔當前未發現惡意軟體。'),icon_path="Library/PYAS/Icon/ICON.ico",threaded=True)
return self.text_Translate('✔當前未發現惡意軟體。')
def pyas_scan_answer_en(self):
try:
self.ui.Virus_Scan_text.setText(self.pyas_scan_read_en())
with open('Library/PYAS/Temp/PYASV.tmp','r',encoding='utf-8') as ft:
self.lines = ft.readlines()
except:
pass
def pyas_del_virus_temp(self):
try:
os.remove('Library/PYAS/Temp/PYASV.tmp')
except:
pass
self.ui.Virus_Scan_text.setText(self.text_Translate('✔當前未發現惡意軟體。'))
##################################### 檔案掃描 #####################################
def File_Scan(self):
print('[SCAN] Start Scan Action (File Scan)')
self.pyas_del_virus_temp()
self.Virus_List = []
self.ui.Virus_Scan_choose_widget.hide()
self.ui.Virus_Scan_Solve_Button.hide()
@@ -1049,39 +988,29 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
rfp = ''
if self.show_virus_scan_progress_bar == 0:#確認是否高靈敏
if self.pyas_sign_start(file):#簽名檢查
if self.api_scan('md5', file) == 1:
self.pyas_scan_write_en(file)#寫入發現病毒
elif self.api_scan('md5', file) == 0:
if self.pyas_pe_start(file):
self.pyas_scan_write_en(file)#寫入發現病毒
else:
if self.pyas_scan_start(file,rfp):#MD5較驗
self.pyas_scan_write_en(file)#寫入發現病毒
elif self.pyas_pe_start(file):
self.pyas_scan_write_en(file)#寫入發現病毒
else:
if self.api_scan('md5', file) == 1:
self.pyas_scan_write_en(file)#寫入發現病毒
elif self.api_scan('md5', file) == 0:
if self.pyas_pe_start(file):
self.pyas_scan_write_en(file)#寫入發現病毒
else:
if self.pyas_scan_start(file,rfp):#MD5較驗
self.pyas_scan_write_en(file)#寫入發現病毒
elif self.pyas_pe_start(file):
self.pyas_scan_write_en(file)#寫入發現病毒
elif self.api_scan('md5', file):
self.pyas_scan_write_en(file)#寫入發現病毒
else:
if self.pyas_scan_start(file,rfp):#MD5較驗
self.pyas_scan_write_en(file)#寫入發現病毒
elif self.pyas_pe_start(file):
self.pyas_scan_write_en(file)#寫入發現病毒
elif self.api_scan('md5', file):
self.pyas_scan_write_en(file)#寫入發現病毒
self.pyas_scan_answer_en()
else:
self.ui.Virus_Scan_text.setText(self.text_Translate("請選擇掃描方式"))
except Exception as e:
pyas_bug_log(e)
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+str(e),QMessageBox.Ok)
##################################### 路徑掃描 #####################################
def Path_Scan(self):
print('[SCAN] Start Scan Action (Path Scan)')
self.pyas_del_virus_temp()
self.ui.Virus_Scan_choose_widget.hide()
self.ui.Virus_Scan_Solve_Button.hide()
self.ui.Virus_Scan_ProgressBar.hide()
@@ -1108,7 +1037,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
else:
self.ui.Virus_Scan_text.setText(self.text_Translate("請選擇掃描方式"))
except Exception as e:
pyas_bug_log(e)
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+str(e),QMessageBox.Ok)
def pyas_scan_path_en(self,path,rfp,fts):
@@ -1125,27 +1053,20 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.Virus_Scan_text.setText(self.text_Translate("正在掃描: ")+fullpath)
QApplication.processEvents()
if self.show_virus_scan_progress_bar == 0:#確認是否高靈敏
if self.api_scan('md5', fullpath) == 1:
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.api_scan('md5', fullpath) == 0:
if self.pyas_pe_start(fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
else:
if self.pyas_sign_start(fullpath):#簽名檢查
if self.pyas_scan_start(fullpath,rfp):#MD5較驗
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.pyas_pe_start(fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.api_scan('md5', fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
else:
if self.api_scan('md5', fullpath) == 1:
if self.pyas_scan_start(fullpath,rfp):#MD5較驗
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.pyas_pe_start(fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.api_scan('md5', fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.api_scan('md5', fullpath) == 0:
if self.pyas_pe_start(fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
else:
if self.pyas_scan_start(fullpath,rfp):#MD5較驗
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.pyas_pe_start(fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
except:
continue
@@ -1161,7 +1082,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
with open('Library/PYAE/Hashes/Viruslist.md5','r') as self.fp:
rfp = self.fp.read()
self.fp.close()
self.pyas_del_virus_temp()
self.Virus_Scan = 1
self.ui.Virus_Scan_Solve_Button.hide()
self.ui.Virus_Scan_ProgressBar.hide()
@@ -1179,7 +1099,6 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
pass
self.pyas_scan_answer_en()
except Exception as e:
pyas_bug_log(e)
self.ui.Virus_Scan_text.setText(self.text_Translate("請選擇掃描方式"))
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+str(e),QMessageBox.Ok)
@@ -1206,16 +1125,12 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
root, extension = os.path.splitext(fd)
if self.pyas_sign_start(fullpath) and str(extension).lower() in sflist:#簽名檢查+副檔名過濾檢測
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
if self.api_scan('md5', fullpath) == 1:
if self.pyas_scan_start(fullpath,rfp):#MD5較驗
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.pyas_pe_start(fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.api_scan('md5', fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.api_scan('md5', fullpath) == 0:
if self.pyas_pe_start(fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
else:
if self.pyas_scan_start(fullpath,rfp):#MD5較驗
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.pyas_pe_start(fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
else:
if os.path.isdir(fullpath):#資料夾 深入遍歷
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
@@ -1223,16 +1138,12 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
else:#檔案
root, extension = os.path.splitext(fd)
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
if self.api_scan('md5', fullpath) == 1:
if self.pyas_scan_start(fullpath,rfp):#MD5較驗
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.pyas_pe_start(fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.api_scan('md5', fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.api_scan('md5', fullpath) == 0:
if self.pyas_pe_start(fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
else:
if self.pyas_scan_start(fullpath,rfp):#MD5較驗
self.pyas_scan_write_en(fullpath)#寫入發現病毒
elif self.pyas_pe_start(fullpath):
self.pyas_scan_write_en(fullpath)#寫入發現病毒
except:
continue
@@ -1429,7 +1340,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
return
else:
if CMD_Command.split()[0].lower() == "/add" or CMD_Command.split()[0].lower() == "/a":
if CMD_Command.split()[1].lower() == "--library" or CMD_Command.split()[1].lower() == "-l":
if CMD_Command.split()[1].lower() == "--virus" or CMD_Command.split()[1].lower() == "-v":
if CMD_Command.split()[2].lower() == "--md5" or CMD_Command.split()[2].lower() == "-m":
try:
value = str(CMD_Command.split()[3])
@@ -1439,6 +1350,37 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
except:
self.ui.Customize_CMD_Command_output.setText("Error: Add MD5 database failed")
return
elif CMD_Command.split()[2].lower() == "--file" or CMD_Command.split()[2].lower() == "-f":
try:
file, filetype= QFileDialog.getOpenFileName(self,self.text_Translate("添加數據庫"),"C:/",'All File *.*')
if file != '':
with open('Library/PYAE/Hashes/Viruslist.md5','a') as vm:
vm.write(str(md5(open(file,'rb').read()).hexdigest())[:10]+'\n')
self.ui.Customize_CMD_Command_output.setText("Successfully added MD5 to the database!")
except:
self.ui.Customize_CMD_Command_output.setText("Error: Add MD5 database failed")
return
elif CMD_Command.split()[1].lower() == "--whitelist" or CMD_Command.split()[1].lower() == "-w":
if CMD_Command.split()[2].lower() == "--md5" or CMD_Command.split()[2].lower() == "-m":
try:
value = str(CMD_Command.split()[3])
with open('Library/PYAE/Hashes/Whitelist.md5','a') as vm:
vm.write(str(value)[:10]+'\n')
self.ui.Customize_CMD_Command_output.setText("Successfully added MD5 to the database!")
except:
self.ui.Customize_CMD_Command_output.setText("Error: Add MD5 database failed")
return
elif CMD_Command.split()[2].lower() == "--file" or CMD_Command.split()[2].lower() == "-f":
try:
file, filetype= QFileDialog.getOpenFileName(self,self.text_Translate("添加數據庫"),"C:/",'All File *.*')
if file != '':
with open('Library/PYAE/Hashes/Whitelist.md5','a') as vm:
vm.write(str(md5(open(file,'rb').read()).hexdigest())[:10]+'\n')
self.ui.Customize_CMD_Command_output.setText("Successfully added MD5 to the database!")
except Exception as e:
print(e)
self.ui.Customize_CMD_Command_output.setText("Error: Add MD5 database failed")
return
else:
try:
si = subprocess.STARTUPINFO()
@@ -1612,6 +1554,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
def Process_list(self):
try:
self.Process_quantity = []
self.Process_list_app = []
self.Process_list_app_exe = []
self.Process_list_app_pid = []
@@ -1715,95 +1658,77 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
##################################### 實時防護 #####################################
def protect_threading_init_zh(self):
pyasp_remove()
self.Virus_Scan = 0
self.ui.State_output.clear()
if self.ui.Protection_switch_Button.text() == self.text_Translate("已開啟"):
pyasp_remove()
self.ui.Protection_switch_Button.setText(self.text_Translate("已關閉"))
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);}""")
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + self.text_Translate(' > [提示] 尚未啟用實時防護'))
QApplication.processEvents()
elif self.ui.Protection_switch_Button.text() == self.text_Translate("已开启"):
self.ui.Protection_switch_Button.setText(self.text_Translate("已关闭"))
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);}""")
self.ui.State_output.append(str(time.strftime('%Y/%m/%d %H:%M:%S')) + self.text_Translate(' > [提示] 尚未启用实时防护'))
QApplication.processEvents()
else:
if pyas_key():
self.ui.Protection_illustrate.setText(self.text_Translate("正在初始化中,請稍後..."))
QApplication.processEvents()
Thread(target = self.pyas_protect_init_zh).start()
else:
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+self.text_Translate('安全密鑰錯誤'),QMessageBox.Ok)
self.ui.Protection_illustrate.setText(self.text_Translate("正在初始化中,請稍後..."))
QApplication.processEvents()
Thread(target = self.pyas_protect_init_zh).start()
def pyas_protect_repair(self):
rp_reg = False
try:
key = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER,'SOFTWARE\Policies\Microsoft\Windows\System',0,win32con.KEY_ALL_ACCESS)
except:
key = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER,'SOFTWARE\Policies\Microsoft\Windows',0,win32con.KEY_ALL_ACCESS)
win32api.RegCreateKey(key,'System')
key = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER,'SOFTWARE\Policies\Microsoft\Windows\System',0,win32con.KEY_ALL_ACCESS)
try:
win32api.RegDeleteValue(key, 'DisableCMD')
rp_reg = True
except:
pass
win32api.RegCloseKey(key)
try:
key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE,'SOFTWARE\Policies\Microsoft\Windows\System',0,win32con.KEY_ALL_ACCESS)
except:
key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE,'SOFTWARE\Policies\Microsoft\Windows',0,win32con.KEY_ALL_ACCESS)
win32api.RegCreateKey(key,'System')
key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE,'SOFTWARE\Policies\Microsoft\Windows\System',0,win32con.KEY_ALL_ACCESS)
try:
win32api.RegDeleteValue(key, 'DisableCMD')
rp_reg = True
except:
pass
win32api.RegCloseKey(key)
return rp_reg
def pyas_protect_init_zh(self):
try:
print('[INFO] Start Action (Real-time Protect)')
with open('Library/PYAS/Temp/PYASP.tmp','w',encoding='utf-8') as ft:
ft.write('Protect temp file, dont remove it')
self.Virus_Scan = 1
print('[INFO] Start Action (Real-time Protect)')
if self.ui.Protection_switch_Button.text() == self.text_Translate("已關閉"):
self.ui.Protection_illustrate.setText(self.text_Translate("啟用該選項可以實時監控進程中的惡意軟體並清除。"))
self.ui.Protection_switch_Button.setText(self.text_Translate("已開啟"))
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);}""")
if self.ui.Protection_switch_Button.text() == self.text_Translate("已关闭"):
self.ui.Protection_illustrate.setText(self.text_Translate("啟用該選項可以實時監控進程中的惡意軟體並清除。"))
self.ui.Protection_switch_Button.setText(self.text_Translate("已开启"))
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);}""")
while os.path.isfile('Library/PYAS/Temp/PYASP.tmp'):
for p in psutil.process_iter():
try:
time.sleep(0.0001)
time.sleep(0.00001)
QApplication.processEvents()
file = str(p.exe())
if '' == file or ':\Windows' in file or ':\Program' in file or 'AppData' in file:
pass
elif 'mem' in file.lower() or 'Registry' in file or 'PYAS' in file:
pass
else:
if self.pyas_sign_start(file):
if subprocess.call('taskkill /f /im "'+str(p.name())+'" /t',shell=True) == 0:
print('[INFO] Malware blocking success: '+str(p.name()))
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 成功攔截了一個惡意軟體:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()))
ToastNotifier().show_toast("PYAS Security",self.text_Translate('{} > [實時防護] 成功攔截了一個惡意軟體:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()),icon_path="Library/PYAS/Icon/ICON.ico",threaded=True)
else:
rp_reg = False
try:
key = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER,'SOFTWARE\Policies\Microsoft\Windows\System',0,win32con.KEY_ALL_ACCESS)
except:
key = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER,'SOFTWARE\Policies\Microsoft\Windows',0,win32con.KEY_ALL_ACCESS)
win32api.RegCreateKey(key,'System')
key = win32api.RegOpenKey(win32con.HKEY_CURRENT_USER,'SOFTWARE\Policies\Microsoft\Windows\System',0,win32con.KEY_ALL_ACCESS)
try:
win32api.RegDeleteValue(key, 'DisableCMD')
rp_reg = True
except:
pass
win32api.RegCloseKey(key)
try:
key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE,'SOFTWARE\Policies\Microsoft\Windows\System',0,win32con.KEY_ALL_ACCESS)
except:
key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE,'SOFTWARE\Policies\Microsoft\Windows',0,win32con.KEY_ALL_ACCESS)
win32api.RegCreateKey(key,'System')
key = win32api.RegOpenKey(win32con.HKEY_LOCAL_MACHINE,'SOFTWARE\Policies\Microsoft\Windows\System',0,win32con.KEY_ALL_ACCESS)
try:
win32api.RegDeleteValue(key, 'DisableCMD')
rp_reg = True
except:
pass
win32api.RegCloseKey(key)
if rp_reg == False:
print(f'[INFO] Malware blocking failed: {p.name()}')
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 惡意軟體攔截失敗:').format(time.strftime('%Y/%m/%d %H:%M:%S'))+str(p.name()))
ToastNotifier().show_toast("PYAS Security",self.text_Translate('{} > [實時防護] 惡意軟體攔截失敗:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()),icon_path="Library/PYAS/Icon/ICON.ico",threaded=True)
if '' == file or ':\Windows' in file or ':\Program' in file or ':\XboxGames' in file or 'mem' in file.lower() or 'Registry' in file or 'PYAS' in file or 'AppData' in file:
continue
elif self.pyas_sign_start(file) or self.api_scan('md5', file):
if subprocess.call('taskkill /f /im "'+str(p.name())+'" /t',shell=True) == 0:
print('[INFO] Malware blocking success: '+str(p.name()))
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 成功攔截了一個惡意軟體:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()))
ToastNotifier().show_toast("PYAS Security",self.text_Translate('{} > [實時防護] 成功攔截了一個惡意軟體:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()),icon_path="Library/PYAS/Icon/ICON.ico",threaded=True)
else:
if not self.pyas_protect_repair():
print(f'[INFO] Malware blocking failed: {p.name()}')
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 惡意軟體攔截失敗:').format(time.strftime('%Y/%m/%d %H:%M:%S'))+str(p.name()))
ToastNotifier().show_toast("PYAS Security",self.text_Translate('{} > [實時防護] 惡意軟體攔截失敗:').format(str(time.strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()),icon_path="Library/PYAS/Icon/ICON.ico",threaded=True)
except:
continue
except Exception as e:
@@ -1869,24 +1794,25 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
def Change_language(self):
try:
self.ui.State_output.clear()
if self.ui.Language_Traditional_Chinese.isChecked():
self.lang_init_zh_tw()
self.pyasConfig['language'] = "zh_TW"
self.writeConfig(self.pyasConfig)
self.lang_init_zh_tw()
elif self.ui.Language_Simplified_Chinese.isChecked():
self.lang_init_zh_cn()
self.pyasConfig['language'] = "zh_CN"
self.writeConfig(self.pyasConfig)
self.lang_init_zh_cn()
else:
self.lang_init_en()
self.pyasConfig['language'] = "english"
self.writeConfig(self.pyasConfig)
self.lang_init_en()
except Exception as e:
pyas_bug_log(e)
##################################### 主題顏色 #####################################
def Change_Theme(self):#UPDhere
def Change_Theme(self):
if self.ui.Theme_Red.isChecked():
self.ui.Window_widget.setStyleSheet("""QWidget#Window_widget {background-color:rgba(255,140,140,200);}""")
self.ui.Navigation_Bar.setStyleSheet("""QWidget#Navigation_Bar {background-color:rgba(255,130,130,200);}""")
@@ -1964,16 +1890,16 @@ class MainWindow_Controller(QtWidgets.QMainWindow):
self.ui.pyas_opacity -= 1
window.setWindowOpacity(self.ui.pyas_opacity/100)
QApplication.processEvents()
window.hide()
##################################### 主初始化 #####################################
if __name__ == '__main__':
try:
pyas_library()
pyasp_remove()
pyasb_remove()
pyas_version = "2.5.9"
pyae_version = "2.2.3"
pyasp_remove()
pyas_version, pyae_version = "2.6.0", "2.2.4"
QtCore.QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)# 自適應窗口縮放
QtGui.QGuiApplication.setAttribute(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)# 自適應窗口縮放
app = QtWidgets.QApplication(sys.argv)
@@ -1984,7 +1910,6 @@ if __name__ == '__main__':
window.setWindowOpacity(i/100)
QApplication.processEvents()
print(f'[INFO] PYAS V{pyas_version} , PYAE V{pyae_version}')
print(f'[LOAD] Process Time: {time.process_time()-start_m} sec')
sys.exit(app.exec_())
except Exception as e:
pyas_bug_log(e)
+16
View File
@@ -0,0 +1,16 @@
import requests
def scan(types,text):
response = requests.get("https://api.pyas.cf/pyas", params={types: text})
if response.status_code == 200:
if response.text == "True":
return True
else:
return False
else:
return response.status_code
print(scan("md5","<md5 hashes>"))
# https://api.pyas.cf/pyas?md5=<md5 hashes>
# return string True, False
+4 -6
View File
@@ -5,17 +5,14 @@ english_list = {
"已开启":"On",
"已关闭":"Off",
"正在刪除: ":"Deleting: ",
"正在删除":"Deleting: ",
"正在删除: ":"Deleting: ",
"存取被拒":"Access denied",
"添加數據庫":"Add database",
"安全密鑰錯誤":"Security Key Error",
"安全密钥错误":"Security Key Error",
"存取被拒":"Access denied",
" > [提示] 尚未啟用實時防護":" > [Tips] Real-time Protect is not enabled",
" > [提示] 尚未启用实时防护":" > [Tips] Real-time Protect is not enabled",
" > [行為防護] 成功攔截了惡意檔案創建行為。":" > [Behavior Protection] Successfully blocked malicious file creation behavior.",
" 被移動":" Moved",
" 被創建":" Created",
" 被刪除":" Deleted",
" 被編輯":" Edited",
"請輸入需要尋找的檔案":"Please enter the file you want to find",
"请输入需要寻找的档案":"Please enter the file you want to find",
"✔成功: 已執行成功。":"✔Success: Executed successfully.",
@@ -85,6 +82,7 @@ english_list = {
"啟用該選項可以提高掃描靈敏度,但這也可能會造成誤殺。":"Enable this option can improve scanning sensitivity, but it can also cause manslaughter.",
"启用该选项可以提高扫描灵敏度,但这也可能会造成误杀。":"Enable this option can improve scanning sensitivity, but it can also cause manslaughter.",
'{} > [實時防護] 成功攔截了一個惡意軟體:':'{} > [Real-Time Protect] Malware blocking success:',
'{} > [實時防護] 成功攔截了一個惡意行為:':'{} > [Real-Time Protect] Action blocking success:',
'{} > [實時防護] 惡意軟體攔截失敗:':'{} > [Real-Time Protect] Malware blocking failed:',
'{} > [實時防護] 正在檢測檔案安全性:':'{} > [Real-time Protect] Checking file security:',
'{} > [實時防護] 未檢測到可疑檔案:':'{} > [Real-time Protect] No suspicious files detected:',
+1 -1
View File
@@ -1,7 +1,7 @@
import pyinstaller_versionfile
pyinstaller_versionfile.create_versionfile(
output_file="versionfile.txt",
version='2.5.9',
version='2.6.0',
company_name="PYAS Security",
file_description="Python Antivirus Software",
internal_name="PYAS",
-13
View File
@@ -1,13 +0,0 @@
import requests
def api_scan(types,text):
response = requests.get("http://27.147.30.238:5001/pyas", params={types: text})
if response.status_code == 200:
return response.text
else:
return response.status_code
print(scan("md5","<md5 hashes>"))
# http://27.147.30.238:5001/pyas?md5=<md5 hashes>
# return string True, False
+1 -1
View File
@@ -1,5 +1,5 @@
# PYAS (Python Antivirus Software)
PYAS is not only free and open source without ads, A large number of offline databases are also built in, Always protect the privacy and data security of users.
PYAS is not only free and open source without ads,Also uses multiple intelligent protection engines,Always protect the privacy and data security of users.
![PYAS](https://user-images.githubusercontent.com/85057800/202692146-e55848d5-7e24-405d-b33d-f4fa3883fba6.png)