|
|
|
@@ -5,7 +5,7 @@
|
|
|
|
|
# PYAS Web: https://pyantivirus.wixsite.com/pyas
|
|
|
|
|
#
|
|
|
|
|
# PYAS is managed by PYDT (Python Development Team)
|
|
|
|
|
# Copyright© 2022 87owo (PYAS Security)
|
|
|
|
|
# Copyright© 2020-2022 87owo (PYAS Security)
|
|
|
|
|
####################################################################################
|
|
|
|
|
#
|
|
|
|
|
###################################### 錯誤日誌 #####################################
|
|
|
|
@@ -24,7 +24,7 @@ def pyas_bug_log(e):
|
|
|
|
|
try:
|
|
|
|
|
import time
|
|
|
|
|
start_m = time.time()
|
|
|
|
|
import os, sys, psutil, subprocess, cryptocode, threading, configparser, datetime
|
|
|
|
|
import os, sys, psutil, subprocess, threading, configparser, datetime
|
|
|
|
|
from pefile import PE, DIRECTORY_ENTRY
|
|
|
|
|
from hashlib import md5, sha1, sha256
|
|
|
|
|
from PYAS_English import english_list
|
|
|
|
@@ -39,38 +39,20 @@ except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
print('[LOAD] Mods: '+str(time.time()-start_m)+' sec')
|
|
|
|
|
|
|
|
|
|
###################################### 密鑰認證 #####################################
|
|
|
|
|
##################################### 移除暫存檔 ####################################
|
|
|
|
|
|
|
|
|
|
def pyas_key():
|
|
|
|
|
start = time.time()
|
|
|
|
|
def pyasb_remove():
|
|
|
|
|
try:
|
|
|
|
|
try:
|
|
|
|
|
with open('PYAS.exe',"rb") as f:
|
|
|
|
|
bytes = f.read()
|
|
|
|
|
readable_hash = str(md5(bytes).hexdigest())
|
|
|
|
|
f.close()
|
|
|
|
|
except:
|
|
|
|
|
with open('PYAS.py',"rb") as f:
|
|
|
|
|
bytes = f.read()
|
|
|
|
|
readable_hash = str(md5(bytes).hexdigest())
|
|
|
|
|
f.close()
|
|
|
|
|
try:
|
|
|
|
|
ft = open('Library/PYAS/Setup/PYAS.key','r')
|
|
|
|
|
fe = ft.read()
|
|
|
|
|
ft.close()
|
|
|
|
|
if fe == readable_hash:
|
|
|
|
|
print('[LOAD] Key: '+str(time.time()-start)+' sec')
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
print('[LOAD] Key: '+str(time.time()-start)+' sec')
|
|
|
|
|
return False
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
print('[LOAD] Key: '+str(time.time()-start)+' sec')
|
|
|
|
|
return False
|
|
|
|
|
os.remove('Library/PYAS/Temp/PYASB.log')
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def pyasp_remove():
|
|
|
|
|
try:
|
|
|
|
|
os.remove('Library/PYAS/Temp/PYASP.tmp')
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
##################################### 資料庫檢查 ####################################
|
|
|
|
|
|
|
|
|
|
def pyas_library():
|
|
|
|
@@ -91,20 +73,6 @@ def pyas_library():
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
##################################### 移除暫存檔 ####################################
|
|
|
|
|
|
|
|
|
|
def pyasb_remove():
|
|
|
|
|
try:
|
|
|
|
|
os.remove('Library/PYAS/Temp/PYASB.log')
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def pyasp_remove():
|
|
|
|
|
try:
|
|
|
|
|
os.remove('Library/PYAS/Temp/PYASP.tmp')
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
##################################### 更新資料庫 ####################################
|
|
|
|
|
|
|
|
|
|
def pyas_vl_update():
|
|
|
|
@@ -150,6 +118,41 @@ def pyas_vl_update():
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
sys.exit()
|
|
|
|
|
|
|
|
|
|
###################################### 密鑰認證 #####################################
|
|
|
|
|
|
|
|
|
|
def pyas_key():
|
|
|
|
|
start = time.time()
|
|
|
|
|
try:
|
|
|
|
|
if os.path.isfile('Library/PYAS/Setup/PYAS.key'):
|
|
|
|
|
try:
|
|
|
|
|
with open('PYAS.exe',"rb") as f:
|
|
|
|
|
bytes = f.read()
|
|
|
|
|
readable_hash = str(md5(bytes).hexdigest())
|
|
|
|
|
f.close()
|
|
|
|
|
except:
|
|
|
|
|
with open('PYAS.py',"rb") as f:
|
|
|
|
|
bytes = f.read()
|
|
|
|
|
readable_hash = str(md5(bytes).hexdigest())
|
|
|
|
|
f.close()
|
|
|
|
|
try:
|
|
|
|
|
ft = open('Library/PYAS/Setup/PYAS.key','r')
|
|
|
|
|
fe = ft.read()
|
|
|
|
|
ft.close()
|
|
|
|
|
if fe == readable_hash:
|
|
|
|
|
print('[LOAD] Key: '+str(time.time()-start)+' sec')
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
print('[LOAD] Key: '+str(time.time()-start)+' sec')
|
|
|
|
|
return False
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
except Exception as e:
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
print('[LOAD] Key: '+str(time.time()-start)+' sec')
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
###################################### 主要程式 #####################################
|
|
|
|
|
|
|
|
|
|
class MainWindow_Controller(QtWidgets.QMainWindow):#,FileSystemEventHandler):
|
|
|
|
@@ -326,7 +329,7 @@ class MainWindow_Controller(QtWidgets.QMainWindow):#,FileSystemEventHandler):
|
|
|
|
|
|
|
|
|
|
###################################### 許可條款 #####################################
|
|
|
|
|
|
|
|
|
|
self.ui.License_terms.setText('''Copyright (C) 2022 87owo (PYAS Security)
|
|
|
|
|
self.ui.License_terms.setText('''Copyright (C) 2020-2022 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 in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
|
|
@@ -347,7 +350,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
self.effect_shadow3.setColor(QtCore.Qt.gray)
|
|
|
|
|
self.ui.Window_widget.setGraphicsEffect(self.effect_shadow3)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.ui.Virus_Scan_choose_widget.hide()#hide()函數的用意是隱藏物件
|
|
|
|
|
self.ui.Virus_Scan_widget.hide()
|
|
|
|
|
self.ui.Tools_widget.hide()
|
|
|
|
@@ -402,11 +404,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V"+pyas_version))
|
|
|
|
|
now_time = datetime.datetime.now()
|
|
|
|
|
try:
|
|
|
|
|
ft = open('Library/PYAS/Temp/PYASP.tmp','r',encoding='utf-8')
|
|
|
|
|
fe = ft.read()
|
|
|
|
|
ft.close()
|
|
|
|
|
except:
|
|
|
|
|
if not os.path.isfile('Library/PYAS/Temp/PYASP.tmp'):
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [Tips] Real-time Protect is not enabled')
|
|
|
|
|
else:
|
|
|
|
@@ -494,7 +492,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
cy = datetime.datetime.now().strftime('%Y')
|
|
|
|
|
if int(cy) < 2020:
|
|
|
|
|
cy = str('2020')
|
|
|
|
|
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", "Copyright© "+str(cy)+" 87owo (PYAS Security)"))
|
|
|
|
|
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", "Copyright© 2020-"+str(cy)+" 87owo (PYAS Security)"))
|
|
|
|
|
try:
|
|
|
|
|
vl = open('Library/PYAE/Hashes/Viruslist.num','r').read()
|
|
|
|
|
if int(vl)-1 < 0:
|
|
|
|
@@ -545,11 +543,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V"+pyas_version))
|
|
|
|
|
now_time = datetime.datetime.now()
|
|
|
|
|
try:
|
|
|
|
|
ft = open('Library/PYAS/Temp/PYASP.tmp','r',encoding='utf-8')
|
|
|
|
|
fe = ft.read()
|
|
|
|
|
ft.close()
|
|
|
|
|
except:
|
|
|
|
|
if not os.path.isfile('Library/PYAS/Temp/PYASP.tmp'):
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [提示] 尚未启用实时防护')
|
|
|
|
|
else:
|
|
|
|
@@ -590,7 +584,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
self.ui.System_Process_Manage_Button.setText(_translate("MainWindow", "系统进程管理"))
|
|
|
|
|
self.ui.Repair_System_Permission_Button.setText(_translate("MainWindow", "修复系统权限"))
|
|
|
|
|
self.ui.Repair_System_Files_Button.setText(_translate("MainWindow", "修复系统档案"))
|
|
|
|
|
self.ui.Clean_System_Files_Button.setText(_translate("MainWindow", "清理系统档案"))
|
|
|
|
|
self.ui.Clean_System_Files_Button.setText(_translate("MainWindow", "清理系统垃圾"))
|
|
|
|
|
self.ui.Enable_Safe_Mode_Button.setText(_translate("MainWindow", "启动安全模式"))
|
|
|
|
|
self.ui.Disable_Safe_Mode_Button.setText(_translate("MainWindow", "关闭安全模式"))
|
|
|
|
|
self.ui.System_Info_Button.setText(_translate("MainWindow", "系统版本资讯"))
|
|
|
|
@@ -637,7 +631,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
cy = datetime.datetime.now().strftime('%Y')
|
|
|
|
|
if int(cy) < 2020:
|
|
|
|
|
cy = str('2020')
|
|
|
|
|
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", "Copyright© "+str(cy)+" 87owo (PYAS Security)"))
|
|
|
|
|
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", "Copyright© 2020-"+str(cy)+" 87owo (PYAS Security)"))
|
|
|
|
|
try:
|
|
|
|
|
vl = open('Library/PYAE/Hashes/Viruslist.num','r').read()
|
|
|
|
|
if int(vl)-1 < 0:
|
|
|
|
@@ -688,11 +682,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V"+pyas_version))
|
|
|
|
|
now_time = datetime.datetime.now()
|
|
|
|
|
try:
|
|
|
|
|
ft = open('Library/PYAS/Temp/PYASP.tmp','r',encoding='utf-8')
|
|
|
|
|
fe = ft.read()
|
|
|
|
|
ft.close()
|
|
|
|
|
except:
|
|
|
|
|
if not os.path.isfile('Library/PYAS/Temp/PYASP.tmp'):
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [提示] 尚未啟用實時防護')
|
|
|
|
|
else:
|
|
|
|
@@ -733,7 +723,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
self.ui.System_Process_Manage_Button.setText(_translate("MainWindow", "系統進程管理"))
|
|
|
|
|
self.ui.Repair_System_Permission_Button.setText(_translate("MainWindow", "修復系統權限"))
|
|
|
|
|
self.ui.Repair_System_Files_Button.setText(_translate("MainWindow", "修復系統檔案"))
|
|
|
|
|
self.ui.Clean_System_Files_Button.setText(_translate("MainWindow", "清理系統檔案"))
|
|
|
|
|
self.ui.Clean_System_Files_Button.setText(_translate("MainWindow", "清理系統垃圾"))
|
|
|
|
|
self.ui.Enable_Safe_Mode_Button.setText(_translate("MainWindow", "啟動安全模式"))
|
|
|
|
|
self.ui.Disable_Safe_Mode_Button.setText(_translate("MainWindow", "關閉安全模式"))
|
|
|
|
|
self.ui.System_Info_Button.setText(_translate("MainWindow", "系統版本資訊"))
|
|
|
|
@@ -780,7 +770,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
cy = datetime.datetime.now().strftime('%Y')
|
|
|
|
|
if int(cy) < 2020:
|
|
|
|
|
cy = str('2020')
|
|
|
|
|
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", "Copyright© "+str(cy)+" 87owo (PYAS Security)"))
|
|
|
|
|
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", "Copyright© 2020-"+str(cy)+" 87owo (PYAS Security)"))
|
|
|
|
|
try:
|
|
|
|
|
vl = open('Library/PYAE/Hashes/Viruslist.num','r').read()
|
|
|
|
|
if int(vl)-1 < 0:
|
|
|
|
@@ -840,6 +830,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
text = text.replace("軟體","软件")
|
|
|
|
|
text = text.replace("惡意","恶意")
|
|
|
|
|
text = text.replace("設定","设置")
|
|
|
|
|
text = text.replace("密鑰","密钥")
|
|
|
|
|
text = text.replace("關於","关于")
|
|
|
|
|
text = text.replace("當前","当前")
|
|
|
|
|
text = text.replace("確定","确定")
|
|
|
|
@@ -1064,7 +1055,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
def Virus_Solve(self):
|
|
|
|
|
try:
|
|
|
|
|
for line in self.Virus_List:
|
|
|
|
|
if 'C:/Windows' in str(line):
|
|
|
|
|
if 'C:/Windows' in str(line) or 'Dev-Cpp' in str(line) or 'Opengl' in str(line):
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
self.ui.Virus_Scan_text.setText(self.text_Translate('正在刪除: ')+str(line))
|
|
|
|
@@ -1202,13 +1193,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
try:
|
|
|
|
|
print('[INFO] Reading Viruslist Database')
|
|
|
|
|
with open('Library/PYAE/Hashes/Viruslist.md5','r') as fp:
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
with open('Library/PYAE/Hashes/Viruslist.md5','r') as fp:
|
|
|
|
|
rfp = fp.read()
|
|
|
|
|
fp.close()
|
|
|
|
|
if self.show_virus_scan_progress_bar != 0:
|
|
|
|
|
with open('Library/PYAE/Function/Viruslist.func','r') as fn:
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
rfn = fn.read()
|
|
|
|
|
fn.close()
|
|
|
|
|
else:
|
|
|
|
@@ -1224,11 +1213,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
fts = False
|
|
|
|
|
try:
|
|
|
|
|
if self.pyas_sign_start(file):
|
|
|
|
|
pe = PE(file)
|
|
|
|
|
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
|
|
|
|
for function in entry.imports:
|
|
|
|
|
if fts != True:
|
|
|
|
|
if str(function.name.decode('utf-8')) in rfn:
|
|
|
|
|
fts = True
|
|
|
|
|
pe.close()
|
|
|
|
|
if fts:
|
|
|
|
|
self.pyas_scan_write_en(file)
|
|
|
|
|
fts = False
|
|
|
|
@@ -1268,12 +1259,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
if self.pyas_scan_start(fullpath,rfp):
|
|
|
|
|
self.pyas_scan_write_en(fullpath)
|
|
|
|
|
else:
|
|
|
|
|
pe = PE(fullpath,fast_load=True)
|
|
|
|
|
pe = PE(fullpath)
|
|
|
|
|
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
|
|
|
|
for function in entry.imports:
|
|
|
|
|
if fts != True:
|
|
|
|
|
if str(function.name.decode('utf-8')) in rfn:
|
|
|
|
|
fts = True
|
|
|
|
|
pe.close()
|
|
|
|
|
if fts:
|
|
|
|
|
self.pyas_scan_write_en(fullpath)
|
|
|
|
|
fts = False
|
|
|
|
@@ -1314,12 +1306,10 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
try:
|
|
|
|
|
print('[INFO] Reading Viruslist Database')
|
|
|
|
|
with open('Library/PYAE/Hashes/Viruslist.md5','r') as fp:
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
rfp = fp.read()
|
|
|
|
|
fp.close()
|
|
|
|
|
if self.show_virus_scan_progress_bar != 0:
|
|
|
|
|
with open('Library/PYAE/Function/Viruslist.func','r') as fn:
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
rfn = fn.read()
|
|
|
|
|
fn.close()
|
|
|
|
|
else:
|
|
|
|
@@ -1359,7 +1349,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
try:
|
|
|
|
|
print('[INFO] Reading Viruslist Database')
|
|
|
|
|
with open('Library/PYAE/Hashes/Viruslist.md5','r') as self.fp:
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
rfp = self.fp.read()
|
|
|
|
|
self.fp.close()
|
|
|
|
|
except Exception as e:
|
|
|
|
@@ -1410,13 +1399,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
if self.show_virus_scan_progress_bar == 0:
|
|
|
|
|
if 'C:/Windows' in fullpath or 'C:/$Recycle.Bin' in fullpath:
|
|
|
|
|
if 'C:/Windows' in fullpath or 'C:/$Recycle.Bin' in fullpath or 'AppData' in fullpath or 'C:/ProgramData' in fullpath:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
root, extension = os.path.splitext(fd)
|
|
|
|
|
sfd = str(extension).lower()
|
|
|
|
|
if 'C:/Program' in fullpath:
|
|
|
|
|
sflist = ['.exe','.dll']
|
|
|
|
|
if 'Windows' in fullpath or 'Microsoft' in fullpath:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
sflist = ['.exe','.dll']
|
|
|
|
|
else:
|
|
|
|
|
sflist = ['.exe','.dll','.com','.cmd','.bat','.vbs','.js','.scr']
|
|
|
|
|
#sflist = ['.exe','.dll','.com','.cmd','.bat','.msi','.reg',
|
|
|
|
@@ -1425,9 +1415,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
#'.ico','.jpg','.png','.wav','.ogg','.mp3','.mp4',
|
|
|
|
|
#'.zip','.7z','.rar','.gz','.tar','.wim','.iso',
|
|
|
|
|
#'.inf','.ini','.tmp','.temp','.log','.scr']
|
|
|
|
|
root, extension = os.path.splitext(fd)
|
|
|
|
|
sfd = str(extension).lower()
|
|
|
|
|
if self.pyas_sign_start(fullpath) and sfd in sflist:
|
|
|
|
|
root, extension = os.path.splitext(fd)
|
|
|
|
|
sfd = str(extension).lower()
|
|
|
|
|
if self.pyas_scan_start(fullpath,rfp):
|
|
|
|
|
self.pyas_scan_write_en(fullpath)
|
|
|
|
|
else:
|
|
|
|
@@ -1674,6 +1664,21 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
|
|
|
|
|
def Customize_CMD_Command(self):
|
|
|
|
|
CMD_Command = self.ui.Customize_CMD_Command_lineEdit.text()
|
|
|
|
|
#try: #Not Cplt
|
|
|
|
|
#if str(cryptocode.decrypt(CMD_Command,pyas_version)) == 'professional':
|
|
|
|
|
#self.ui.Window_title.setText("PYAS V"+pyas_version+' (Professional Edition)')
|
|
|
|
|
#return
|
|
|
|
|
#if str(cryptocode.decrypt(CMD_Command,pyas_version)) == 'business':
|
|
|
|
|
#self.ui.Window_title.setText("PYAS V"+pyas_version+' (Business Edition)')
|
|
|
|
|
#return
|
|
|
|
|
#if str(cryptocode.decrypt(CMD_Command,pyas_version)) == 'professional_ltsc':
|
|
|
|
|
#self.ui.Window_title.setText("PYAS V"+pyas_version+' (Professional Edition LTSC)')
|
|
|
|
|
#return
|
|
|
|
|
#if str(cryptocode.decrypt(CMD_Command,pyas_version)) == 'business_ltsc':
|
|
|
|
|
#self.ui.Window_title.setText("PYAS V"+pyas_version+' (Business Edition LTSC)')
|
|
|
|
|
#return
|
|
|
|
|
#except:
|
|
|
|
|
#pass
|
|
|
|
|
if CMD_Command == "":
|
|
|
|
|
return
|
|
|
|
|
if CMD_Command.lower() == "never gonna give you up" or CMD_Command.lower() == "rickroll" or CMD_Command.lower() == "rick roll":
|
|
|
|
@@ -1684,21 +1689,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
or CMD_Command == "PYAS" or CMD_Command == "pyas":
|
|
|
|
|
self.ui.Customize_CMD_Command_output.setText(english_list["PYAS"])#about pyas
|
|
|
|
|
return
|
|
|
|
|
try: #Not Cplt
|
|
|
|
|
if str(cryptocode.decrypt(CMD_Command,pyas_version)) == 'professional':
|
|
|
|
|
self.ui.Window_title.setText("PYAS V"+pyas_version+' (Professional Edition)')
|
|
|
|
|
return
|
|
|
|
|
if str(cryptocode.decrypt(CMD_Command,pyas_version)) == 'business':
|
|
|
|
|
self.ui.Window_title.setText("PYAS V"+pyas_version+' (Business Edition)')
|
|
|
|
|
return
|
|
|
|
|
if str(cryptocode.decrypt(CMD_Command,pyas_version)) == 'professional_ltsc':
|
|
|
|
|
self.ui.Window_title.setText("PYAS V"+pyas_version+' (Professional Edition LTSC)')
|
|
|
|
|
return
|
|
|
|
|
if str(cryptocode.decrypt(CMD_Command,pyas_version)) == 'business_ltsc':
|
|
|
|
|
self.ui.Window_title.setText("PYAS V"+pyas_version+' (Business Edition LTSC)')
|
|
|
|
|
return
|
|
|
|
|
except:
|
|
|
|
|
pass
|
|
|
|
|
try:
|
|
|
|
|
if CMD_Command.split()[0].lower() == "/add" or CMD_Command.split()[0].lower() == "/a":
|
|
|
|
|
self.ui.Customize_CMD_Command_output.setText("Tips: Custom rules need to wait for the rule conditions to be met before proceeding to the next step.")
|
|
|
|
@@ -1738,6 +1728,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
value = CMD_Command.split()[3]
|
|
|
|
|
while 1:
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
time.sleep(0.0001)
|
|
|
|
|
for p in psutil.process_iter():
|
|
|
|
|
if str(value) == str(p.name()):
|
|
|
|
|
return
|
|
|
|
@@ -1749,7 +1740,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
try:
|
|
|
|
|
si = subprocess.STARTUPINFO()
|
|
|
|
|
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
|
|
|
|
p = subprocess.Popen(CMD_Command,stdin=subprocess.PIPE,stdout=subprocess.PIPE,)#encoding='utf-8')
|
|
|
|
|
p = subprocess.Popen(CMD_Command,stdin=subprocess.PIPE,stdout=subprocess.PIPE)
|
|
|
|
|
out = p.stdout.read()
|
|
|
|
|
try:
|
|
|
|
|
self.ui.Customize_CMD_Command_output.setText(str(out.decode('utf-8')))
|
|
|
|
@@ -1795,7 +1786,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
if button == self.ui.Analyze_EXE_Funtion_Button:
|
|
|
|
|
file, filetype= QFileDialog.getOpenFileName(self,self.text_Translate("分析文件函數"),"C:/",'EXE OR DLL File *.exe *.dll')
|
|
|
|
|
if file != '':
|
|
|
|
|
pe = PE(file,fast_load=True)
|
|
|
|
|
pe = PE(file)
|
|
|
|
|
self.ui.Analyze_EXE_Output.setText("")
|
|
|
|
|
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
|
|
|
|
for function in entry.imports:
|
|
|
|
@@ -1902,8 +1893,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
try:
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
fullpath = os.path.join(path,fd)
|
|
|
|
|
if 'C:/Windows' in fullpath or 'AppData' in fullpath or 'PerfLogs' in fullpath:
|
|
|
|
|
if 'C:/Windows' in fullpath or 'C:/$Recycle.Bin' in fullpath or 'C:/ProgramData' in fullpath or 'AppData' in fullpath or 'PerfLogs' in fullpath:
|
|
|
|
|
pass
|
|
|
|
|
elif 'C:/Program' in fullpath:
|
|
|
|
|
if 'Windows' in fullpath or 'Microsoft' in fullpath:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
if os.path.isdir(fullpath):
|
|
|
|
|
self.findfile_zh(fullpath,ffile,start)
|
|
|
|
@@ -1966,9 +1960,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
self.decrypt_zh(input_text,password)
|
|
|
|
|
|
|
|
|
|
def encrypt_zh(self,e,e2):
|
|
|
|
|
import cryptocode
|
|
|
|
|
self.ui.Encryption_Text_output.setText(str(cryptocode.encrypt(e,e2)))
|
|
|
|
|
|
|
|
|
|
def decrypt_zh(self,e,e2):
|
|
|
|
|
import cryptocode
|
|
|
|
|
self.ui.Encryption_Text_output.setText(str(cryptocode.decrypt(e,e2)))
|
|
|
|
|
|
|
|
|
|
def Change_Users_Password(self):
|
|
|
|
@@ -2063,11 +2059,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
self.pause = True
|
|
|
|
|
else:
|
|
|
|
|
try:
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Protection_illustrate.setText(self.text_Translate("正在初始化中,請稍後..."))
|
|
|
|
|
self.pause = False
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
threading.Thread(target = self.pyas_protect_init_zh).start()
|
|
|
|
|
if pyas_key():
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Protection_illustrate.setText(self.text_Translate("正在初始化中,請稍後..."))
|
|
|
|
|
self.pause = False
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
threading.Thread(target = self.pyas_protect_init_zh).start()
|
|
|
|
|
else:
|
|
|
|
|
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+self.text_Translate('安全密鑰錯誤'),QMessageBox.Ok)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate('錯誤: ')+str(e),QMessageBox.Ok)
|
|
|
|
|
|
|
|
|
@@ -2114,17 +2113,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
self.Virus_Scan = 1
|
|
|
|
|
#print('[INFO] Real-time Protect Process Refresh')
|
|
|
|
|
for p in psutil.process_iter():
|
|
|
|
|
try:
|
|
|
|
|
time.sleep(0.0001)
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
file = str(p.exe())
|
|
|
|
|
if '' == file or 'C:\Windows' in file or 'AppData' in file or 'C:\Program' in file or 'MemCompression' in file or 'Registry' in file:
|
|
|
|
|
time.sleep(0.0001)
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
if '' == file or 'C:\Windows' in file or 'C:\Program' in file or 'AppData' in file or 'MemCompression' in file or 'Registry' in file:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
if self.pyas_sign_start(file) and 'PYAS.exe' not in file:
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
try:
|
|
|
|
|
if subprocess.call('taskkill /f /im "'+str(p.name())+'" /t',shell=True) == 0:
|
|
|
|
|
print('[INFO] Malware blocking success: '+str(p.name()))
|
|
|
|
@@ -2388,11 +2385,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
try:
|
|
|
|
|
pyas_library()
|
|
|
|
|
pyasb_remove()
|
|
|
|
|
pyasp_remove()
|
|
|
|
|
pyas_library()
|
|
|
|
|
pyas_version = "2.4.9"
|
|
|
|
|
pyae_version = "2.2.0"
|
|
|
|
|
pyas_version = "2.5.0"
|
|
|
|
|
pyae_version = "2.2.1"
|
|
|
|
|
threading.Thread(target = pyas_vl_update).start()
|
|
|
|
|
QtCore.QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)# 自適應窗口縮放
|
|
|
|
|
QtGui.QGuiApplication.setAttribute(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)# 自適應窗口縮放
|
|
|
|
@@ -2407,4 +2404,4 @@ if __name__ == '__main__':
|
|
|
|
|
pyas_bug_log(e)
|
|
|
|
|
|
|
|
|
|
####################################################################################
|
|
|
|
|
#Copyright© 2022 87owo (PYAS Security)
|
|
|
|
|
#Copyright© 2020-2022 87owo (PYAS Security)
|