Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a17827dbf4 | ||
|
|
ef1f29a34f | ||
|
|
e283a6a955 | ||
|
|
7944627dab | ||
|
|
7757b10b4d | ||
|
|
2b182e182b | ||
|
|
d6fafd5b34 | ||
|
|
f36b3a0912 | ||
|
|
04cae30629 | ||
|
|
38cdeeed6a | ||
|
|
0d9ab96cf5 | ||
|
|
261420973e | ||
|
|
d058101e8c | ||
|
|
128f39dcb3 | ||
|
|
5d6cbf256a | ||
|
|
c904c43c22 | ||
|
|
401ec5eb6e | ||
|
|
9a54f676fd | ||
|
|
a7f3167776 | ||
|
|
b3928e9677 | ||
|
|
de0bbdffe2 | ||
|
|
0cf835a3fb | ||
|
|
527dbdaec3 | ||
|
|
3fee5ee3ee | ||
|
|
df62fa34d7 | ||
|
|
7a2709b612 | ||
|
|
508c6e1f66 | ||
|
|
2b4d282ec1 | ||
|
|
e977e27d79 | ||
|
|
1f0693cec4 | ||
|
|
6e0492a4a3 | ||
|
|
67eeaca923 | ||
|
|
5b589b26d8 | ||
|
|
65b821508b |
No files matched your search
+21
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
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.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,38 +1,30 @@
|
||||
b'RegQueryValueExW'
|
||||
b'RegOpenKeyExW'
|
||||
b'RegOpenCurrentUser'
|
||||
b'RegDeleteKeyW'
|
||||
b'RegDeleteValueW'
|
||||
b'RegCloseKey'
|
||||
b'RegCreateKeyExW'
|
||||
b'RegSetValueExW'
|
||||
b'RegOpenKeyExA'
|
||||
b'RegSetValueExA'
|
||||
b'RegQueryValueA'
|
||||
b'RegCreateKeyExA'
|
||||
b'RegEnumKeyExW'
|
||||
b'RegQueryInfoKeyW'
|
||||
b'RegisterClassExW'
|
||||
b'RegisterHotKey'
|
||||
b'RegQueryValueExA'
|
||||
b'RegisterClipboardFormatA'
|
||||
b'RegisterWindowMessageA'
|
||||
b'RegisterClassA'
|
||||
b'CryptDestroyKey'
|
||||
b'CryptGenKey'
|
||||
b'CryptDecrypt'
|
||||
b'CryptEncrypt'
|
||||
b'CryptImportKey'
|
||||
b'CryptSetKeyParam'
|
||||
b'CryptReleaseContext'
|
||||
b'CryptDeriveKey'
|
||||
b'CryptCreateHash'
|
||||
b'CryptHashData'
|
||||
b'CryptStringToBinaryA'
|
||||
b'CryptBinaryToStringA'
|
||||
b'CryptGetKeyParam'
|
||||
b'CryptGetHashParam'
|
||||
b'CryptDestroyHash'
|
||||
b'CryptImportPublicKeyInfo'
|
||||
b'UnlockFile'
|
||||
b'LockFile'
|
||||
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
|
||||
@@ -5,16 +5,27 @@
|
||||
# PYAS Web: https://pyantivirus.wixsite.com/pyas
|
||||
#
|
||||
# PYAS is managed by PYDT (Python Development Team)
|
||||
# Copyright© 2020-2022 PYAS Python Antivirus Software.
|
||||
# Copyright© 2020-2022 87owo (PYAS Security)
|
||||
####################################################################################
|
||||
#
|
||||
###################################### 錯誤日誌 #####################################
|
||||
|
||||
def pyas_bug_log(e):
|
||||
try:
|
||||
print('[Error] '+str(e))
|
||||
ft = open('Library/PYAS/Temp/PYASB.log','a',encoding='utf-8')
|
||||
ft.write(str(e)+'\n')
|
||||
ft.close()
|
||||
except:
|
||||
pass
|
||||
|
||||
##################################### 載入必要模組 ###################################
|
||||
|
||||
try:
|
||||
import time
|
||||
start_m = time.time()
|
||||
import os, sys, psutil, subprocess, cryptocode, threading, configparser, datetime
|
||||
from pefile import PE
|
||||
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
|
||||
from PyQt5.QtWidgets import *
|
||||
@@ -25,63 +36,23 @@ try:
|
||||
#from watchdog.events import FileSystemEventHandler #Beta Not Cplt
|
||||
#from watchdog.observers import Observer
|
||||
except Exception as e:
|
||||
print('[Error] '+str(e))
|
||||
pyas_bug_log(e)
|
||||
print('[LOAD] Mods: '+str(time.time()-start_m)+' sec')
|
||||
|
||||
###################################### 錯誤日誌 #####################################
|
||||
##################################### 移除暫存檔 ####################################
|
||||
|
||||
def pyas_bug_log(e):
|
||||
def pyasb_remove():
|
||||
try:
|
||||
print('[Error] '+str(e))
|
||||
ft = open('Library/PYAS/Temp/PYASB.log','a',encoding='utf-8')
|
||||
fe = ft.write(str(e)+'\n')
|
||||
ft.close()
|
||||
os.remove('Library/PYAS/Temp/PYASB.log')
|
||||
except:
|
||||
pass
|
||||
|
||||
##################################### 測試版項目 ####################################
|
||||
|
||||
def pyas_vl_md5r():#不穩定
|
||||
def pyasp_remove():
|
||||
try:
|
||||
with open('Library/PYAE/Hashes/Viruslist.md5','r') as fp:
|
||||
global rfp
|
||||
rfp = fp.read()
|
||||
fp.close()
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
|
||||
###################################### 密鑰認證 #####################################
|
||||
|
||||
def pyas_key():
|
||||
start = time.time()
|
||||
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/PYASP.tmp')
|
||||
except:
|
||||
pass
|
||||
|
||||
##################################### 資料庫檢查 ####################################
|
||||
|
||||
def pyas_library():
|
||||
@@ -102,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():
|
||||
@@ -161,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):
|
||||
@@ -337,24 +329,11 @@ class MainWindow_Controller(QtWidgets.QMainWindow):#,FileSystemEventHandler):
|
||||
|
||||
###################################### 許可條款 #####################################
|
||||
|
||||
self.ui.License_terms.setText('''PYAS Python Antivirus Software Security License Terms V2.0
|
||||
self.ui.License_terms.setText('''Copyright (C) 2020-2022 87owo (PYAS Security)
|
||||
=====================================================
|
||||
#Use of PYAS antivirus software and services means that you accept these terms, if you do not accept, please do not use PYAS services.
|
||||
=====================================================
|
||||
1. Copyright notice
|
||||
You can use this software for free, or use the open source code of this software for research, but imitation and sales of this software are strictly prohibited.
|
||||
=====================================================
|
||||
2. Legal Requirements
|
||||
Please abide by the current regional laws and regulations, it is strictly prohibited to use PYAS to do illegal things.
|
||||
=====================================================
|
||||
3. User privacy protection
|
||||
PYAS does not collect any personal privacy data, except for the email address required to fill in the feedback.
|
||||
=====================================================
|
||||
4. Permission is required to use PYAS
|
||||
System Administrator, File management, And command execution rights.
|
||||
=====================================================
|
||||
5. Get genuine PYAS
|
||||
If you do not download from the official website, we cannot guarantee the security of your data, and we are not responsible for any loss caused.''')
|
||||
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.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.''')
|
||||
self.effect_shadow = QtWidgets.QGraphicsDropShadowEffect(self)
|
||||
self.effect_shadow.setOffset(0,0) # 偏移
|
||||
self.effect_shadow.setBlurRadius(10) # 阴影半径
|
||||
@@ -371,7 +350,6 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
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()
|
||||
@@ -426,11 +404,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
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:
|
||||
@@ -518,7 +492,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
cy = datetime.datetime.now().strftime('%Y')
|
||||
if int(cy) < 2020:
|
||||
cy = str('2020')
|
||||
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", "Copyright© 2020-"+str(cy)+" 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:
|
||||
@@ -569,11 +543,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
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:
|
||||
@@ -614,7 +584,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
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", "系统版本资讯"))
|
||||
@@ -661,7 +631,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
cy = datetime.datetime.now().strftime('%Y')
|
||||
if int(cy) < 2020:
|
||||
cy = str('2020')
|
||||
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", "Copyright© 2020-"+str(cy)+" 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:
|
||||
@@ -712,11 +682,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
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:
|
||||
@@ -757,7 +723,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
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", "系統版本資訊"))
|
||||
@@ -804,7 +770,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
cy = datetime.datetime.now().strftime('%Y')
|
||||
if int(cy) < 2020:
|
||||
cy = str('2020')
|
||||
self.ui.PYAS_CopyRight.setText(_translate("MainWindow", "Copyright© 2020-"+str(cy)+" 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:
|
||||
@@ -864,6 +830,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
text = text.replace("軟體","软件")
|
||||
text = text.replace("惡意","恶意")
|
||||
text = text.replace("設定","设置")
|
||||
text = text.replace("密鑰","密钥")
|
||||
text = text.replace("關於","关于")
|
||||
text = text.replace("當前","当前")
|
||||
text = text.replace("確定","确定")
|
||||
@@ -1088,7 +1055,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
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))
|
||||
@@ -1127,31 +1094,38 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
def pyas_scan_start(self,file,rfp):
|
||||
try:
|
||||
with open(file,"rb") as f:
|
||||
bytes = f.read()
|
||||
f.close()
|
||||
QApplication.processEvents()
|
||||
readable_hash = str(md5(bytes).hexdigest())
|
||||
if readable_hash[:10] in str(rfp):
|
||||
if str(md5(f.read()).hexdigest())[:10] in str(rfp):
|
||||
f.close()
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
return False
|
||||
|
||||
def pyas_sign_start(self,file):
|
||||
try:
|
||||
pe = PE(file,fast_load=True)
|
||||
if pe.OPTIONAL_HEADER.DATA_DIRECTORY[DIRECTORY_ENTRY['IMAGE_DIRECTORY_ENTRY_SECURITY']].VirtualAddress == 0:
|
||||
pe.close()
|
||||
#print('UNsign: '+file)
|
||||
return True
|
||||
else:
|
||||
pe.close()
|
||||
#print('sign: '+file)
|
||||
return False
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
return False
|
||||
except:
|
||||
#print('ERsign: '+file)
|
||||
return True
|
||||
|
||||
#定義紀錄掃描
|
||||
def pyas_scan_write_en(self,file):
|
||||
try:
|
||||
if 'C:/Windows' in str(file):
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
ft = open('Library/PYAS/Temp/PYASV.tmp','a',encoding='utf-8')
|
||||
self.Virus_List.append(file)
|
||||
fe = ft.write(file+'\n')
|
||||
ft.close()
|
||||
except:
|
||||
pass
|
||||
ft = open('Library/PYAS/Temp/PYASV.tmp','a',encoding='utf-8')
|
||||
ft.write(file+'\n')
|
||||
ft.close()
|
||||
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)
|
||||
pass
|
||||
@@ -1195,49 +1169,6 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
except:
|
||||
pass
|
||||
|
||||
def pyas_scan_path_en(self,path,rfp,rfn,fts):
|
||||
try:
|
||||
for fd in os.listdir(path):
|
||||
try:
|
||||
if self.Virus_Scan == 0:
|
||||
self.ui.Virus_Scan_Break_Button.hide()
|
||||
break
|
||||
else:
|
||||
fullpath = os.path.join(path,fd)
|
||||
if 'C:/Windows' in str(fullpath) or 'C:/Program' in str(fullpath) or 'AppData' in str(fullpath):
|
||||
pass
|
||||
else:
|
||||
if os.path.isdir(fullpath):
|
||||
self.pyas_scan_path_en(fullpath,rfp,rfn,fts)
|
||||
else:
|
||||
scan_text = self.text_Translate('正在掃描: ')
|
||||
try:
|
||||
self.ui.Virus_Scan_text.setText(scan_text + fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
else:
|
||||
if self.show_virus_scan_progress_bar != 0:
|
||||
pe = PE(fullpath)
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for function in entry.imports:
|
||||
if fts != True:
|
||||
if str(function.name) in rfn:
|
||||
fts = True
|
||||
if fts:
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
fts = False
|
||||
except:
|
||||
self.ui.Virus_Scan_text.setText(scan_text + fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
except:
|
||||
continue
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
pass
|
||||
|
||||
##################################### 檔案掃描 #####################################
|
||||
|
||||
def File_Scan(self):
|
||||
@@ -1265,33 +1196,37 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
with open('Library/PYAE/Hashes/Viruslist.md5','r') as fp:
|
||||
rfp = fp.read()
|
||||
fp.close()
|
||||
if self.show_virus_scan_progress_bar != 0 and os.path.isfile(filepath) == True:
|
||||
if self.show_virus_scan_progress_bar != 0:
|
||||
with open('Library/PYAE/Function/Viruslist.func','r') as fn:
|
||||
rfn = fn.read()
|
||||
fn.close()
|
||||
else:
|
||||
rfn = ''
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
if self.pyas_scan_start(file,rfp):
|
||||
self.pyas_scan_write_en(file)
|
||||
self.ui.Virus_Scan_text.setText(self.text_Translate("✖當前已發現惡意軟體。"))
|
||||
if self.show_virus_scan_progress_bar == 0:
|
||||
if self.pyas_sign_start(file):
|
||||
if self.pyas_scan_start(file,rfp):
|
||||
self.pyas_scan_write_en(file)
|
||||
self.ui.Virus_Scan_text.setText(self.text_Translate("✖當前已發現惡意軟體。"))
|
||||
else:
|
||||
if self.show_virus_scan_progress_bar != 0:
|
||||
fts = False
|
||||
try:
|
||||
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) in rfn:
|
||||
if str(function.name.decode('utf-8')) in rfn:
|
||||
fts = True
|
||||
pe.close()
|
||||
if fts:
|
||||
self.pyas_scan_write_en(file)
|
||||
fts = False
|
||||
print('[SCAN] Malware has been detected')
|
||||
self.ui.Virus_Scan_text.setText(self.text_Translate("✖當前已發現惡意軟體。"))
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
self.ui.Virus_Scan_text.setText(self.text_Translate("✖掃描失敗。"))
|
||||
except:
|
||||
pass
|
||||
self.pyas_scan_answer_en()
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
@@ -1301,6 +1236,47 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
|
||||
##################################### 路徑掃描 #####################################
|
||||
|
||||
def pyas_scan_path_en(self,path,rfp,rfn,fts):
|
||||
try:
|
||||
for fd in os.listdir(path):
|
||||
try:
|
||||
if self.Virus_Scan == 0:
|
||||
self.ui.Virus_Scan_Break_Button.hide()
|
||||
break
|
||||
else:
|
||||
fullpath = os.path.join(path,fd)
|
||||
if os.path.isdir(fullpath):
|
||||
self.pyas_scan_path_en(fullpath,rfp,rfn,fts)
|
||||
else:
|
||||
try:
|
||||
self.ui.Virus_Scan_text.setText(self.text_Translate("正在掃描: ")+fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.show_virus_scan_progress_bar == 0:
|
||||
if self.pyas_sign_start(fullpath):
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
else:
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
else:
|
||||
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
|
||||
except:
|
||||
pass
|
||||
except:
|
||||
continue
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
pass
|
||||
|
||||
def Path_Scan(self):
|
||||
print('[SCAN] Start Scan Action (Path Scan)')
|
||||
self.ui.Virus_Scan_choose_widget.hide()
|
||||
@@ -1332,9 +1308,12 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
with open('Library/PYAE/Hashes/Viruslist.md5','r') as fp:
|
||||
rfp = fp.read()
|
||||
fp.close()
|
||||
with open('Library/PYAE/Function/Viruslist.func','r') as fn:
|
||||
rfn = fn.read()
|
||||
fn.close()
|
||||
if self.show_virus_scan_progress_bar != 0:
|
||||
with open('Library/PYAE/Function/Viruslist.func','r') as fn:
|
||||
rfn = fn.read()
|
||||
fn.close()
|
||||
else:
|
||||
rfn = ''
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
self.pyas_scan_path_en(file,rfp,rfn,False)
|
||||
@@ -1409,68 +1388,43 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
try:
|
||||
for fd in os.listdir(path):
|
||||
try:
|
||||
fullpath = os.path.join(path,fd)
|
||||
if os.path.isdir(fullpath):
|
||||
self.pyas_scan_disk_en(fullpath,rfp)
|
||||
if self.Virus_Scan == 0:
|
||||
self.ui.Virus_Scan_Break_Button.hide()
|
||||
break
|
||||
else:
|
||||
if 'C:/Windows' in str(fullpath) or 'C:/Program' in str(fullpath) or 'AppData' in str(fullpath):
|
||||
pass
|
||||
fullpath = str(os.path.join(path,fd))
|
||||
if os.path.isdir(fullpath):
|
||||
self.pyas_scan_disk_en(fullpath,rfp)
|
||||
else:
|
||||
if self.Virus_Scan == 0:
|
||||
self.ui.Virus_Scan_Break_Button.hide()
|
||||
break
|
||||
elif '.exe' in str(fd) or '.EXE' in str(fd):
|
||||
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
elif '.cmd' in str(fd) or '.CMD' in str(fd):
|
||||
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
elif '.bat' in str(fd) or '.BAT' in str(fd):
|
||||
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
elif '.com' in str(fd) or '.COM' in str(fd):
|
||||
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
elif '.vbs' in str(fd) or '.VBS' in str(fd):
|
||||
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
elif '.js' in str(fd) or '.JS' in str(fd):
|
||||
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
elif '.xls' in str(fd) or '.XLS' in str(fd):
|
||||
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
elif '.doc' in str(fd) or '.DOC' in str(fd):
|
||||
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
elif '.dll' in str(fd) or '.DLL' in str(fd):
|
||||
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
elif '.scr' in str(fd) or '.SCR' in str(fd):
|
||||
self.ui.Virus_Scan_text.setText(self.scaning+fullpath)
|
||||
QApplication.processEvents()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
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 or 'AppData' in fullpath or 'C:/ProgramData' in fullpath:
|
||||
pass
|
||||
else:
|
||||
if 'C:/Program' in fullpath:
|
||||
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',
|
||||
#'.vbs','.js','.jar','.py','.cpp','.htm','.html',
|
||||
#'.doc','.docx','.ppt','.pptx','.xls','.xlm','.pdf',
|
||||
#'.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:
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
else:
|
||||
pass
|
||||
root, extension = os.path.splitext(fd)
|
||||
sfd = str(extension).lower()
|
||||
if self.pyas_scan_start(fullpath,rfp):
|
||||
self.pyas_scan_write_en(fullpath)
|
||||
except:
|
||||
continue
|
||||
except:
|
||||
@@ -1710,6 +1664,21 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
|
||||
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":
|
||||
@@ -1720,27 +1689,12 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
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.")
|
||||
QApplication.processEvents()
|
||||
if CMD_Command.split()[1].lower() == "-library" or CMD_Command.split()[1].lower() == "-l":
|
||||
if CMD_Command.split()[2].lower() == "-md5" or CMD_Command.split()[2].lower() == "-m":
|
||||
if CMD_Command.split()[1].lower() == "--library" or CMD_Command.split()[1].lower() == "-l":
|
||||
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/Viruslist.md5','a') as vm:
|
||||
@@ -1749,7 +1703,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
except:
|
||||
self.ui.Customize_CMD_Command_output.setText("Error: Add MD5 database failed")
|
||||
return
|
||||
if CMD_Command.split()[2].lower() == "-func" or CMD_Command.split()[2].lower() == "-f":
|
||||
if CMD_Command.split()[2].lower() == "--func" or CMD_Command.split()[2].lower() == "-f":
|
||||
try:
|
||||
value = CMD_Command.split()[3]
|
||||
with open('Library/PYAE/Function/Viruslist.func','a') as vm:
|
||||
@@ -1758,22 +1712,23 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
except:
|
||||
self.ui.Customize_CMD_Command_output.setText("Error: Add Function database failed")
|
||||
return
|
||||
if CMD_Command.split()[1].lower() == "-rules" or CMD_Command.split()[1].lower() == "-r":
|
||||
if CMD_Command.split()[2].lower() == "-reg" or CMD_Command.split()[2].lower() == "-r":
|
||||
if CMD_Command.split()[1].lower() == "--rules" or CMD_Command.split()[1].lower() == "-r":
|
||||
if CMD_Command.split()[2].lower() == "--reg" or CMD_Command.split()[2].lower() == "-r":
|
||||
value = CMD_Command.split()[3]
|
||||
if CMD_Command.split()[2].lower() == "-perf" or CMD_Command.split()[2].lower() == "-p":
|
||||
if CMD_Command.split()[2].lower() == "--perf" or CMD_Command.split()[2].lower() == "-p":
|
||||
value = CMD_Command.split()[3]
|
||||
while 1:
|
||||
QApplication.processEvents()
|
||||
x = int(psutil.cpu_percent(interval=0.1))
|
||||
if x > int(value):
|
||||
print(str(x))
|
||||
if CMD_Command.split()[2].lower() == "-file" or CMD_Command.split()[2].lower() == "-f":
|
||||
if CMD_Command.split()[2].lower() == "--file" or CMD_Command.split()[2].lower() == "-f":
|
||||
value = CMD_Command.split()[3]
|
||||
if CMD_Command.split()[2].lower() == "-task" or CMD_Command.split()[2].lower() == "-t":
|
||||
if CMD_Command.split()[2].lower() == "--task" or CMD_Command.split()[2].lower() == "-t":
|
||||
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
|
||||
@@ -1785,7 +1740,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
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')))
|
||||
@@ -1861,7 +1816,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
else:
|
||||
file, filetype= QFileDialog.getOpenFileName(self,self.text_Translate("分析文件位元"),"C:/",'EXE OR DLL File *.exe *.dll')
|
||||
if file != '':
|
||||
pe = PE(file)
|
||||
pe = PE(file,fast_load=True)
|
||||
self.ui.Analyze_EXE_Output.setText("")
|
||||
for section in pe.sections:
|
||||
try:
|
||||
@@ -1938,8 +1893,11 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
try:
|
||||
QApplication.processEvents()
|
||||
fullpath = os.path.join(path,fd)
|
||||
if 'C:/Windows' in fullpath or 'AppData' 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)
|
||||
@@ -2002,9 +1960,11 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
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):
|
||||
@@ -2099,11 +2059,14 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
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)
|
||||
|
||||
@@ -2111,18 +2074,18 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
print('[INFO] Start Action (Real-time Protect)')
|
||||
try:
|
||||
ft = open('Library/PYAS/Temp/PYASP.tmp','w',encoding='utf-8')
|
||||
fe = ft.write('')
|
||||
ft.write('')
|
||||
ft.close()
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
pass
|
||||
try:
|
||||
print('[INFO] Reading Viruslist Database')
|
||||
with open('Library/PYAE/Hashes/Viruslist.md5','r') as fp:
|
||||
rfp = fp.read()
|
||||
fp.close()
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
#try:
|
||||
#print('[INFO] Reading Viruslist Database')
|
||||
#with open('Library/PYAE/Hashes/Viruslist.md5','r') as fp:
|
||||
#rfp = fp.read()
|
||||
#fp.close()
|
||||
#except Exception as e:
|
||||
#pyas_bug_log(e)
|
||||
self.Virus_Scan = 1
|
||||
if self.ui.Protection_switch_Button.text() == self.text_Translate("已關閉"):
|
||||
self.ui.Protection_illustrate.setText(self.text_Translate("啟用該選項可以實時監控進程中的惡意軟體並清除。"))
|
||||
@@ -2144,45 +2107,40 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
border-radius: 15px;}
|
||||
QPushButton:hover{
|
||||
background-color:rgba(20,200,20,120);}""")
|
||||
while 1:
|
||||
if not self.pause:
|
||||
if not os.path.isfile('Library/PYAS/Temp/PYASP.tmp'):
|
||||
self.pause = True
|
||||
break
|
||||
else:
|
||||
self.Virus_Scan = 1
|
||||
#print('[INFO] Real-time Protect Process Refresh')
|
||||
for p in psutil.process_iter():
|
||||
try:
|
||||
if '' == str(p.exe()):
|
||||
pass
|
||||
elif 'C:\Windows' in str(p.exe()) or 'C:\Program' in str(p.exe()):
|
||||
pass
|
||||
elif 'MemCompression' in str(p.exe()) or 'Registry' in str(p.exe()) or 'PYAS' in str(p.exe()):
|
||||
pass
|
||||
else:
|
||||
if self.pyas_scan_start(p.exe(),rfp):
|
||||
try:
|
||||
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(datetime.datetime.now().strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()))
|
||||
else:
|
||||
print('[INFO] Malware blocking failed: '+str(p.name()))
|
||||
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 惡意軟體攔截失敗:').format(datetime.datetime.now())+str(p.name()))
|
||||
#try:
|
||||
#observer = Observer()
|
||||
#observer.schedule(MainWindow_Controller(), os.path.dirname(p.exe()), False)
|
||||
#observer.start()
|
||||
#except Exception as e:
|
||||
#pass
|
||||
os.remove(str(p.exe()))
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
pass
|
||||
except:
|
||||
continue
|
||||
else:
|
||||
while not self.pause:
|
||||
if not os.path.isfile('Library/PYAS/Temp/PYASP.tmp'):
|
||||
self.pause = True
|
||||
break
|
||||
else:
|
||||
self.Virus_Scan = 1
|
||||
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 '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:
|
||||
try:
|
||||
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(datetime.datetime.now().strftime('%Y/%m/%d %H:%M:%S')))+str(p.name()))
|
||||
else:
|
||||
print('[INFO] Malware blocking failed: '+str(p.name()))
|
||||
self.ui.State_output.append(self.text_Translate('{} > [實時防護] 惡意軟體攔截失敗:').format(datetime.datetime.now())+str(p.name()))
|
||||
#try:
|
||||
#observer = Observer()
|
||||
#observer.schedule(MainWindow_Controller(), os.path.dirname(p.exe()), False)
|
||||
#observer.start()
|
||||
#except Exception as e:
|
||||
#pass
|
||||
#os.remove(str(p.exe()))
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
pass
|
||||
except:
|
||||
continue
|
||||
|
||||
##################################### 系統設置 #####################################
|
||||
|
||||
@@ -2219,8 +2177,6 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
self.ini_config.read(r"Library/PYAS/Setup/PYAS.ini")
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
self.ini_config = configparser.RawConfigParser()
|
||||
self.ini_config.read(r"C:/Program Files (x86)/PYAS/Library/PYAS/Setup/PYAS.ini")
|
||||
try:
|
||||
if self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.text() == self.text_Translate("已關閉"):
|
||||
self.ini_config.set("Setting", "high_sensitivity", 1)
|
||||
@@ -2228,7 +2184,6 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
self.ini_config.write(open(r"Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
self.ini_config.write(open(r"C:/Program Files (x86)/PYAS/Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate("已開啟"))
|
||||
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setStyleSheet("""
|
||||
QPushButton{
|
||||
@@ -2244,7 +2199,6 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
self.ini_config.write(open(r"Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
self.ini_config.write(open(r"C:/Program Files (x86)/PYAS/Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate("已开启"))
|
||||
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setStyleSheet("""
|
||||
QPushButton{
|
||||
@@ -2260,7 +2214,6 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
self.ini_config.write(open(r"Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
self.ini_config.write(open(r"C:/Program Files (x86)/PYAS/Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate("已关闭"))
|
||||
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setStyleSheet("""
|
||||
QPushButton{
|
||||
@@ -2276,7 +2229,6 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
self.ini_config.write(open(r"Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
self.ini_config.write(open(r"C:/Program Files (x86)/PYAS/Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate("已關閉"))
|
||||
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setStyleSheet("""
|
||||
QPushButton{
|
||||
@@ -2292,7 +2244,6 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
self.ini_config.write(open(r"Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
self.ini_config.write(open(r"C:/Program Files (x86)/PYAS/Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setText(self.text_Translate("已關閉"))
|
||||
self.ui.Show_Virus_Scan_Progress_Bar_switch_Button.setStyleSheet("""
|
||||
QPushButton{
|
||||
@@ -2342,7 +2293,6 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
self.ini_config.write(open(r"Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
self.ini_config.write(open(r"C:/Program Files (x86)/PYAS/Library/PYAS/Setup/PYAS.ini", 'w'))
|
||||
except Exception as e:
|
||||
pyas_bug_log(e)
|
||||
pass
|
||||
@@ -2404,6 +2354,7 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
try:
|
||||
if Qt.LeftButton and self.m_flag:
|
||||
self.move(QMouseEvent.globalPos()-self.m_Position)#更改窗口位置
|
||||
QApplication.processEvents()
|
||||
QMouseEvent.accept()
|
||||
except:
|
||||
pass
|
||||
@@ -2434,11 +2385,11 @@ If you do not download from the official website, we cannot guarantee the securi
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
pyas_library()
|
||||
pyasb_remove()
|
||||
pyasp_remove()
|
||||
pyas_library()
|
||||
pyas_version = "2.4.8"
|
||||
pyae_version = "2.1.9"
|
||||
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)# 自適應窗口縮放
|
||||
@@ -2453,4 +2404,4 @@ if __name__ == '__main__':
|
||||
pyas_bug_log(e)
|
||||
|
||||
####################################################################################
|
||||
#Copyright© 2020-2022 PYAS Python Antivirus Software.
|
||||
#Copyright© 2020-2022 87owo (PYAS Security)
|
||||
@@ -6,6 +6,8 @@ english_list = {
|
||||
"已关闭":"Off",
|
||||
"正在刪除: ":"Deleting: ",
|
||||
"正在删除":"Deleting: ",
|
||||
"安全密鑰錯誤":"Security Key Error",
|
||||
"安全密钥错误":"Security Key Error",
|
||||
"存取被拒":"Access denied",
|
||||
" > [提示] 尚未啟用實時防護":" > [Tips] Real-time Protect is not enabled",
|
||||
" > [提示] 尚未启用实时防护":" > [Tips] Real-time Protect is not enabled",
|
||||
@@ -25,6 +27,7 @@ english_list = {
|
||||
"✖當前已發現惡意軟體共{}項。":"✖A total of {} items of malware have been found so far.",
|
||||
'✔當前未發現惡意軟體。':'✔ No malware currently found.',
|
||||
'正在掃描: ':'Scanning: ',
|
||||
'正在扫描: ':'Scanning: ',
|
||||
"病毒掃描":"Virus scan",
|
||||
"正在初始化中,請稍後...":"Initializing, please wait...",
|
||||
"✖當前已發現惡意軟體。":"✖Malware has currently been detected.",
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'C:\Users\Windows\Documents\程式語言\Python\PYDT開發團隊\PYAS防毒軟體\PYAS_程式碼\MainUI.ui'
|
||||
# Form implementation generated from reading ui file 'C:\Users\Windows\Documents\Project\Python\PYDT開發團隊\PYAS防毒軟體\PYAS_程式碼\PYAS_UI.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.7
|
||||
#
|
||||
@@ -22,7 +22,7 @@ class Ui_MainWindow(object):
|
||||
MainWindow.setFont(font)
|
||||
MainWindow.setFocusPolicy(QtCore.Qt.TabFocus)
|
||||
icon = QtGui.QIcon()
|
||||
icon.addPixmap(QtGui.QPixmap("C:\\Users\\Windows\\Documents\\程式語言\\Python\\PYDT開發團隊\\PYAS防毒軟體\\PYAS_程式碼\\Library/Icon/ICON.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
icon.addPixmap(QtGui.QPixmap("Library/PYAS/Icon/ICON.bmp"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
|
||||
MainWindow.setWindowIcon(icon)
|
||||
MainWindow.setIconSize(QtCore.QSize(24, 24))
|
||||
MainWindow.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
|
||||
@@ -883,7 +883,7 @@ class Ui_MainWindow(object):
|
||||
self.Virus_Scan_widget.setStyleSheet("background-color:rgba(255, 255, 255,240);")
|
||||
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, 40, 201, 41))
|
||||
self.Virus_Scan_title.setGeometry(QtCore.QRect(45, 40, 281, 41))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(18)
|
||||
@@ -1068,7 +1068,7 @@ class Ui_MainWindow(object):
|
||||
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(320, 45, 151, 31))
|
||||
self.Virus_Scan_Solve_Button.setGeometry(QtCore.QRect(330, 45, 141, 31))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
@@ -1138,7 +1138,7 @@ class Ui_MainWindow(object):
|
||||
self.Virus_Scan_Break_Button.setFlat(False)
|
||||
self.Virus_Scan_Break_Button.setObjectName("Virus_Scan_Break_Button")
|
||||
self.Virus_Scan_ProgressBar = QtWidgets.QProgressBar(self.Virus_Scan_widget)
|
||||
self.Virus_Scan_ProgressBar.setGeometry(QtCore.QRect(45, 158, 591, 20))
|
||||
self.Virus_Scan_ProgressBar.setGeometry(QtCore.QRect(45, 137, 581, 21))
|
||||
self.Virus_Scan_ProgressBar.setProperty("value", 0)
|
||||
self.Virus_Scan_ProgressBar.setTextVisible(False)
|
||||
self.Virus_Scan_ProgressBar.setObjectName("Virus_Scan_ProgressBar")
|
||||
@@ -1190,7 +1190,7 @@ class Ui_MainWindow(object):
|
||||
self.State_output.setTextInteractionFlags(QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse)
|
||||
self.State_output.setObjectName("State_output")
|
||||
self.State_log = QtWidgets.QLabel(self.State_widget)
|
||||
self.State_log.setGeometry(QtCore.QRect(95, 280, 481, 41))
|
||||
self.State_log.setGeometry(QtCore.QRect(95, 280, 481, 31))
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("Microsoft YaHei")
|
||||
font.setPointSize(11)
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<RCC/>
|
||||
@@ -1731,7 +1731,7 @@ QPushButton:pressed
|
||||
<rect>
|
||||
<x>45</x>
|
||||
<y>40</y>
|
||||
<width>201</width>
|
||||
<width>281</width>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -2090,9 +2090,9 @@ QPushButton:pressed
|
||||
<widget class="QPushButton" name="Virus_Scan_Solve_Button">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>320</x>
|
||||
<x>330</x>
|
||||
<y>45</y>
|
||||
<width>151</width>
|
||||
<width>141</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -2245,9 +2245,9 @@ QPushButton:hover
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>45</x>
|
||||
<y>158</y>
|
||||
<width>591</width>
|
||||
<height>20</height>
|
||||
<y>137</y>
|
||||
<width>581</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="value">
|
||||
@@ -2365,7 +2365,7 @@ QPushButton:hover
|
||||
<x>95</x>
|
||||
<y>280</y>
|
||||
<width>481</width>
|
||||
<height>41</height>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
@@ -1,7 +1,7 @@
|
||||
import pyinstaller_versionfile
|
||||
pyinstaller_versionfile.create_versionfile(
|
||||
output_file="versionfile.txt",
|
||||
version='2.4.8',
|
||||
version='2.5.0',
|
||||
company_name="PYAS Security",
|
||||
file_description="Python Antivirus Software",
|
||||
internal_name="PYAS",
|
||||
@@ -1,5 +1,5 @@
|
||||
# PYAS (Python Antivirus Software)
|
||||
PYAS is not only free and open source without advertising, Also built-in a large number of databases for offline use, Always protect user privacy and security.
|
||||
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.
|
||||

|
||||
|
||||
|
||||
@@ -11,13 +11,16 @@ https://github.com/87owo/PYAS
|
||||
https://virusshare.com/hashes ,
|
||||
https://github.com/87owo/ViruslistMD5/releases
|
||||
|
||||
## 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
|
||||
|
||||
## Import Module
|
||||
os, sys, psutil, subprocess, cryptocode, threading, configparser, datetime, webbrowser, pefile, PYAS_English, pefile, hashlib, PyQt5, PYAS_UI, pywin32
|
||||
os, sys, psutil, subprocess, cryptocode, threading, configparser, datetime, webbrowser, PYAS_English, pefile, hashlib, PyQt5, PYAS_UI, pywin32
|
||||
|
||||
## Special Thanks
|
||||
Wix, Avast, Github, Google, Python, Microsoft, VirusTotal, VirusShare, mtkiao129, LenStevens
|
||||
|
||||
Copyright© 2020~2022 PYAS Security
|
||||
Copyright© 2020~2022 PYAS Security By 87owo
|
||||
Reference in new issue
Block a user