Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3507802eb9 | ||
|
|
9588bdb7cc |
@@ -1,8 +1,8 @@
|
||||
####################################################################################
|
||||
# Coding Python 3 UTF-8 (Python IDLE)
|
||||
#
|
||||
# PYAS Ver: PYAS V2.1.8 (2020.12.17)
|
||||
# PYAE Ver: PYAS V1.2.3 (2022.03.04)
|
||||
# PYAS Ver: PYAS V2.2.0 (2020.12.17)
|
||||
# PYAE Ver: PYAE V1.2.4 (2022.03.04)
|
||||
# Support: Windows 7,8,10,11 64-bit
|
||||
#
|
||||
# PYAS Git: https://github.com/87owo/PYAS
|
||||
@@ -14,8 +14,8 @@
|
||||
####################################################################################
|
||||
|
||||
#版本資訊
|
||||
pyas_virsion = '2.1.8'
|
||||
pyae_virsion = '1.2.3'
|
||||
pyas_version = '2.2.0'
|
||||
pyae_version = '1.2.4'
|
||||
dev_edition_times = 0
|
||||
pyas_copyright = 'Copyright© 2020-2022 PYAS Python Antivirus Software.'
|
||||
pyas_legal_copyright = 'Copyright© 2020-2022 PYAS'
|
||||
@@ -27,7 +27,7 @@ pyas_legal_copyright = 'Copyright© 2020-2022 PYAS'
|
||||
import pyinstaller_versionfile
|
||||
pyinstaller_versionfile.create_versionfile(
|
||||
output_file="versionfile.txt",
|
||||
version=pyas_virsion,
|
||||
version=pyas_version,
|
||||
company_name="PYAS",
|
||||
file_description="Python Antivirus Software",
|
||||
internal_name="PYAS",
|
||||
@@ -88,7 +88,7 @@ pyas_divider = '='*80
|
||||
|
||||
#載入模組套件
|
||||
try:
|
||||
import os, time, sys, psutil, socket, subprocess, binascii, platform, cryptocode, webbrowser, requests, threading, pygame, pathlib
|
||||
import os, time, sys, psutil, socket, subprocess, binascii, platform, cryptocode, webbrowser, requests, threading, pygame, pathlib, virustotal_python
|
||||
from cv2 import VideoCapture
|
||||
from ctypes import windll
|
||||
import requests as req
|
||||
@@ -96,6 +96,7 @@ try:
|
||||
from hashlib import md5
|
||||
from tkinter import messagebox, filedialog
|
||||
from tkinter import *
|
||||
#from pprint import pprint
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
@@ -103,7 +104,7 @@ except Exception as e:
|
||||
|
||||
#載入窗口介面
|
||||
root = Tk()
|
||||
root.title('PYAS V'+pyas_virsion)
|
||||
root.title('PYAS V'+pyas_version)
|
||||
sx,sy = root.winfo_screenwidth(),root.winfo_screenheight()
|
||||
root.geometry('800x450+'+str(int(sx/2-400))+'+'+str(int(sy/2-225)))
|
||||
textPad=Text(root,undo=True)
|
||||
@@ -119,8 +120,11 @@ group.pack(anchor='e')
|
||||
|
||||
#觀迎使用
|
||||
en_welcome = '''Welcome To Python Antivirus Software !!!
|
||||
|
||||
========================================
|
||||
Language: Setting > Change Language
|
||||
Update: Setting > Software Settings
|
||||
========================================
|
||||
PYAS Version: 2.2.0, PYAE Version: 1.2.4
|
||||
'''#Help Info: About > PYAS Help
|
||||
|
||||
####################################################################################
|
||||
@@ -173,19 +177,26 @@ def pyas_scan_write_en(file):
|
||||
fe = ft.write(file+'\n')
|
||||
ft.close()
|
||||
|
||||
def pyas_scan_write_d_en(file):
|
||||
ft = open('Library/PYAS/Temp/PYASD.tmp','a',encoding='utf-8')
|
||||
fe = ft.write(file+'\n')
|
||||
ft.close()
|
||||
|
||||
#定義讀取紀錄
|
||||
def pyas_scan_read_en():
|
||||
try:
|
||||
ft = open('Library/PYAS/Temp/PYASV.tmp','r',encoding='utf-8')
|
||||
fe = ft.read()
|
||||
lines = ft.readlines()
|
||||
ft.close()
|
||||
ft = open('Library/PYAS/Temp/PYASV.tmp','r',encoding='utf-8')
|
||||
lines = len(ft.readlines())
|
||||
ft.close()
|
||||
pygame.mixer.init()
|
||||
pygame.mixer.music.set_volume(1.0)
|
||||
if not pygame.mixer.music.get_busy():
|
||||
pygame.mixer.music.load('./Library/PYAS/Audio/Virusfound.ogg')
|
||||
pygame.mixer.music.play()
|
||||
return en_virus_true+'\n'+pyas_divider+'\n'+fe###
|
||||
return en_virus_true+' ('+str(lines)+' items)'+'\n'+pyas_divider+'\n'+fe###
|
||||
except:
|
||||
pygame.mixer.init()
|
||||
pygame.mixer.music.set_volume(1.0)
|
||||
@@ -213,7 +224,10 @@ def pyas_scan_answer_en():
|
||||
pyas_clear()
|
||||
root.update()
|
||||
textPad.insert("insert", 'Deleting:'+'\n'+pyas_divider+'\n'+str(line))
|
||||
os.remove(str(line[:-1]))
|
||||
try:
|
||||
os.remove(str(line[:-1]))
|
||||
except:
|
||||
continue
|
||||
else:
|
||||
pass
|
||||
pyas_clear()
|
||||
@@ -235,7 +249,7 @@ def pyas_scan_answer_en():
|
||||
#定義更新選項
|
||||
def software_update_en():
|
||||
pyas_clear()
|
||||
webbrowser.open('https://xiaomi69ai.wixsite.com/pyas')
|
||||
webbrowser.open('https://xiaomi69ai.wixsite.com/pyas?lang=en')
|
||||
|
||||
def engine_update_en():
|
||||
if messagebox.askokcancel('Warning','Update Antivirus Engine ,Do You want to continue?', default="cancel", icon="warning"):
|
||||
@@ -264,7 +278,7 @@ def pyas_scan_start(file,rfp):
|
||||
readable_hash = md5(bytes).hexdigest();
|
||||
if str(readable_hash) in str(rfp):
|
||||
virus_found = True
|
||||
f.close()
|
||||
f.close()
|
||||
if not virus_found:
|
||||
return False
|
||||
else:
|
||||
@@ -334,6 +348,45 @@ def pyas_protect_init_en():
|
||||
#pyas_protect_init_en()
|
||||
####################################################################################
|
||||
|
||||
def input_virustotal_scan_en():
|
||||
pyas_clear()
|
||||
t=Toplevel(root)
|
||||
t.title('Virustotal Api Key')
|
||||
t.geometry('260x40')
|
||||
t.transient(root)
|
||||
Label(t,text=' KEY: ').grid(row=0,column=0,sticky='e')
|
||||
v=StringVar()
|
||||
e=Entry(t,width=20,textvariable=v)
|
||||
e.grid(row=0,column=1,padx=2,pady=2,sticky='we')
|
||||
e.focus_set()
|
||||
c=IntVar()
|
||||
fss = 0
|
||||
Button(t,text='OK',command=lambda :virustotal_scan_en(e.get())).grid(row=0,column=2,sticky='e'+'w',pady=2)
|
||||
|
||||
def virustotal_scan_en(key):
|
||||
pyas_clear()
|
||||
file = filedialog.askopenfilename()
|
||||
if file != '':
|
||||
try:
|
||||
with open(file,"rb") as f:
|
||||
bytes = f.read()
|
||||
readable_hash = md5(bytes).hexdigest();
|
||||
# The ID (either SHA-256, SHA-1 or MD5 hash) identifying the file
|
||||
FILE_ID = str(readable_hash)
|
||||
with virustotal_python.Virustotal(key) as vtotal:
|
||||
resp = vtotal.request(f"files/{FILE_ID}")
|
||||
FILE_ID = resp.data["id"]
|
||||
webbrowser.open('https://www.virustotal.com/gui/file/'+str(FILE_ID))
|
||||
f.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
else:
|
||||
pyas_clear()
|
||||
textPad.insert("insert", none_file_en+'\n')
|
||||
|
||||
#virustotal_scan()
|
||||
####################################################################################
|
||||
|
||||
#定義智能掃描
|
||||
def pyas_scan_smart_en():
|
||||
pyas_clear()
|
||||
@@ -423,21 +476,24 @@ def pyas_scan_path_en(path,rfp,rfn,fts):
|
||||
if os.path.isdir(fullpath):
|
||||
pyas_scan_path_en(fullpath,rfp,rfn,fts)
|
||||
else:
|
||||
if '.exe' in str(fd) or '.EXE' in str(fd):
|
||||
if 1:#'.exe' in str(fd) or '.EXE' in str(fd):
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", en_scaning+'\n'+pyas_divider+'\n'+fullpath)
|
||||
if pyas_scan_start(fullpath,rfp):
|
||||
pyas_scan_write_en(fullpath)
|
||||
else:
|
||||
pe = PE(fullpath)
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for function in entry.imports:
|
||||
root.update()
|
||||
if str(function.name) in rfn:
|
||||
fts = fts + 1
|
||||
if fts != 0:
|
||||
pyas_scan_write_en(str(fullpath))
|
||||
fts = 0
|
||||
try:
|
||||
pe = PE(fullpath)
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for function in entry.imports:
|
||||
root.update()
|
||||
if str(function.name) in rfn:
|
||||
fts = fts + 1
|
||||
if fts != 0:
|
||||
pyas_scan_write_en(str(fullpath))
|
||||
fts = 0
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", en_scaning+'\n'+pyas_divider+'\n'+fullpath)
|
||||
@@ -1089,8 +1145,8 @@ Official Email: [email protected]
|
||||
Official Github: https://github.com/87owo/PYAS
|
||||
Official Website: https://xiaomi69ai.wixsite.com/pyas
|
||||
PYAS Create Date: 2020/12/17
|
||||
PYAS Version: 2.1.8
|
||||
PYAE Version: 1.2.3
|
||||
PYAS Version: 2.2.0
|
||||
PYAE Version: 1.2.4
|
||||
Special Thanks: Wix, Avast, Github, Google, Python, Microsoft, VirusTotal, VirusShare, LenStevens
|
||||
Thanks For Using PYAS Python Antivirus Software'''
|
||||
pygame.mixer.init()
|
||||
@@ -1114,11 +1170,11 @@ Copyright© 2020-2022 PYAS Python Antivirus Software''')
|
||||
#about_pyas_en()
|
||||
def software_version_en():
|
||||
pyas_clear()
|
||||
messagebox.showinfo('Version','''Software Version: '''+pyas_virsion)
|
||||
messagebox.showinfo('Version','''Software Version: '''+pyas_version)
|
||||
|
||||
def engine_version_en():
|
||||
pyas_clear()
|
||||
messagebox.showinfo('Version','''Engine Version: '''+pyae_virsion)
|
||||
messagebox.showinfo('Version','''Engine Version: '''+pyae_version)
|
||||
|
||||
####################################################################################
|
||||
|
||||
@@ -1197,6 +1253,8 @@ def english():
|
||||
devmenu.add_command(label = 'Analyze EXE Hashes',command = exe_analyze_md5_en)
|
||||
devmenu.add_command(label = 'Analyze EXE Bytes',command = exe_analyze_file_en)
|
||||
devmenu.add_command(label = 'Analyze EXE Function',command = exe_analyze_function_en)
|
||||
devmenu.add_separator()
|
||||
devmenu.add_command(label = 'Online File Analyze',command = input_virustotal_scan_en)
|
||||
#devmenu.add_separator()
|
||||
#devmenu.add_command(label = 'Install Win10 System',command = install_windows10_en)
|
||||
#devmenu.add_command(label = 'Install Win11 System',command = install_windows11_en)
|
||||
@@ -1242,7 +1300,7 @@ Error Info: '''+str(e))
|
||||
|
||||
#定義防護
|
||||
def protect_threading_init_zh():
|
||||
if messagebox.askokcancel('Warning','''啟動實時防護需要 4GB 以上的 RAM,是否繼續?''', default="cancel", icon="warning"):
|
||||
if messagebox.askokcancel('Warning','''啟動實時防護需要 4GB 以上的記憶體,是否繼續?''', default="cancel", icon="warning"):
|
||||
pyas_clear()
|
||||
textPad.insert("insert", zh_init_file)
|
||||
root.update()
|
||||
@@ -1313,12 +1371,15 @@ def pyas_scan_read_zh():
|
||||
ft = open('Library/PYAS/Temp/PYASV.tmp','r',encoding='utf-8')
|
||||
fe = ft.read()
|
||||
ft.close()
|
||||
ft = open('Library/PYAS/Temp/PYASV.tmp','r',encoding='utf-8')
|
||||
lines = len(ft.readlines())
|
||||
ft.close()
|
||||
pygame.mixer.init()
|
||||
pygame.mixer.music.set_volume(1.0)
|
||||
if not pygame.mixer.music.get_busy():
|
||||
pygame.mixer.music.load('./Library/PYAS/Audio/Virusfound.ogg')
|
||||
pygame.mixer.music.play()
|
||||
return zh_virus_true+'\n'+pyas_divider+'\n'+fe
|
||||
return zh_virus_true+' ('+str(lines)+' 項)'+'\n'+pyas_divider+'\n'+fe
|
||||
except:
|
||||
pygame.mixer.init()
|
||||
pygame.mixer.music.set_volume(1.0)
|
||||
@@ -1346,7 +1407,10 @@ def pyas_scan_answer_zh():
|
||||
pyas_clear()
|
||||
root.update()
|
||||
textPad.insert("insert", '正在移除:'+'\n'+pyas_divider+'\n'+str(line))
|
||||
os.remove(str(line[:-1]))
|
||||
try:
|
||||
os.remove(str(line[:-1]))
|
||||
except:
|
||||
continue
|
||||
else:
|
||||
pass
|
||||
pyas_clear()
|
||||
@@ -1388,22 +1452,41 @@ def engine_update_zh():
|
||||
|
||||
####################################################################################
|
||||
|
||||
#定義開始掃描
|
||||
def pyas_scan_start(file,rfp):
|
||||
try:
|
||||
virus_found = False
|
||||
with open(file,"rb") as f:
|
||||
bytes = f.read()
|
||||
readable_hash = md5(bytes).hexdigest();
|
||||
if str(readable_hash) in str(rfp):
|
||||
virus_found = True
|
||||
f.close()
|
||||
if not virus_found:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
def input_virustotal_scan_zh():
|
||||
pyas_clear()
|
||||
t=Toplevel(root)
|
||||
t.title('Virustotal Api Key')
|
||||
t.geometry('260x40')
|
||||
t.transient(root)
|
||||
Label(t,text=' 密鑰: ').grid(row=0,column=0,sticky='e')
|
||||
v=StringVar()
|
||||
e=Entry(t,width=20,textvariable=v)
|
||||
e.grid(row=0,column=1,padx=2,pady=2,sticky='we')
|
||||
e.focus_set()
|
||||
c=IntVar()
|
||||
fss = 0
|
||||
Button(t,text='確定',command=lambda :virustotal_scan_zh(e.get())).grid(row=0,column=2,sticky='e'+'w',pady=2)
|
||||
|
||||
def virustotal_scan_zh(key):
|
||||
pyas_clear()
|
||||
file = filedialog.askopenfilename()
|
||||
if file != '':
|
||||
try:
|
||||
with open(file,"rb") as f:
|
||||
bytes = f.read()
|
||||
readable_hash = md5(bytes).hexdigest();
|
||||
# The ID (either SHA-256, SHA-1 or MD5 hash) identifying the file
|
||||
FILE_ID = str(readable_hash)
|
||||
with virustotal_python.Virustotal(key) as vtotal:
|
||||
resp = vtotal.request(f"files/{FILE_ID}")
|
||||
FILE_ID = resp.data["id"]
|
||||
webbrowser.open('https://www.virustotal.com/gui/file/'+str(FILE_ID))
|
||||
f.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
else:
|
||||
pyas_clear()
|
||||
textPad.insert("insert", none_file_zh+'\n')
|
||||
|
||||
####################################################################################
|
||||
|
||||
@@ -1500,21 +1583,24 @@ def pyas_scan_path_zh(path,rfp,rfn,fts):
|
||||
if os.path.isdir(fullpath):
|
||||
pyas_scan_path_zh(fullpath,rfp,rfn,fts)
|
||||
else:
|
||||
if '.exe' in str(fd) or '.EXE' in str(fd):
|
||||
if 1:#'.exe' in str(fd) or '.EXE' in str(fd):
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", zh_scaning+'\n'+pyas_divider+'\n'+fullpath)
|
||||
if pyas_scan_start(fullpath,rfp):
|
||||
pyas_scan_write_zh(fullpath)
|
||||
else:
|
||||
pe = PE(fullpath)
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for function in entry.imports:
|
||||
root.update()
|
||||
if str(function.name) in rfn:
|
||||
fts = fts + 1
|
||||
if fts != 0:
|
||||
pyas_scan_write_zh(str(fullpath))
|
||||
fts = 0
|
||||
try:
|
||||
pe = PE(fullpath)
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for function in entry.imports:
|
||||
root.update()
|
||||
if str(function.name) in rfn:
|
||||
fts = fts + 1
|
||||
if fts != 0:
|
||||
pyas_scan_write_zh(str(fullpath))
|
||||
fts = 0
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", zh_scaning+'\n'+pyas_divider+'\n'+fullpath)
|
||||
@@ -1895,7 +1981,7 @@ def input_custom_cmd_command_zh():
|
||||
t.title('自訂指令')
|
||||
t.geometry('260x40')
|
||||
t.transient(root)
|
||||
Label(t,text=' CMD: ').grid(row=0,column=0,sticky='e')
|
||||
Label(t,text=' 指令: ').grid(row=0,column=0,sticky='e')
|
||||
v=StringVar()
|
||||
e=Entry(t,width=20,textvariable=v)
|
||||
e.grid(row=0,column=1,padx=2,pady=2,sticky='we')
|
||||
@@ -1921,22 +2007,22 @@ def input_custom_regedit_command_zh():
|
||||
t.title('自訂指令')
|
||||
t.geometry('260x110')
|
||||
t.transient(root)
|
||||
Label(t,text=' Path: ').grid(row=0,column=0,sticky='e')
|
||||
Label(t,text=' 路徑: ').grid(row=0,column=0,sticky='e')
|
||||
v=StringVar()
|
||||
e=Entry(t,width=20,textvariable=v)
|
||||
e.grid(row=0,column=1,padx=2,pady=2,sticky='we')
|
||||
e.focus_set()
|
||||
Label(t,text=' Name: ').grid(row=1,column=0,sticky='e')
|
||||
Label(t,text=' 名稱: ').grid(row=1,column=0,sticky='e')
|
||||
v2=StringVar()
|
||||
e2=Entry(t,width=20,textvariable=v2)
|
||||
e2.grid(row=1,column=1,padx=2,pady=2,sticky='we')
|
||||
e2.focus_set()
|
||||
Label(t,text=' Type: ').grid(row=2,column=0,sticky='e')
|
||||
Label(t,text=' 類型: ').grid(row=2,column=0,sticky='e')
|
||||
v3=StringVar()
|
||||
e3=Entry(t,width=20,textvariable=v3)
|
||||
e3.grid(row=2,column=1,padx=2,pady=2,sticky='we')
|
||||
e3.focus_set()
|
||||
Label(t,text=' Num: ').grid(row=3,column=0,sticky='e')
|
||||
Label(t,text=' 數值: ').grid(row=3,column=0,sticky='e')
|
||||
v4=StringVar()
|
||||
e4=Entry(t,width=20,textvariable=v4)
|
||||
e4.grid(row=3,column=1,padx=2,pady=2,sticky='we')
|
||||
@@ -2172,8 +2258,8 @@ def about_pyas_zh():
|
||||
官方GIT: https://github.com/87owo/PYAS
|
||||
官方網站: https://xiaomi69ai.wixsite.com/pyas
|
||||
創立日期: 2020/12/17
|
||||
PYAS 版本: 2.1.8
|
||||
PYAE 版本: 1.2.3
|
||||
PYAS 版本: 2.2.0
|
||||
PYAE 版本: 1.2.4
|
||||
特別感謝: Wix, Avast, Github, Google, Python, Microsoft, VirusTotal, VirusShare, LenStevens
|
||||
感謝您使用 PYAS 防毒軟體'''
|
||||
pygame.mixer.init()
|
||||
@@ -2197,11 +2283,11 @@ PYAE 版本: 1.2.3
|
||||
|
||||
def software_version_zh():
|
||||
pyas_clear()
|
||||
messagebox.showinfo('Version','''防毒軟體版本: '''+pyas_virsion)
|
||||
messagebox.showinfo('Version','''防毒軟體版本: '''+pyas_version)
|
||||
|
||||
def engine_version_zh():
|
||||
pyas_clear()
|
||||
messagebox.showinfo('Version','''掃毒引擎版本: '''+pyae_virsion)
|
||||
messagebox.showinfo('Version','''掃毒引擎版本: '''+pyae_version)
|
||||
|
||||
####################################################################################
|
||||
|
||||
@@ -2279,6 +2365,8 @@ def traditional_chinese():
|
||||
devmenu.add_command(label = '分析 EXE 哈希',command = exe_analyze_md5_zh)
|
||||
devmenu.add_command(label = '分析 EXE 位元',command = exe_analyze_file_zh)
|
||||
devmenu.add_command(label = '分析 EXE 函數',command = exe_analyze_function_zh)
|
||||
devmenu.add_separator()
|
||||
devmenu.add_command(label = '線上檔案分析',command = input_virustotal_scan_zh)
|
||||
#devmenu.add_separator()
|
||||
#devmenu.add_command(label = '重灌 Win10 系統',command = install_windows10_zh)
|
||||
#devmenu.add_command(label = '重灌 Win11 系統',command = install_windows11_zh)
|
||||
@@ -2395,12 +2483,15 @@ def pyas_scan_read_cn():
|
||||
ft = open('Library/PYAS/Temp/PYASV.tmp','r',encoding='utf-8')
|
||||
fe = ft.read()
|
||||
ft.close()
|
||||
ft = open('Library/PYAS/Temp/PYASV.tmp','r',encoding='utf-8')
|
||||
lines = len(ft.readlines())
|
||||
ft.close()
|
||||
pygame.mixer.init()
|
||||
pygame.mixer.music.set_volume(1.0)
|
||||
if not pygame.mixer.music.get_busy():
|
||||
pygame.mixer.music.load('./Library/PYAS/Audio/Virusfound.ogg')
|
||||
pygame.mixer.music.play()
|
||||
return cn_virus_true+'\n'+pyas_divider+'\n'+fe
|
||||
return cn_virus_true+' ('+str(lines)+' 项)'+'\n'+pyas_divider+'\n'+fe
|
||||
except:
|
||||
pygame.mixer.init()
|
||||
pygame.mixer.music.set_volume(1.0)
|
||||
@@ -2428,7 +2519,10 @@ def pyas_scan_answer_cn():
|
||||
pyas_clear()
|
||||
root.update()
|
||||
textPad.insert("insert", '正在移除:'+'\n'+pyas_divider+'\n'+str(line))
|
||||
os.remove(str(line[:-1]))
|
||||
try:
|
||||
os.remove(str(line[:-1]))
|
||||
except:
|
||||
continue
|
||||
else:
|
||||
pass
|
||||
pyas_clear()
|
||||
@@ -2470,22 +2564,41 @@ def engine_update_cn():
|
||||
|
||||
####################################################################################
|
||||
|
||||
#定義開始掃描
|
||||
def pyas_scan_start(file,rfp):
|
||||
try:
|
||||
virus_found = False
|
||||
with open(file,"rb") as f:
|
||||
bytes = f.read()
|
||||
readable_hash = md5(bytes).hexdigest();
|
||||
if str(readable_hash) in str(rfp):
|
||||
virus_found = True
|
||||
f.close()
|
||||
if not virus_found:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
def input_virustotal_scan_cn():
|
||||
pyas_clear()
|
||||
t=Toplevel(root)
|
||||
t.title('Virustotal Api Key')
|
||||
t.geometry('260x40')
|
||||
t.transient(root)
|
||||
Label(t,text=' 密钥: ').grid(row=0,column=0,sticky='e')
|
||||
v=StringVar()
|
||||
e=Entry(t,width=20,textvariable=v)
|
||||
e.grid(row=0,column=1,padx=2,pady=2,sticky='we')
|
||||
e.focus_set()
|
||||
c=IntVar()
|
||||
fss = 0
|
||||
Button(t,text='确定',command=lambda :virustotal_scan_cn(e.get())).grid(row=0,column=2,sticky='e'+'w',pady=2)
|
||||
|
||||
def virustotal_scan_cn(key):
|
||||
pyas_clear()
|
||||
file = filedialog.askopenfilename()
|
||||
if file != '':
|
||||
try:
|
||||
with open(file,"rb") as f:
|
||||
bytes = f.read()
|
||||
readable_hash = md5(bytes).hexdigest();
|
||||
# The ID (either SHA-256, SHA-1 or MD5 hash) identifying the file
|
||||
FILE_ID = str(readable_hash)
|
||||
with virustotal_python.Virustotal(key) as vtotal:
|
||||
resp = vtotal.request(f"files/{FILE_ID}")
|
||||
FILE_ID = resp.data["id"]
|
||||
webbrowser.open('https://www.virustotal.com/gui/file/'+str(FILE_ID))
|
||||
f.close()
|
||||
except Exception as e:
|
||||
print(e)
|
||||
else:
|
||||
pyas_clear()
|
||||
textPad.insert("insert", none_file_cn+'\n')
|
||||
|
||||
####################################################################################
|
||||
|
||||
@@ -2582,21 +2695,24 @@ def pyas_scan_path_cn(path,rfp,rfn,fts):
|
||||
if os.path.isdir(fullpath):
|
||||
pyas_scan_path_cn(fullpath,rfp,rfn,fts)
|
||||
else:
|
||||
if '.exe' in str(fd) or '.EXE' in str(fd):
|
||||
if 1:#'.exe' in str(fd) or '.EXE' in str(fd):
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", cn_scaning+'\n'+pyas_divider+'\n'+fullpath)
|
||||
if pyas_scan_start(fullpath,rfp):
|
||||
pyas_scan_write_cn(fullpath)
|
||||
else:
|
||||
pe = PE(fullpath)
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for function in entry.imports:
|
||||
root.update()
|
||||
if str(function.name) in rfn:
|
||||
fts = fts + 1
|
||||
if fts != 0:
|
||||
pyas_scan_write_cn(str(fullpath))
|
||||
fts = 0
|
||||
try:
|
||||
pe = PE(fullpath)
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
for function in entry.imports:
|
||||
root.update()
|
||||
if str(function.name) in rfn:
|
||||
fts = fts + 1
|
||||
if fts != 0:
|
||||
pyas_scan_write_cn(str(fullpath))
|
||||
fts = 0
|
||||
except:
|
||||
pass
|
||||
else:
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", cn_scaning+'\n'+pyas_divider+'\n'+fullpath)
|
||||
@@ -2976,7 +3092,7 @@ def input_custom_cmd_command_cn():
|
||||
t.title('自订指令')
|
||||
t.geometry('260x40')
|
||||
t.transient(root)
|
||||
Label(t,text=' CMD: ').grid(row=0,column=0,sticky='e')
|
||||
Label(t,text=' 指令: ').grid(row=0,column=0,sticky='e')
|
||||
v=StringVar()
|
||||
e=Entry(t,width=20,textvariable=v)
|
||||
e.grid(row=0,column=1,padx=2,pady=2,sticky='we')
|
||||
@@ -3002,22 +3118,22 @@ def input_custom_regedit_command_cn():
|
||||
t.title('自订指令')
|
||||
t.geometry('260x110')
|
||||
t.transient(root)
|
||||
Label(t,text=' Path: ').grid(row=0,column=0,sticky='e')
|
||||
Label(t,text=' 路径: ').grid(row=0,column=0,sticky='e')
|
||||
v=StringVar()
|
||||
e=Entry(t,width=20,textvariable=v)
|
||||
e.grid(row=0,column=1,padx=2,pady=2,sticky='we')
|
||||
e.focus_set()
|
||||
Label(t,text=' Name: ').grid(row=1,column=0,sticky='e')
|
||||
Label(t,text=' 名称: ').grid(row=1,column=0,sticky='e')
|
||||
v2=StringVar()
|
||||
e2=Entry(t,width=20,textvariable=v2)
|
||||
e2.grid(row=1,column=1,padx=2,pady=2,sticky='we')
|
||||
e2.focus_set()
|
||||
Label(t,text=' Type: ').grid(row=2,column=0,sticky='e')
|
||||
Label(t,text=' 类型: ').grid(row=2,column=0,sticky='e')
|
||||
v3=StringVar()
|
||||
e3=Entry(t,width=20,textvariable=v3)
|
||||
e3.grid(row=2,column=1,padx=2,pady=2,sticky='we')
|
||||
e3.focus_set()
|
||||
Label(t,text=' Num: ').grid(row=3,column=0,sticky='e')
|
||||
Label(t,text=' 数值: ').grid(row=3,column=0,sticky='e')
|
||||
v4=StringVar()
|
||||
e4=Entry(t,width=20,textvariable=v4)
|
||||
e4.grid(row=3,column=1,padx=2,pady=2,sticky='we')
|
||||
@@ -3253,8 +3369,8 @@ def about_pyas_cn():
|
||||
官方GIT: https://github.com/87owo/PYAS
|
||||
官方网站: https://xiaomi69ai.wixsite.com/pyas
|
||||
创立日期: 2020/12/17
|
||||
PYAS 版本: 2.1.8
|
||||
PYAE 版本: 1.2.3
|
||||
PYAS 版本: 2.2.0
|
||||
PYAE 版本: 1.2.4
|
||||
特别感谢: Wix, Avast, Github, Google, Python, Microsoft, VirusTotal, VirusShare, LenStevens
|
||||
感谢您使用 PYAS 防毒软件'''
|
||||
pygame.mixer.init()
|
||||
@@ -3278,11 +3394,11 @@ PYAE 版本: 1.2.3
|
||||
|
||||
def software_version_cn():
|
||||
pyas_clear()
|
||||
messagebox.showinfo('Version','''防毒软件版本: '''+pyas_virsion)
|
||||
messagebox.showinfo('Version','''防毒软件版本: '''+pyas_version)
|
||||
|
||||
def engine_version_cn():
|
||||
pyas_clear()
|
||||
messagebox.showinfo('Version','''扫毒引擎版本: '''+pyae_virsion)
|
||||
messagebox.showinfo('Version','''扫毒引擎版本: '''+pyae_version)
|
||||
|
||||
###########################################################################################################################################################################################
|
||||
|
||||
@@ -3350,6 +3466,8 @@ def simplified_chinese():
|
||||
devmenu.add_command(label = '分析 EXE 哈希',command = exe_analyze_md5_cn)
|
||||
devmenu.add_command(label = '分析 EXE 位元',command = exe_analyze_file_cn)
|
||||
devmenu.add_command(label = '分析 EXE 函数',command = exe_analyze_function_cn)
|
||||
devmenu.add_separator()
|
||||
devmenu.add_command(label = '在线挡案分析',command = input_virustotal_scan_cn)
|
||||
#devmenu.add_separator()
|
||||
#devmenu.add_command(label = '重灌 Win10 系統',command = install_windows10_zh)
|
||||
#devmenu.add_command(label = '重灌 Win11 系統',command = install_windows11_zh)
|
||||
@@ -3398,11 +3516,11 @@ def pyas_key():
|
||||
pyas_clear()
|
||||
file = './PYAS.exe'
|
||||
if file != '':
|
||||
with open(file,"rb") as f:
|
||||
bytes = f.read()
|
||||
readable_hash = md5(bytes).hexdigest();
|
||||
f.close()
|
||||
try:
|
||||
with open(file,"rb") as f:
|
||||
bytes = f.read()
|
||||
readable_hash = md5(bytes).hexdigest();
|
||||
f.close()
|
||||
ft = open('./Library/PYAS/Setup/PYAS.key','r')
|
||||
fe = ft.read()
|
||||
ft.close()
|
||||
@@ -3416,8 +3534,7 @@ Official website: https://xiaomi69ai.wixsite.com/pyas''')
|
||||
messagebox.showerror('Error', '''The PYAS antivirus software you are using is not genuine. To ensure your safety, please download genuine antivirus software from the
|
||||
Official website: https://xiaomi69ai.wixsite.com/pyas''')
|
||||
else:
|
||||
pyas_clear()
|
||||
|
||||
pass
|
||||
|
||||
####################################################################################
|
||||
|
||||
@@ -3436,7 +3553,7 @@ def setup_pyas():
|
||||
else:
|
||||
english()
|
||||
except Exception as e:
|
||||
#messagebox.showinfo('Welcome',en_welcome)
|
||||
messagebox.showinfo('Welcome',en_welcome)
|
||||
english()
|
||||
try:
|
||||
pyas_key()
|
||||
|
||||
Reference in new issue
Block a user