|
|
|
@@ -28,6 +28,7 @@ try:
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print('Error: '+str(e))
|
|
|
|
|
print('Loading mods: '+str(time.time()-start)+' sec')
|
|
|
|
|
#print(str(sys.argv))
|
|
|
|
|
|
|
|
|
|
def pyas_key():
|
|
|
|
|
start = time.time()
|
|
|
|
@@ -321,13 +322,20 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
def lang_init_en(self):
|
|
|
|
|
start = time.time()
|
|
|
|
|
_translate = QtCore.QCoreApplication.translate
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append("[Tips] Real-time Protect is not enabled")
|
|
|
|
|
if pyas_key():
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.0"))
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.2"))
|
|
|
|
|
now_time = datetime.datetime.now()
|
|
|
|
|
try:
|
|
|
|
|
ft = open('Library/PYAS/Temp/PYASP.tmp','r',encoding='utf-8')
|
|
|
|
|
fe = ft.read()
|
|
|
|
|
ft.close()
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print('Error: '+str(e))
|
|
|
|
|
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:
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.0 (Security Key Error)"))
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.2 (Security Key Error)"))
|
|
|
|
|
now_time = datetime.datetime.now()
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [Warning] PYAS Security Key Error')
|
|
|
|
@@ -389,7 +397,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
self.ui.System_Info_Back.setText(_translate("MainWindow", "Back"))
|
|
|
|
|
self.ui.Customize_CMD_Command_Back.setText(_translate("MainWindow", "Back"))
|
|
|
|
|
self.ui.Customize_CMD_Command_Run_Button.setText(_translate("MainWindow", "Run"))
|
|
|
|
|
self.ui.Customize_CMD_Command_output_title.setText(_translate("MainWindow", "Output (Does Not Support Chinese):"))
|
|
|
|
|
self.ui.Customize_CMD_Command_output_title.setText(_translate("MainWindow", "Output:"))
|
|
|
|
|
self.ui.Analyze_EXE_Back.setText(_translate("MainWindow", "Back"))
|
|
|
|
|
self.ui.Look_for_File_Back.setText(_translate("MainWindow", "Back"))
|
|
|
|
|
self.ui.Look_for_File_Run_Button.setText(_translate("MainWindow", "Find file"))
|
|
|
|
@@ -400,7 +408,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
self.ui.Encryption_Text_title.setText(_translate("MainWindow", "Before Encrypt & Decrypt"))
|
|
|
|
|
self.ui.Decrypt_Text_Run_Button.setText(_translate("MainWindow", "Encrypt"))
|
|
|
|
|
self.ui.About_Back.setText(_translate("MainWindow", "Back"))
|
|
|
|
|
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.4.0"))
|
|
|
|
|
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.4.2"))
|
|
|
|
|
self.ui.GUI_Made_title.setText(_translate("MainWindow", "GUI Make:"))
|
|
|
|
|
self.ui.GUI_Made_Name.setText(_translate("MainWindow", "mtkiao129#3921"))
|
|
|
|
|
self.ui.Core_Made_title.setText(_translate("MainWindow", "Core Make:"))
|
|
|
|
@@ -450,13 +458,20 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
def lang_init_zh_cn(self):
|
|
|
|
|
start = time.time()
|
|
|
|
|
_translate = QtCore.QCoreApplication.translate
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append('[提示] 尚未启用实时防护')
|
|
|
|
|
if pyas_key():
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.0"))
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.2"))
|
|
|
|
|
now_time = datetime.datetime.now()
|
|
|
|
|
try:
|
|
|
|
|
ft = open('Library/PYAS/Temp/PYASP.tmp','r',encoding='utf-8')
|
|
|
|
|
fe = ft.read()
|
|
|
|
|
ft.close()
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print('Error: '+str(e))
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [提示] 尚未启用实时防护')
|
|
|
|
|
else:
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.0 (安全密钥错误)"))
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.2 (安全密钥错误)"))
|
|
|
|
|
now_time = datetime.datetime.now()
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [警告] PYAS 安全密钥错误')
|
|
|
|
@@ -518,7 +533,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
self.ui.System_Info_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Customize_CMD_Command_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Customize_CMD_Command_Run_Button.setText(_translate("MainWindow", "运行"))
|
|
|
|
|
self.ui.Customize_CMD_Command_output_title.setText(_translate("MainWindow", "输出(不支持中文):"))
|
|
|
|
|
self.ui.Customize_CMD_Command_output_title.setText(_translate("MainWindow", "输出:"))
|
|
|
|
|
self.ui.Analyze_EXE_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Look_for_File_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Look_for_File_Run_Button.setText(_translate("MainWindow", "寻找档案"))
|
|
|
|
@@ -529,7 +544,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
self.ui.Encryption_Text_title.setText(_translate("MainWindow", "加密&解密前"))
|
|
|
|
|
self.ui.Decrypt_Text_Run_Button.setText(_translate("MainWindow", "解密"))
|
|
|
|
|
self.ui.About_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.4.0"))
|
|
|
|
|
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.4.2"))
|
|
|
|
|
self.ui.GUI_Made_title.setText(_translate("MainWindow", "介面制作:"))
|
|
|
|
|
self.ui.GUI_Made_Name.setText(_translate("MainWindow", "mtkiao129#3921"))
|
|
|
|
|
self.ui.Core_Made_title.setText(_translate("MainWindow", "核心制作:"))
|
|
|
|
@@ -579,13 +594,20 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
def lang_init_zh_tw(self):
|
|
|
|
|
start = time.time()
|
|
|
|
|
_translate = QtCore.QCoreApplication.translate
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append('[提示] 尚未啟用實時防護')
|
|
|
|
|
if pyas_key():
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.0"))
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.2"))
|
|
|
|
|
now_time = datetime.datetime.now()
|
|
|
|
|
try:
|
|
|
|
|
ft = open('Library/PYAS/Temp/PYASP.tmp','r',encoding='utf-8')
|
|
|
|
|
fe = ft.read()
|
|
|
|
|
ft.close()
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print('Error: '+str(e))
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [提示] 尚未啟用實時防護')
|
|
|
|
|
else:
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.0 (安全密鑰錯誤)"))
|
|
|
|
|
self.ui.Window_title.setText(_translate("MainWindow", "PYAS V2.4.2 (安全密鑰錯誤)"))
|
|
|
|
|
now_time = datetime.datetime.now()
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + ' > [警告] PYAS 安全密鑰錯誤')
|
|
|
|
@@ -647,7 +669,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
self.ui.System_Info_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Customize_CMD_Command_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Customize_CMD_Command_Run_Button.setText(_translate("MainWindow", "運行"))
|
|
|
|
|
self.ui.Customize_CMD_Command_output_title.setText(_translate("MainWindow", "輸出(不支持中文):"))
|
|
|
|
|
self.ui.Customize_CMD_Command_output_title.setText(_translate("MainWindow", "輸出:"))
|
|
|
|
|
self.ui.Analyze_EXE_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Look_for_File_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.Look_for_File_Run_Button.setText(_translate("MainWindow", "尋找檔案"))
|
|
|
|
@@ -658,7 +680,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
self.ui.Encryption_Text_title.setText(_translate("MainWindow", "加密&解密前"))
|
|
|
|
|
self.ui.Decrypt_Text_Run_Button.setText(_translate("MainWindow", "解密"))
|
|
|
|
|
self.ui.About_Back.setText(_translate("MainWindow", "返回"))
|
|
|
|
|
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.4.0"))
|
|
|
|
|
self.ui.PYAS_Version.setText(_translate("MainWindow", "PYAS V2.4.2"))
|
|
|
|
|
self.ui.GUI_Made_title.setText(_translate("MainWindow", "介面製作:"))
|
|
|
|
|
self.ui.GUI_Made_Name.setText(_translate("MainWindow", "mtkiao129#3921"))
|
|
|
|
|
self.ui.Core_Made_title.setText(_translate("MainWindow", "核心製作:"))
|
|
|
|
@@ -1609,11 +1631,22 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
QMessageBox.critical(self,self.text_Translate('錯誤'),self.text_Translate("禁用失敗"),QMessageBox.Ok)
|
|
|
|
|
|
|
|
|
|
def System_Info_update(self):
|
|
|
|
|
self.ui.System_Info_View.setText('System information:'+'\n'+str(platform.platform())+'\n'+str(platform.architecture())+'\n'+str(platform.node())+'\n'+str(platform.processor()))
|
|
|
|
|
self.ui.System_Info_View.setText('System information:'+
|
|
|
|
|
'\nCore version: '+str(platform.platform())+
|
|
|
|
|
'\nMachine type: '+str(platform.machine())+
|
|
|
|
|
'\nSystem Info: '+str(platform.architecture())+
|
|
|
|
|
'\nComputer Name: '+str(platform.node())+
|
|
|
|
|
'\nProcessor Name'+str(platform.processor()))
|
|
|
|
|
|
|
|
|
|
def Delete_Private_File(self):
|
|
|
|
|
file, filetype= QFileDialog.getOpenFileName(self,self.text_Translate("刪除檔案"),"./",'')
|
|
|
|
|
if file !="":
|
|
|
|
|
if file =="":
|
|
|
|
|
pass
|
|
|
|
|
elif "PYAS.exe" in file:
|
|
|
|
|
QMessageBox.critical(self,"Error",self.text_Translate('存取被拒'),QMessageBox.Ok)
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
print(file)
|
|
|
|
|
question = QMessageBox.warning(self,self.text_Translate('刪除檔案'),self.text_Translate("您確定刪除該檔案嗎?"),QMessageBox.Yes|QMessageBox.No,QMessageBox.Yes)
|
|
|
|
|
if question == 16384:
|
|
|
|
|
try:
|
|
|
|
@@ -1646,9 +1679,16 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
p = subprocess.Popen(CMD_Command,
|
|
|
|
|
stdin=subprocess.PIPE,
|
|
|
|
|
stdout=subprocess.PIPE,
|
|
|
|
|
)
|
|
|
|
|
)#encoding='utf-8')
|
|
|
|
|
out = p.stdout.read()
|
|
|
|
|
self.ui.Customize_CMD_Command_output.setText(str(out))
|
|
|
|
|
#self.ui.Customize_CMD_Command_output.clear()
|
|
|
|
|
try:
|
|
|
|
|
self.ui.Customize_CMD_Command_output.setText(str(out.decode('utf-8')))
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print(e)
|
|
|
|
|
self.ui.Customize_CMD_Command_output.setText(str(out))
|
|
|
|
|
#for out in p.stdout.readlines():
|
|
|
|
|
#self.ui.Customize_CMD_Command_output.append(str(out.decode('utf-8')))
|
|
|
|
|
QMessageBox.information(self,self.text_Translate("完成"),self.text_Translate("運行成功"),QMessageBox.Ok,QMessageBox.Ok)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print('Error: '+str(e))
|
|
|
|
@@ -1692,7 +1732,10 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
self.ui.Analyze_EXE_Output.setText("")
|
|
|
|
|
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
|
|
|
|
for function in entry.imports:
|
|
|
|
|
self.ui.Analyze_EXE_Output.append(str(function.name) + 'n')
|
|
|
|
|
try:
|
|
|
|
|
self.ui.Analyze_EXE_Output.append(str(function.name.decode('utf-8')))# + 'n')
|
|
|
|
|
except:
|
|
|
|
|
self.ui.Analyze_EXE_Output.append(str(function.name))
|
|
|
|
|
self.Change_Tools(self.ui.Analyze_EXE_widget)
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
else:
|
|
|
|
@@ -1713,12 +1756,15 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
else:
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
file, filetype= QFileDialog.getOpenFileName(self,self.text_Translate("分析文件位元"),"./",'EXE File *.exe')
|
|
|
|
|
file, filetype= QFileDialog.getOpenFileName(self,self.text_Translate("分析文件位元"),"./",'EXE OR DLL File *.exe *.dll')
|
|
|
|
|
if file != '':
|
|
|
|
|
pe = PE(file)
|
|
|
|
|
self.ui.Analyze_EXE_Output.setText("")
|
|
|
|
|
for section in pe.sections:
|
|
|
|
|
self.ui.Analyze_EXE_Output.append(str(section.Name) + str(hex(section.VirtualAddress)) + str(hex(section.Misc_VirtualSize)) + str(section.SizeOfRawData))
|
|
|
|
|
try:
|
|
|
|
|
self.ui.Analyze_EXE_Output.append(str(section.Name.decode('utf-8')) + str(hex(section.VirtualAddress)) + str(hex(section.Misc_VirtualSize)) + str(section.SizeOfRawData))
|
|
|
|
|
except:
|
|
|
|
|
self.ui.Analyze_EXE_Output.append(str(section.Name) + str(hex(section.VirtualAddress)) + str(hex(section.Misc_VirtualSize)) + str(section.SizeOfRawData))
|
|
|
|
|
self.Change_Tools(self.ui.Analyze_EXE_widget)
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
|
|
|
|
@@ -1929,6 +1975,11 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
|
|
|
|
|
def protect_threading_init_zh(self):
|
|
|
|
|
if self.ui.Protection_switch_Button.text() == self.text_Translate("已開啟"):
|
|
|
|
|
try:
|
|
|
|
|
os.remove('Library/PYAS/Temp/PYASP.tmp')
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print('Error: '+str(e))
|
|
|
|
|
pass
|
|
|
|
|
self.ui.Protection_switch_Button.setText(self.text_Translate("已關閉"))
|
|
|
|
|
self.ui.Protection_switch_Button.setStyleSheet("""
|
|
|
|
|
QPushButton
|
|
|
|
@@ -1945,7 +1996,15 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
self.Virus_Scan = 0
|
|
|
|
|
self.pause = True
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
now_time = datetime.datetime.now()
|
|
|
|
|
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + self.text_Translate(' > [提示] 尚未啟用實時防護'))
|
|
|
|
|
elif self.ui.Protection_switch_Button.text() == self.text_Translate("已开启"):
|
|
|
|
|
try:
|
|
|
|
|
os.remove('Library/PYAS/Temp/PYASP.tmp')
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print('Error: '+str(e))
|
|
|
|
|
pass
|
|
|
|
|
self.ui.Protection_switch_Button.setText(self.text_Translate("已关闭"))
|
|
|
|
|
self.ui.Protection_switch_Button.setStyleSheet("""
|
|
|
|
|
QPushButton
|
|
|
|
@@ -1962,8 +2021,12 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
|
self.Virus_Scan = 0
|
|
|
|
|
self.pause = True
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
now_time = datetime.datetime.now()
|
|
|
|
|
self.ui.State_output.append(str(now_time.strftime('%Y/%m/%d %H:%M:%S')) + self.text_Translate(' > [提示] 尚未启用实时防护'))
|
|
|
|
|
else:
|
|
|
|
|
try:
|
|
|
|
|
self.ui.State_output.clear()
|
|
|
|
|
self.ui.Protection_illustrate.setText(self.text_Translate("正在初始化中,請稍後..."))
|
|
|
|
|
self.pause = False
|
|
|
|
|
QApplication.processEvents()
|
|
|
|
@@ -2040,6 +2103,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
else:
|
|
|
|
|
if self.pyas_scan_start(p.exe(),rfp):
|
|
|
|
|
of = subprocess.call('taskkill /f /im "'+str(p.name())+'" /t',shell=True)
|
|
|
|
|
vfile = str(p.exe())
|
|
|
|
|
try:
|
|
|
|
|
if of == 0:
|
|
|
|
|
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 成功攔截了一個惡意軟體:').format(str(datetime.datetime.now().strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()))
|
|
|
|
@@ -2064,7 +2128,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
|
|
|
|
pass
|
|
|
|
|
print(str(e))
|
|
|
|
|
try:
|
|
|
|
|
os.remove(str(p.exe()))
|
|
|
|
|
os.remove(vfile)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
print('Error: '+str(e))
|
|
|
|
|
pass
|
|
|
|
|