Compare commits

...
24 Commits
Author SHA1 Message Date
PYDT 0d9ab96cf5 Add files via upload 2022-12-01 18:12:12 +08:00
PYDT 261420973e Add files via upload 2022-11-30 19:21:15 +08:00
PYDT d058101e8c Add files via upload 2022-11-30 18:26:35 +08:00
PYDT 128f39dcb3 Add files via upload 2022-11-29 20:18:54 +08:00
87owo 5d6cbf256a Rename Version_File.py to PYAS_Version_File.py 2022-11-28 23:21:40 +08:00
87owo c904c43c22 Delete PYAS_Version_File.py 2022-11-28 23:21:25 +08:00
87owo 401ec5eb6e Add files via upload 2022-11-28 23:20:14 +08:00
87owo 9a54f676fd Delete MainUI.ui 2022-11-28 23:20:00 +08:00
87owo a7f3167776 Add files via upload 2022-11-28 23:18:41 +08:00
87owo b3928e9677 Add files via upload 2022-11-28 23:17:12 +08:00
87owo de0bbdffe2 Update LICENSE.md 2022-11-28 12:57:37 +08:00
87owo 0cf835a3fb Add files via upload 2022-11-28 12:54:38 +08:00
87owo 527dbdaec3 Update LICENSE.md 2022-11-27 19:41:46 +08:00
87owo 3fee5ee3ee Add files via upload 2022-11-27 14:26:28 +08:00
87owo df62fa34d7 Rename Version_File.py to PYAS_Version_File.py 2022-11-27 14:25:40 +08:00
87owo 7a2709b612 Add files via upload 2022-11-26 18:56:08 +08:00
87owo 508c6e1f66 Add files via upload 2022-11-26 18:49:41 +08:00
87owo 2b4d282ec1 Delete test 2022-11-26 18:30:52 +08:00
87owo e977e27d79 test 2022-11-26 18:30:39 +08:00
mtkiao129 1f0693cec4 Create LICENSE.md 2022-11-26 18:00:55 +08:00
PYAS-Security 6e0492a4a3 Add files via upload 2022-11-26 17:53:02 +08:00
PYAS-Security 67eeaca923 Update README.md 2022-11-26 00:23:33 +08:00
mtkiao129 5b589b26d8 Delete .github/workflows directory 2022-11-25 22:44:29 +08:00
mtkiao129 65b821508b Create checkmarx-one.yml 2022-11-25 22:36:35 +08:00
8 changed files with 268 additions and 300 deletions

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 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.
+30 -38
View File
@@ -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
+203 -249
View File
@@ -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© 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
from pefile import PE, DIRECTORY_ENTRY
from hashlib import md5, sha1, sha256
from PYAS_English import english_list
from PyQt5.QtWidgets import *
@@ -25,31 +36,9 @@ 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):
try:
print('[Error] '+str(e))
ft = open('Library/PYAS/Temp/PYASB.log','a',encoding='utf-8')
fe = ft.write(str(e)+'\n')
ft.close()
except:
pass
##################################### 測試版項目 ####################################
def pyas_vl_md5r():#不穩定
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():
@@ -337,24 +326,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) 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) # 阴影半径
@@ -518,7 +494,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© "+str(cy)+" 87owo (PYAS Security)"))
try:
vl = open('Library/PYAE/Hashes/Viruslist.num','r').read()
if int(vl)-1 < 0:
@@ -661,7 +637,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© "+str(cy)+" 87owo (PYAS Security)"))
try:
vl = open('Library/PYAE/Hashes/Viruslist.num','r').read()
if int(vl)-1 < 0:
@@ -804,7 +780,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© "+str(cy)+" 87owo (PYAS Security)"))
try:
vl = open('Library/PYAE/Hashes/Viruslist.num','r').read()
if int(vl)-1 < 0:
@@ -1127,31 +1103,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 +1178,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):
@@ -1262,36 +1202,40 @@ If you do not download from the official website, we cannot guarantee the securi
QApplication.processEvents()
try:
print('[INFO] Reading Viruslist Database')
with open('Library/PYAE/Hashes/Viruslist.md5','r') as fp:
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 and os.path.isfile(filepath) == True:
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:
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:
pe = PE(file)
fts = False
try:
if self.pyas_sign_start(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
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 +1245,46 @@ 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,fast_load=True)
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
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()
@@ -1330,11 +1314,16 @@ If you do not download from the official website, we cannot guarantee the securi
try:
print('[INFO] Reading Viruslist Database')
with open('Library/PYAE/Hashes/Viruslist.md5','r') as fp:
QApplication.processEvents()
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:
QApplication.processEvents()
rfn = fn.read()
fn.close()
else:
rfn = ''
except Exception as e:
pyas_bug_log(e)
self.pyas_scan_path_en(file,rfp,rfn,False)
@@ -1370,6 +1359,7 @@ If you do not download from the official website, we cannot guarantee the securi
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:
@@ -1409,68 +1399,42 @@ 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:
pass
else:
root, extension = os.path.splitext(fd)
sfd = str(extension).lower()
if 'C:/Program' in fullpath:
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']
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:
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:
@@ -1739,8 +1703,8 @@ If you do not download from the official website, we cannot guarantee the securi
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 +1713,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,19 +1722,19 @@ 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()
@@ -1831,7 +1795,7 @@ If you do not download from the official website, we cannot guarantee the securi
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)
pe = PE(file,fast_load=True)
self.ui.Analyze_EXE_Output.setText("")
for entry in pe.DIRECTORY_ENTRY_IMPORT:
for function in entry.imports:
@@ -1861,7 +1825,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,7 +1902,7 @@ 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 'AppData' in fullpath or 'PerfLogs' in fullpath:
pass
else:
if os.path.isdir(fullpath):
@@ -2111,18 +2075,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 +2108,42 @@ 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
#print('[INFO] Real-time Protect Process Refresh')
for p in psutil.process_iter():
try:
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()
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()))
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 +2180,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 +2187,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 +2202,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 +2217,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 +2232,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 +2247,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 +2296,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 +2357,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
@@ -2437,8 +2391,8 @@ if __name__ == '__main__':
pyasb_remove()
pyasp_remove()
pyas_library()
pyas_version = "2.4.8"
pyae_version = "2.1.9"
pyas_version = "2.4.9"
pyae_version = "2.2.0"
threading.Thread(target = pyas_vl_update).start()
QtCore.QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)# 自適應窗口縮放
QtGui.QGuiApplication.setAttribute(Qt.HighDpiScaleFactorRoundingPolicy.PassThrough)# 自適應窗口縮放
@@ -2453,4 +2407,4 @@ if __name__ == '__main__':
pyas_bug_log(e)
####################################################################################
#Copyright© 2020-2022 PYAS Python Antivirus Software.
#Copyright© 2022 87owo (PYAS Security)
+1
View File
@@ -25,6 +25,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.",
+5 -5
View File
@@ -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_程式碼\MainUI.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/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")
+6 -6
View File
@@ -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">
+1 -1
View File
@@ -1,7 +1,7 @@
import pyinstaller_versionfile
pyinstaller_versionfile.create_versionfile(
output_file="versionfile.txt",
version='2.4.8',
version='2.4.9',
company_name="PYAS Security",
file_description="Python Antivirus Software",
internal_name="PYAS",
+1 -1
View File
@@ -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.
![PYAS](https://user-images.githubusercontent.com/85057800/202692146-e55848d5-7e24-405d-b33d-f4fa3883fba6.png)