Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d97c634fd | ||
|
|
82f9f450d1 | ||
|
|
30850eb964 | ||
|
|
4bde6f22e8 | ||
|
|
6072d2db2d | ||
|
|
2dfa73ba67 | ||
|
|
3d72861627 | ||
|
|
0980449e99 | ||
|
|
11408e5816 | ||
|
|
12cd3e5ff3 |
No files matched your search
+177
@@ -0,0 +1,177 @@
|
||||
import hashlib
|
||||
import os
|
||||
from functools import partial
|
||||
import json
|
||||
import zipfile
|
||||
|
||||
def md5_file():
|
||||
for i in range(410):
|
||||
x = 5 - len(str(i))
|
||||
y = '0'*x+str(i)
|
||||
bytes = zipfile.ZipFile('Library/MD5.zip', 'r').read(str(y)+'.md5')
|
||||
|
||||
|
||||
#def pyae_scan():
|
||||
|
||||
def scan_sha256(file):
|
||||
try:
|
||||
virus_found = False
|
||||
with open(file,"rb") as f:
|
||||
bytes = f.read()
|
||||
readable_hash = hashlib.sha256(bytes).hexdigest();
|
||||
print("SHA256: " + readable_hash)
|
||||
with open("Library/SHA256.txt",'r') as f:
|
||||
lines = [line.rstrip() for line in f]
|
||||
for line in lines:
|
||||
if str(readable_hash) == str(line.split(";")[0]):
|
||||
virus_found = True
|
||||
f.close()
|
||||
if not virus_found:
|
||||
print("File is safe!")
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
#print("Virus detected! File quarentined")
|
||||
#os.remove(file)
|
||||
except:
|
||||
pass
|
||||
|
||||
def scan_md5(file):
|
||||
#try:
|
||||
virus_found = False
|
||||
with open(file,"rb") as f:
|
||||
bytes = f.read()
|
||||
readable_hash = hashlib.md5(bytes).hexdigest();
|
||||
#print("MD5: " + readable_hash)
|
||||
for i in range(410):
|
||||
x = 5 - len(str(i))
|
||||
y = '0'*x+str(i)
|
||||
with open('Library/MD5/'+str(y)+'.md5','r') as f:
|
||||
#print(str(f))
|
||||
lines = [line.rstrip() for line in f]
|
||||
for line in lines:
|
||||
if str(readable_hash) == str(line.split(";")[0]):
|
||||
#print(str(f))
|
||||
virus_found = True
|
||||
f.close()
|
||||
if not virus_found:
|
||||
#print("File is safe!")
|
||||
return False
|
||||
else:
|
||||
#print("Virus detected! File quarentined")
|
||||
#os.remove(file)
|
||||
return True
|
||||
#except Exception as e:
|
||||
# print(e)
|
||||
|
||||
|
||||
def scan(file):
|
||||
try:
|
||||
virus_found = False
|
||||
with open(file,"rb") as f:
|
||||
bytes = f.read()
|
||||
readable_hash = hashlib.sha1(bytes).hexdigest();
|
||||
print("SHA1: " + readable_hash)
|
||||
with open('Library/SHA1 HASHES.json', 'r') as f:
|
||||
dataset = json.loads(f.read())
|
||||
for index, item in enumerate(dataset["data"]):
|
||||
if str(item['hash']) == str(readable_hash):
|
||||
virus_found = True
|
||||
f.close()
|
||||
if not virus_found:
|
||||
print("File is safe!")
|
||||
return False
|
||||
else:
|
||||
#print("Virus detected! File quarentined")
|
||||
#os.remove(file)
|
||||
return True
|
||||
except:
|
||||
pass
|
||||
|
||||
def pyae_scan_full(filepath):
|
||||
try:
|
||||
fss = 0
|
||||
start = time.time()
|
||||
findfile('A:/',ffile,fss,start)
|
||||
findfile('B:/',ffile,fss,start)
|
||||
findfile('C:/',ffile,fss,start)
|
||||
findfile('D:/',ffile,fss,start)
|
||||
findfile('E:/',ffile,fss,start)
|
||||
findfile('F:/',ffile,fss,start)
|
||||
findfile('G:/',ffile,fss,start)
|
||||
findfile('H:/',ffile,fss,start)
|
||||
findfile('I:/',ffile,fss,start)
|
||||
findfile('J:/',ffile,fss,start)
|
||||
findfile('K:/',ffile,fss,start)
|
||||
findfile('L:/',ffile,fss,start)
|
||||
findfile('M:/',ffile,fss,start)
|
||||
findfile('N:/',ffile,fss,start)
|
||||
findfile('O:/',ffile,fss,start)
|
||||
findfile('P:/',ffile,fss,start)
|
||||
findfile('Q:/',ffile,fss,start)
|
||||
findfile('R:/',ffile,fss,start)
|
||||
findfile('S:/',ffile,fss,start)
|
||||
findfile('T:/',ffile,fss,start)
|
||||
findfile('U:/',ffile,fss,start)
|
||||
findfile('V:/',ffile,fss,start)
|
||||
findfile('W:/',ffile,fss,start)
|
||||
findfile('X:/',ffile,fss,start)
|
||||
findfile('Y:/',ffile,fss,start)
|
||||
findfile('Z:/',ffile,fss,start)
|
||||
end = time.time()
|
||||
ft = open('PYASF.txt','r')
|
||||
fe = ft.read()
|
||||
ft.close()
|
||||
textPad.insert("insert", '''
|
||||
尋找結果: '''+'''
|
||||
============================================================================
|
||||
|
||||
'''+str(fe)+'''============================================================================
|
||||
總共耗時: '''+str(end - start)+''' 秒''')
|
||||
os.remove('PYASF.txt')
|
||||
except:
|
||||
pass
|
||||
|
||||
def findfile(path,ffile,fss,start):
|
||||
textPad.delete(1.0,END)
|
||||
try:
|
||||
textPad.insert("insert", '正在尋找: '+str(path))
|
||||
for fd in os.listdir(path):
|
||||
root.update()
|
||||
fullpath = os.path.join(path,fd)
|
||||
if os.path.isdir(fullpath):
|
||||
#print('正在掃描: ',fullpath)
|
||||
findfile(fullpath,ffile,fss,start)
|
||||
else:
|
||||
fss = fss + 1
|
||||
if ffile in str(fd):
|
||||
date = time.ctime(os.path.getmtime(fullpath))
|
||||
#try:
|
||||
#f = open(fullpath, 'r')
|
||||
#text = f.readline()
|
||||
#f.close()
|
||||
#print('預覽內容: '+text)
|
||||
#except:
|
||||
#print('預覽內容: ✖錯誤,這個檔案不支援預覽')
|
||||
ft = open('PYASF.txt','a')
|
||||
ft.write('''找到檔案: '''+str(fullpath)+'''
|
||||
建立日期: '''+str(date)+'''
|
||||
|
||||
''')
|
||||
ft.close()
|
||||
continue
|
||||
except:
|
||||
pass
|
||||
|
||||
#scan(filepath)
|
||||
#scan_md5(filepath)
|
||||
#scan_sha256(filepath)
|
||||
#ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa.exe
|
||||
def pyae_file_scan(file):
|
||||
if scan_md5(file):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
#if scan(file) or scan_sha256(file) or scan_md5(file):
|
||||
|
||||
File renamed without changes.
@@ -1,9 +1,11 @@
|
||||
import os
|
||||
import cv2
|
||||
import time
|
||||
import random
|
||||
import string
|
||||
import sys
|
||||
import ctypes
|
||||
import psutil
|
||||
import shutil
|
||||
import socket
|
||||
import webbrowser
|
||||
@@ -14,8 +16,14 @@ import hashlib
|
||||
import getpass
|
||||
import json
|
||||
import stat
|
||||
#import threading
|
||||
#import pyclamd
|
||||
import zipfile
|
||||
import platform
|
||||
import cryptocode
|
||||
import tkinter as tk
|
||||
#import pandas as pd
|
||||
from tkinter import ttk
|
||||
from tkinter import *
|
||||
from os import listdir
|
||||
#import pyinstaller_versionfile
|
||||
@@ -23,22 +31,23 @@ from tkinter import filedialog
|
||||
from tkinter.messagebox import *
|
||||
from functools import partial
|
||||
from os.path import isfile, isdir, join
|
||||
from Expansion_pack.list import *
|
||||
from Expansion_pack import *
|
||||
from Library.list import *
|
||||
from Library import *
|
||||
from Library import PYAE
|
||||
'''
|
||||
pyinstaller_versionfile.create_versionfile(
|
||||
output_file="versionfile.txt",
|
||||
version="1.6.3",
|
||||
version="1.9.0",
|
||||
company_name="PYAS",
|
||||
file_description="Python Antivirus Software",
|
||||
internal_name="PYAS",
|
||||
legal_copyright="Copyright© 2020-2021 PYAS Python Antivirus Software.",
|
||||
legal_copyright="Copyright© 2020-2022 PYAS Python Antivirus Software.",
|
||||
original_filename="PYAS.exe",
|
||||
product_name="PYAS"
|
||||
)
|
||||
'''
|
||||
root = Tk()
|
||||
root.title('PYAS V1.6.3')
|
||||
root.title('PYAS V1.9.0')
|
||||
#root.resizable(0,0)
|
||||
root.geometry('800x450')
|
||||
textPad=Text(root,undo=True)
|
||||
@@ -47,9 +56,19 @@ scroll=Scrollbar(textPad)
|
||||
textPad.config(yscrollcommand=scroll.set)
|
||||
scroll.config(command=textPad.yview)
|
||||
scroll.pack(side=RIGHT,fill=Y)
|
||||
group = Label(root, text="Copyright© 2020-2021 PYAS Python Antivirus Software",padx=5, pady=2)
|
||||
group = Label(root, text="Copyright© 2020-2022 PYAS Python Antivirus Software",padx=5, pady=2)
|
||||
group.pack(anchor='e')
|
||||
|
||||
def c_to_msert():
|
||||
ft = open('Library/PYASE.ini','w')
|
||||
ft.write('''microsoft_engine''')
|
||||
ft.close()
|
||||
|
||||
def c_to_pyae():
|
||||
ft = open('Library/PYASE.ini','w')
|
||||
ft.write('''pyae_engine''')
|
||||
ft.close()
|
||||
|
||||
def pyas_license_terms():
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", '''PYTHON ANTIVIRUS SOFTWARE LICENSE TERMS
|
||||
@@ -124,6 +143,81 @@ This limitation applies to
|
||||
It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
|
||||
''')
|
||||
|
||||
#lock = threading.Lock()
|
||||
|
||||
def pyclamd_scan():
|
||||
textPad.delete(1.0,END)
|
||||
try:
|
||||
cd = pyclamd.ClamdAgnostic()
|
||||
cd.reload()
|
||||
if cd.scan_file(filedialog.askopenfilename()) == None:
|
||||
textPad.insert("insert", '✔此檔案目前沒有惡意')
|
||||
else:
|
||||
textPad.insert("insert", '✖此檔案可能含有惡意內容')
|
||||
except Exception as e:
|
||||
textPad.insert("insert", '✖啟動失敗,錯誤資訊: '+str(e))
|
||||
|
||||
def threading_cmd(tcmd):
|
||||
stcmd=threading.Thread(target=tcmd)
|
||||
stcmd.start()
|
||||
#stcmd.join()
|
||||
#lock.acquire()
|
||||
#lock.release()
|
||||
|
||||
def zip_dir():
|
||||
path = filedialog.askdirectory()
|
||||
zf = zipfile.ZipFile('{}.zip'.format(path), 'w', zipfile.ZIP_DEFLATED)
|
||||
for root, dirs, files in os.walk(path):
|
||||
for file_name in files:
|
||||
zf.write(os.path.join(root, file_name))
|
||||
|
||||
def computer_info():
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", '''
|
||||
系統版本資訊:
|
||||
============================================================================
|
||||
''')
|
||||
textPad.insert("insert", platform.platform())
|
||||
textPad.insert("insert", '''
|
||||
''')
|
||||
textPad.insert("insert", platform.architecture())
|
||||
textPad.insert("insert", '''
|
||||
''')
|
||||
textPad.insert("insert", platform.node())
|
||||
textPad.insert("insert", '''
|
||||
''')
|
||||
textPad.insert("insert", platform.processor())
|
||||
textPad.insert("insert", '''
|
||||
''')
|
||||
|
||||
def camera_is_open_check():
|
||||
textPad.delete(1.0,END)
|
||||
try:
|
||||
cap = cv2.VideoCapture(0)
|
||||
ret, frame = cap.read()
|
||||
if ret:
|
||||
textPad.insert("insert", '✔當前攝像頭屬於關閉狀態。')
|
||||
cap.release()
|
||||
else:
|
||||
textPad.insert("insert", '✖當前攝像頭已被其他應用程式占用,可能會有隱私風險。')
|
||||
cap.release()
|
||||
except:
|
||||
textPad.insert("insert", '✖當前攝像頭檢測異常,可能會有隱私風險。')
|
||||
|
||||
def camera_is_open_check_en():
|
||||
textPad.delete(1.0,END)
|
||||
try:
|
||||
cap = cv2.VideoCapture(0)
|
||||
ret, frame = cap.read()
|
||||
if ret:
|
||||
textPad.insert("insert", '✔The current camera is in the off state.')
|
||||
cap.release()
|
||||
else:
|
||||
textPad.insert("insert", '✖The current camera is already occupied by other applications, and there may be privacy risks.')
|
||||
cap.release()
|
||||
except:
|
||||
textPad.insert("insert", '✖The current camera detects abnormalities, and there may be privacy risks.')
|
||||
|
||||
def input_pyas_key():
|
||||
textPad.delete(1.0,END)
|
||||
t=Toplevel(root)
|
||||
@@ -159,6 +253,7 @@ def exe_ca():
|
||||
textPad.delete(1.0,END)
|
||||
pe = pefile.PE(filedialog.askopenfilename())
|
||||
for section in pe.sections:
|
||||
root.update()
|
||||
textPad.insert("insert", section.Name, hex(section.VirtualAddress),
|
||||
hex(section.Misc_VirtualSize), section.SizeOfRawData)
|
||||
|
||||
@@ -166,30 +261,56 @@ def exe_cb():
|
||||
textPad.delete(1.0,END)
|
||||
pe = pefile.PE(filedialog.askopenfilename())
|
||||
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
||||
ft = open('PYASF.txt','a')
|
||||
root.update()
|
||||
ft = open('Library/PYASD.txt','a')
|
||||
ft.write(str(entry.dll)+'''
|
||||
''')
|
||||
ft.close()
|
||||
#textPad.insert("insert", entry.dll)
|
||||
for function in entry.imports:
|
||||
ft = open('PYASF.txt','a')
|
||||
ft = open('Library/PYASD.txt','a')
|
||||
ft.write(str(function.name)+'''
|
||||
''')
|
||||
ft.close()
|
||||
#textPad.insert("insert", '\t', function.name)
|
||||
ft = open('PYASF.txt','r')
|
||||
ft = open('Library/PYASD.txt','r')
|
||||
fe = ft.read()
|
||||
ft.close()
|
||||
textPad.insert("insert",str(fe))
|
||||
os.remove('PYASF.txt')
|
||||
os.remove('Library/PYASD.txt')
|
||||
|
||||
def smart_scan():
|
||||
textPad.delete(1.0,END)
|
||||
f = open('FSCAN.bat','w',encoding="utf-8")
|
||||
f.write('''MSERT.exe /n''')
|
||||
f.close()
|
||||
os.system('start FSCAN.bat')
|
||||
#os.remove('FSCAN.bat')
|
||||
myfile = filedialog.askopenfilename()
|
||||
trying = myfile.find('.')
|
||||
trying2 = myfile.find('/.')
|
||||
trypath = myfile.find('/')
|
||||
trydot = myfile.find('"')
|
||||
tryos = myfile.find('PYAS.py')
|
||||
if tryos == -1:
|
||||
if trypath == -1:
|
||||
textPad.insert("insert", '✖輸入檔案錯誤,未選擇檔案')
|
||||
else:
|
||||
if trying == -1:
|
||||
textPad.insert("insert", '✖輸入檔案錯誤,沒有副檔名')
|
||||
elif trying == 0:
|
||||
textPad.insert("insert", '✖輸入檔案錯誤,沒有正檔名')
|
||||
else:
|
||||
if trydot == -1:
|
||||
if not trying2 == -1:
|
||||
textPad.insert("insert", '✖輸入檔案錯誤,沒有正檔名')
|
||||
else:
|
||||
#textPad.insert("insert", '掃描中,請耐心等待')
|
||||
if PYAE.pyae_file_scan(myfile):
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", '✖此檔案為惡意軟件,請立即移除此檔案')
|
||||
else:
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", '✔此檔案目前沒有惡意行為')
|
||||
|
||||
def smart_scan_m():
|
||||
textPad.delete(1.0,END)
|
||||
os.system('MSERT.exe /n')
|
||||
|
||||
def ai_scan():
|
||||
textPad.delete(1.0,END)
|
||||
@@ -219,11 +340,13 @@ def ai_scan():
|
||||
for entry in pefile.PE(myfile).DIRECTORY_ENTRY_IMPORT:
|
||||
#print(entry.dll)
|
||||
for function in entry.imports:
|
||||
root.update()
|
||||
#print('\t', function.name)
|
||||
#fe = function.name
|
||||
fe.append(function.name)
|
||||
cc = str(fe)
|
||||
for a in range(at):
|
||||
root.update()
|
||||
if at_list_winf[a] in str(cc) and a != t - 1:
|
||||
blist.append(at_list_winf[a])
|
||||
continue
|
||||
@@ -251,7 +374,12 @@ def ai_scan():
|
||||
if len(blist) == 0:
|
||||
textPad.insert("insert", '✔此檔案目前沒有高危險行為')
|
||||
else:
|
||||
textPad.insert("insert", '✖已檢測到可疑行為,可疑內容: '+ str(blist))
|
||||
textPad.insert("insert", '''
|
||||
✖已檢測到可疑行為,可疑內容:
|
||||
============================================================================
|
||||
|
||||
'''+ str(''',
|
||||
'''.join(blist))+'.')
|
||||
else:
|
||||
textPad.insert("insert", '✖輸入檔案錯誤,不能有引號')
|
||||
else:
|
||||
@@ -259,6 +387,17 @@ def ai_scan():
|
||||
|
||||
def input_antivirus_immediately():
|
||||
textPad.delete(1.0,END)
|
||||
try:
|
||||
pids = psutil.pids()
|
||||
textPad.insert("insert", '''
|
||||
已尋找到的檔案名稱:
|
||||
============================================================================
|
||||
''')
|
||||
for pid in pids:
|
||||
textPad.insert("insert",psutil.Process(pid).name()+'''
|
||||
''')
|
||||
except:
|
||||
pass
|
||||
t=Toplevel(root)
|
||||
t.title('檔案名稱')
|
||||
t.geometry('260x40')
|
||||
@@ -316,8 +455,8 @@ def reset_network():
|
||||
|
||||
def input_find_files():
|
||||
textPad.delete(1.0,END)
|
||||
if askokcancel('Warning','''執行過程需要一段時間,程式可能
|
||||
會暫時性停止運作,是否繼續?''', default="cancel", icon="warning"):
|
||||
'''
|
||||
if askokcancel('Warning','執行過程需要一段時間,程式可能會暫時性停止運作,是否繼續?', default="cancel", icon="warning"):
|
||||
t=Toplevel(root)
|
||||
t.title('檔案名稱')
|
||||
t.geometry('260x40')
|
||||
@@ -332,6 +471,19 @@ def input_find_files():
|
||||
Button(t,text='確定',command=lambda :find_files_info(e.get())).grid(row=0,column=2,sticky='e'+'w',pady=2)
|
||||
else:
|
||||
pass
|
||||
'''
|
||||
t=Toplevel(root)
|
||||
t.title('檔案名稱')
|
||||
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 :find_files_info(e.get())).grid(row=0,column=2,sticky='e'+'w',pady=2)
|
||||
|
||||
def find_files_info(ffile):
|
||||
textPad.delete(1.0,END)
|
||||
@@ -365,7 +517,7 @@ def find_files_info(ffile):
|
||||
findfile('Y:/',ffile,fss,start)
|
||||
findfile('Z:/',ffile,fss,start)
|
||||
end = time.time()
|
||||
ft = open('PYASF.txt','r')
|
||||
ft = open('Library/PYASF.txt','r')
|
||||
fe = ft.read()
|
||||
ft.close()
|
||||
textPad.insert("insert", '''
|
||||
@@ -374,13 +526,16 @@ def find_files_info(ffile):
|
||||
|
||||
'''+str(fe)+'''============================================================================
|
||||
總共耗時: '''+str(end - start)+''' 秒''')
|
||||
os.remove('PYASF.txt')
|
||||
os.remove('Library/PYASF.txt')
|
||||
except:
|
||||
pass
|
||||
|
||||
def findfile(path,ffile,fss,start):
|
||||
textPad.delete(1.0,END)
|
||||
try:
|
||||
textPad.insert("insert", '正在尋找: '+str(path))
|
||||
for fd in os.listdir(path):
|
||||
root.update()
|
||||
fullpath = os.path.join(path,fd)
|
||||
if os.path.isdir(fullpath):
|
||||
#print('正在掃描: ',fullpath)
|
||||
@@ -396,7 +551,7 @@ def findfile(path,ffile,fss,start):
|
||||
#print('預覽內容: '+text)
|
||||
#except:
|
||||
#print('預覽內容: ✖錯誤,這個檔案不支援預覽')
|
||||
ft = open('PYASF.txt','a')
|
||||
ft = open('Library/PYASF.txt','a')
|
||||
ft.write('''找到檔案: '''+str(fullpath)+'''
|
||||
建立日期: '''+str(date)+'''
|
||||
|
||||
@@ -410,6 +565,7 @@ def repair_system_files():
|
||||
textPad.delete(1.0,END)
|
||||
if askokcancel('Warning','''執行過程需要一段時間,程式可能
|
||||
會暫時性停止運作,是否繼續?''', default="cancel", icon="warning"):
|
||||
root.update()
|
||||
runc = os.system('''sfc /scannow''')
|
||||
if runc == 0:
|
||||
textPad.insert("insert", '✔成功: 執行成功。')
|
||||
@@ -430,6 +586,28 @@ def start_safe_mode():
|
||||
else:
|
||||
pass
|
||||
|
||||
def start_safe_mode_net():
|
||||
textPad.delete(1.0,END)
|
||||
if askokcancel('Warning','''啟動安全模式需要重新啟動,是否繼續?''', default="cancel", icon="warning"):
|
||||
textPad.delete(1.0,END)
|
||||
os.system('net user administrator /active:yes')
|
||||
os.system('bcdedit /set {default} safeboot network')
|
||||
time.sleep(1)
|
||||
os.system('shutdown -r -t 0')
|
||||
else:
|
||||
pass
|
||||
|
||||
def start_safe_mode_cmd():
|
||||
textPad.delete(1.0,END)
|
||||
if askokcancel('Warning','''啟動安全模式需要重新啟動,是否繼續?''', default="cancel", icon="warning"):
|
||||
textPad.delete(1.0,END)
|
||||
os.system('net user administrator /active:yes')
|
||||
os.system('bcdedit /set {default} safeboot minimal bcdedit /set {default} safebootalternateshell yes')
|
||||
time.sleep(1)
|
||||
os.system('shutdown -r -t 0')
|
||||
else:
|
||||
pass
|
||||
|
||||
def close_safe_Mode():
|
||||
textPad.delete(1.0,END)
|
||||
if askokcancel('Warning','''關閉安全模式需要重新啟動,是否繼續?''', default="cancel", icon="warning"):
|
||||
@@ -468,13 +646,14 @@ def input_system_autorun():
|
||||
textPad.delete(1.0,END)
|
||||
t=Toplevel(root)
|
||||
t.title('自訂指令')
|
||||
t.geometry('260x130')
|
||||
t.geometry('260x40')
|
||||
t.transient(root)
|
||||
Label(t,text=' 指令01: ').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=' 指令02: ').grid(row=1,column=0,sticky='e')
|
||||
v2=StringVar()
|
||||
e2=Entry(t,width=20,textvariable=v2)
|
||||
@@ -495,19 +674,19 @@ def input_system_autorun():
|
||||
e5=Entry(t,width=20,textvariable=v5)
|
||||
e5.grid(row=4,column=1,padx=2,pady=2,sticky='we')
|
||||
e5.focus_set()
|
||||
'''
|
||||
c=IntVar()
|
||||
fss = 0
|
||||
Button(t,text='確定',command=lambda :system_autorun(e.get(),e2.get(),e3.get(),e4.get(),e5.get())).grid(row=4,column=2,sticky='e'+'w',pady=0)
|
||||
Button(t,text='確定',command=lambda :system_autorun(e.get())).grid(row=0,column=2,sticky='e'+'w',pady=2)
|
||||
else:
|
||||
pass
|
||||
|
||||
def system_autorun(cmd1,cmd2,cmd3,cmd4,cmd5):
|
||||
def system_autorun(cmd1):
|
||||
textPad.delete(1.0,END)
|
||||
subprocess.run(cmd1, shell=True)
|
||||
subprocess.run(cmd2, shell=True)
|
||||
subprocess.run(cmd3, shell=True)
|
||||
subprocess.run(cmd4, shell=True)
|
||||
subprocess.run(cmd5, shell=True)
|
||||
f = open('%AppData%\Microsoft\Windows\Start Menu\Programs\Startup\ARUN.cmd','w')
|
||||
f.write(cmd1)
|
||||
f.close()
|
||||
textPad.insert("insert", '執行完畢。')
|
||||
|
||||
def input_custom_regedit_command():
|
||||
@@ -713,11 +892,13 @@ def receive_text(HOST,PORT):
|
||||
textPad.delete(1.0,END)
|
||||
max_connect = 5 # 最大連線數
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||
root.update()
|
||||
s.bind((HOST, int(PORT)))
|
||||
s.listen()
|
||||
conn, _ = s.accept()
|
||||
data = conn.recv(1024).decode()
|
||||
textPad.insert("insert",'接收到的內容: '+data)
|
||||
root.update()
|
||||
|
||||
def software_update():
|
||||
webbrowser.open('https://xiaomi69ai.wixsite.com/pyas')
|
||||
@@ -727,10 +908,13 @@ def website():
|
||||
|
||||
def about():
|
||||
showinfo('Copyright','''官方網站: https://xiaomi69ai.wixsite.com/pyas
|
||||
版權所有© 2020-2021 PYAS Python Antivirus Software''')
|
||||
版權所有© 2020-2022 PYAS Python Antivirus Software''')
|
||||
|
||||
def version():
|
||||
showinfo('Version','軟體版本: PYAS V1.6.3')
|
||||
showinfo('Version','軟體版本: PYAS V1.9.0')
|
||||
|
||||
def version_e():
|
||||
showinfo('Version','引擎版本: PYAS V1.0.0')
|
||||
|
||||
def is_admin():
|
||||
try:
|
||||
@@ -793,6 +977,11 @@ def traditional_chinese():
|
||||
sitmenu = Menu(filemenu5,tearoff=False)
|
||||
filemenu5.add_cascade(label='軟體設置', menu=sitmenu, underline=0)
|
||||
sitmenu.add_command(label="更新軟體", command=software_update)
|
||||
sitmenu.add_separator()
|
||||
sitmenu.add_command(label="更換成 Microsoft 引擎 (預設)", command=set_microsoft_engine)
|
||||
sitmenu.add_command(label="更換成 PyclamdAV 引擎 (測試)", command=set_pyclamdav_engine)
|
||||
sitmenu.add_separator()
|
||||
sitmenu.add_command(label="更換成 PYAE 引擎 (尚未開放)", command=set_pyae_engine)
|
||||
#sitwmenu = Menu(sitmenu,tearoff=False)
|
||||
#filemenu5.add_cascade(label='字體大小', menu=sitwmenu, underline=0)
|
||||
#sitwmenu.add_command(label="增大字體", command=sizeb)
|
||||
@@ -819,13 +1008,13 @@ def traditional_chinese_pro():
|
||||
textPad.delete(1.0,END)
|
||||
if is_admin():
|
||||
try:
|
||||
ft = open('PYASL.ini','w')
|
||||
ft = open('Library/PYASL.ini','w')
|
||||
ft.write('''traditional_chinese''')
|
||||
ft.close()
|
||||
menubar = Menu(root)
|
||||
root.config(menu = menubar)
|
||||
filemenu = Menu(menubar,tearoff=False)
|
||||
filemenu.add_command(label = '智能掃描',command = smart_scan)
|
||||
filemenu.add_command(label = '智能掃描',command = setup_pyeg)
|
||||
filemenu.add_command(label = '智能分析',command = ai_scan)
|
||||
menubar.add_cascade(label = ' 掃描',menu = filemenu)
|
||||
filemenu2 = Menu(menubar,tearoff=False)
|
||||
@@ -845,7 +1034,16 @@ def traditional_chinese_pro():
|
||||
sub2menu.add_command(label = '修復系統權限',command = fix_cmd_permissions)
|
||||
sub2menu.add_separator()
|
||||
sub2menu.add_command(label = '啟動安全模式',command = start_safe_mode)
|
||||
#sub2menu.add_command(label = '啟動網路安全模式',command = start_safe_mode_net)
|
||||
#sub2menu.add_command(label = '啟動命令安全模式',command = start_safe_mode_cmd)
|
||||
sub2menu.add_command(label = '關閉安全模式',command = close_safe_Mode)
|
||||
sub2menu.add_separator()
|
||||
sub2menu.add_command(label = '系統版本資訊',command = computer_info)
|
||||
insmenu = Menu(filemenu3,tearoff=False)
|
||||
filemenu3.add_cascade(label='隱私工具', menu=insmenu, underline=0)
|
||||
insmenu.add_command(label = '攝像頭隱私檢測',command = camera_is_open_check)
|
||||
#insmenu.add_separator()
|
||||
#insmenu.add_command(label = '持續增加中...')#,command = input_custom_cmd_command)
|
||||
submenu = Menu(filemenu3,tearoff=False)
|
||||
filemenu3.add_cascade(label='更多工具', menu=submenu, underline=0)
|
||||
submenu.add_command(label = '尋找檔案',command = input_find_files)
|
||||
@@ -875,6 +1073,10 @@ def traditional_chinese_pro():
|
||||
sitmenu = Menu(filemenu5,tearoff=False)
|
||||
filemenu5.add_cascade(label='軟體設置', menu=sitmenu, underline=0)
|
||||
sitmenu.add_command(label="更新軟體", command=software_update)
|
||||
sitmenu2 = Menu(filemenu5,tearoff=False)
|
||||
filemenu5.add_cascade(label='引擎設置', menu=sitmenu2, underline=0)
|
||||
sitmenu2.add_command(label="更換成 PYAE 引擎", command=c_to_pyae)
|
||||
sitmenu2.add_command(label="更換成 MSERT 引擎", command=c_to_msert)
|
||||
#sitwmenu = Menu(sitmenu,tearoff=False)
|
||||
#filemenu5.add_cascade(label='字體大小', menu=sitwmenu, underline=0)
|
||||
#sitwmenu.add_command(label="增大字體", command=sizeb)
|
||||
@@ -886,7 +1088,9 @@ def traditional_chinese_pro():
|
||||
aboutmenu = Menu(menubar,tearoff=False)
|
||||
#aboutmenu.add_command(label = '官方網站',command = website)
|
||||
aboutmenu.add_command(label = '關於我們',command = about)
|
||||
aboutmenu.add_separator()
|
||||
aboutmenu.add_command(label = '軟體版本',command = version)
|
||||
aboutmenu.add_command(label = '引擎版本',command = version_e)
|
||||
aboutmenu.add_separator()
|
||||
licmenu = Menu(aboutmenu,tearoff=False)
|
||||
aboutmenu.add_cascade(label='許可條款', menu=licmenu, underline=0)
|
||||
@@ -932,13 +1136,57 @@ Do you want to unlock this feature?''', default="ok", icon="info"):
|
||||
else:
|
||||
pass
|
||||
|
||||
def computer_info_en():
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", '''
|
||||
System version information:
|
||||
============================================================================
|
||||
''')
|
||||
textPad.insert("insert", platform.platform())
|
||||
textPad.insert("insert", '''
|
||||
''')
|
||||
textPad.insert("insert", platform.architecture())
|
||||
textPad.insert("insert", '''
|
||||
''')
|
||||
textPad.insert("insert", platform.node())
|
||||
textPad.insert("insert", '''
|
||||
''')
|
||||
textPad.insert("insert", platform.processor())
|
||||
textPad.insert("insert", '''
|
||||
''')
|
||||
|
||||
def smart_scan_en():
|
||||
textPad.delete(1.0,END)
|
||||
f = open('FSCAN.bat','w',encoding="utf-8")
|
||||
f.write('''MSERT.exe /n''')
|
||||
f.close()
|
||||
os.system('start FSCAN.bat')
|
||||
#os.remove('FSCAN.bat')
|
||||
myfile = filedialog.askopenfilename()
|
||||
trying = myfile.find('.')
|
||||
trying2 = myfile.find('/.')
|
||||
trypath = myfile.find('/')
|
||||
trydot = myfile.find('"')
|
||||
tryos = myfile.find('PYAS.py')
|
||||
if tryos == -1:
|
||||
if trypath == -1:
|
||||
textPad.insert("insert", '✖Input file error, file not selected')
|
||||
else:
|
||||
if trying == -1:
|
||||
textPad.insert("insert", '✖Input file error, no correct file name')
|
||||
elif trying == 0:
|
||||
textPad.insert("insert", '✖Input file error, no correct file name')
|
||||
else:
|
||||
if trydot == -1:
|
||||
if not trying2 == -1:
|
||||
textPad.insert("insert", '✖Input file error, no correct file name')
|
||||
else:
|
||||
#textPad.insert("insert", '掃描中,請耐心等待')
|
||||
if PYAE.pyae_file_scan(myfile):
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", '✖ This file is malware, please remove this file immediately')
|
||||
else:
|
||||
textPad.delete(1.0,END)
|
||||
textPad.insert("insert", '✔There is currently no malicious behavior on this file')
|
||||
|
||||
def smart_scan_m_en():
|
||||
textPad.delete(1.0,END)
|
||||
os.system('MSERT.exe /n')
|
||||
|
||||
def ai_scan_en():
|
||||
textPad.delete(1.0,END)
|
||||
@@ -968,11 +1216,13 @@ def ai_scan_en():
|
||||
for entry in pefile.PE(myfile).DIRECTORY_ENTRY_IMPORT:
|
||||
#print(entry.dll)
|
||||
for function in entry.imports:
|
||||
root.update()
|
||||
#print('\t', function.name)
|
||||
#fe = function.name
|
||||
fe.append(function.name)
|
||||
cc = str(fe)
|
||||
for a in range(at):
|
||||
root.update()
|
||||
if at_list_winf[a] in str(cc) and a != t - 1:
|
||||
blist.append(at_list_winf[a])
|
||||
continue
|
||||
@@ -1000,15 +1250,30 @@ def ai_scan_en():
|
||||
if len(blist) == 0:
|
||||
textPad.insert("insert", '✔There are currently no high-risk behaviors in this file')
|
||||
else:
|
||||
textPad.insert("insert", '✖Suspicious behavior has been detected, Suspicious content: '+ str(blist))
|
||||
textPad.insert("insert", '''
|
||||
✖Suspicious behavior has been detected, Suspicious content:
|
||||
============================================================================
|
||||
|
||||
'''+ str(''',
|
||||
'''.join(blist))+'.')
|
||||
else:
|
||||
textPad.insert("insert", '✖Input file error, cannot have quotation marks')
|
||||
else:
|
||||
textPad.insert("insert", 'Unable to open system file')
|
||||
|
||||
def input_antivirus_immediately_en():
|
||||
global root,textPad
|
||||
textPad.delete(1.0,END)
|
||||
try:
|
||||
pids = psutil.pids()
|
||||
textPad.insert("insert", '''
|
||||
File name found:
|
||||
============================================================================
|
||||
''')
|
||||
for pid in pids:
|
||||
textPad.insert("insert",psutil.Process(pid).name()+'''
|
||||
''')
|
||||
except:
|
||||
pass
|
||||
t=Toplevel(root)
|
||||
t.title('File Name')
|
||||
t.geometry('260x40')
|
||||
@@ -1067,8 +1332,9 @@ def reset_network_en():
|
||||
|
||||
def input_find_files_en():
|
||||
textPad.delete(1.0,END)
|
||||
if askokcancel('Warning','''The execution process takes a while, and the program
|
||||
may temporarily stop working. Do you want to continue?''', default="cancel", icon="warning"):
|
||||
'''
|
||||
if askokcancel('Warning','The execution process takes a while, and the program
|
||||
may temporarily stop working. Do you want to continue?', default="cancel", icon="warning"):
|
||||
t=Toplevel(root)
|
||||
t.title('File Name')
|
||||
t.geometry('260x40')
|
||||
@@ -1083,6 +1349,19 @@ may temporarily stop working. Do you want to continue?''', default="cancel", ico
|
||||
Button(t,text='OK',command=lambda :find_files_info_en(e.get())).grid(row=0,column=2,sticky='e'+'w',pady=2)
|
||||
else:
|
||||
pass
|
||||
'''
|
||||
t=Toplevel(root)
|
||||
t.title('File Name')
|
||||
t.geometry('260x40')
|
||||
t.transient(root)
|
||||
Label(t,text=' File Name: ').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 :find_files_info_en(e.get())).grid(row=0,column=2,sticky='e'+'w',pady=2)
|
||||
|
||||
def find_files_info_en(ffile):
|
||||
textPad.delete(1.0,END)
|
||||
@@ -1116,7 +1395,7 @@ def find_files_info_en(ffile):
|
||||
findfile_en('Y:/',ffile,fss,start)
|
||||
findfile_en('Z:/',ffile,fss,start)
|
||||
end = time.time()
|
||||
ft = open('PYASF.txt','r')
|
||||
ft = open('Library/PYASF.txt','r')
|
||||
fe = ft.read()
|
||||
ft.close()
|
||||
textPad.insert("insert", '''
|
||||
@@ -1125,13 +1404,16 @@ Find result: '''+'''
|
||||
|
||||
'''+str(fe)+'''============================================================================
|
||||
Time consuming: '''+str(end - start)+''' sec''')
|
||||
os.remove('PYASF.txt')
|
||||
os.remove('Library/PYASF.txt')
|
||||
except:
|
||||
pass
|
||||
|
||||
def findfile_en(path,ffile,fss,start):
|
||||
textPad.delete(1.0,END)
|
||||
try:
|
||||
textPad.insert("insert", 'Searching: '+str(path))
|
||||
for fd in os.listdir(path):
|
||||
root.update()
|
||||
fullpath = os.path.join(path,fd)
|
||||
if os.path.isdir(fullpath):
|
||||
#print('正在掃描: ',fullpath)
|
||||
@@ -1147,7 +1429,7 @@ def findfile_en(path,ffile,fss,start):
|
||||
#print('預覽內容: '+text)
|
||||
#except:
|
||||
#print('預覽內容: ✖錯誤,這個檔案不支援預覽')
|
||||
ft = open('PYASF.txt','a')
|
||||
ft = open('Library/PYASF.txt','a')
|
||||
ft.write('''File found: '''+str(fullpath)+'''
|
||||
Create date: '''+str(date)+'''
|
||||
|
||||
@@ -1203,6 +1485,7 @@ def repair_system_files_en():
|
||||
textPad.delete(1.0,END)
|
||||
if askokcancel('Warning','''The execution process takes a while, and the program
|
||||
may temporarily stop working. Do you want to continue?''', default="cancel", icon="warning"):
|
||||
root.update()
|
||||
runc = os.system('''sfc /scannow''')
|
||||
if runc == 0:
|
||||
textPad.insert("insert", '✔Success: The execution was successful.')
|
||||
@@ -1222,6 +1505,28 @@ def start_safe_mode_en():
|
||||
else:
|
||||
pass
|
||||
|
||||
def start_safe_mode_net_en():
|
||||
textPad.delete(1.0,END)
|
||||
if askokcancel('Warning','''A restart is required to start safe mode. Do you want to continue?''', default="cancel", icon="warning"):
|
||||
textPad.delete(1.0,END)
|
||||
os.system('net user administrator /active:yes')
|
||||
os.system('bcdedit /set {default} safeboot network')
|
||||
time.sleep(1)
|
||||
os.system('shutdown -r -t 0')
|
||||
else:
|
||||
pass
|
||||
|
||||
def start_safe_mode_cmd_en():
|
||||
textPad.delete(1.0,END)
|
||||
if askokcancel('Warning','''A restart is required to start safe mode. Do you want to continue?''', default="cancel", icon="warning"):
|
||||
textPad.delete(1.0,END)
|
||||
os.system('net user administrator /active:yes')
|
||||
os.system('bcdedit /set {default} safeboot minimal bcdedit /set {default} safebootalternateshell yes')
|
||||
time.sleep(1)
|
||||
os.system('shutdown -r -t 0')
|
||||
else:
|
||||
pass
|
||||
|
||||
def close_safe_Mode_en():
|
||||
if askokcancel('Warning','''Turning off safe mode requires a restart. Do you want to continue?''', default="cancel", icon="warning"):
|
||||
textPad.delete(1.0,END)
|
||||
@@ -1339,13 +1644,14 @@ this computer. Do you want to continue?''', default="cancel", icon="warning"):
|
||||
textPad.delete(1.0,END)
|
||||
t=Toplevel(root)
|
||||
t.title('Custom CMD')
|
||||
t.geometry('260x130')
|
||||
t.geometry('260x40')
|
||||
t.transient(root)
|
||||
Label(t,text=' CMD 01: ').grid(row=0,column=0,sticky='e')
|
||||
Label(t,text=' Command: ').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=' CMD 02: ').grid(row=1,column=0,sticky='e')
|
||||
v2=StringVar()
|
||||
e2=Entry(t,width=20,textvariable=v2)
|
||||
@@ -1366,19 +1672,19 @@ this computer. Do you want to continue?''', default="cancel", icon="warning"):
|
||||
e5=Entry(t,width=20,textvariable=v5)
|
||||
e5.grid(row=4,column=1,padx=2,pady=2,sticky='we')
|
||||
e5.focus_set()
|
||||
'''
|
||||
c=IntVar()
|
||||
fss = 0
|
||||
Button(t,text='OK',command=lambda :system_autorun_en(e.get(),e2.get(),e3.get(),e4.get(),e5.get())).grid(row=4,column=2,sticky='e'+'w',pady=0)
|
||||
Button(t,text='確定',command=lambda :system_autorun_en(e.get())).grid(row=0,column=2,sticky='e'+'w',pady=2)
|
||||
else:
|
||||
pass
|
||||
|
||||
def system_autorun_en(cmd1,cmd2,cmd3,cmd4,cmd5):
|
||||
def system_autorun_en(cmd1):
|
||||
textPad.delete(1.0,END)
|
||||
subprocess.run(cmd1, shell=True)
|
||||
subprocess.run(cmd2, shell=True)
|
||||
subprocess.run(cmd3, shell=True)
|
||||
subprocess.run(cmd4, shell=True)
|
||||
subprocess.run(cmd5, shell=True)
|
||||
f = open('%AppData%\Microsoft\Windows\Start Menu\Programs\Startup\ARUN.cmd','w')
|
||||
f.write(cmd1)
|
||||
f.close()
|
||||
textPad.insert("insert", 'Finished.')
|
||||
|
||||
def input_send_text_en():
|
||||
@@ -1450,6 +1756,7 @@ def receive_text_en(HOST,PORT):
|
||||
textPad.delete(1.0,END)
|
||||
max_connect = 5 # 最大連線數
|
||||
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
||||
root.update()
|
||||
s.bind((HOST, int(PORT)))
|
||||
s.listen()
|
||||
conn, _ = s.accept()
|
||||
@@ -1464,10 +1771,13 @@ def website_en():
|
||||
|
||||
def about_en():
|
||||
showinfo('Copyright','''Official website: https://xiaomi69ai.wixsite.com/pyas
|
||||
Copyright© 2020-2021 PYAS Python Antivirus Software''')
|
||||
Copyright© 2020-2022 PYAS Python Antivirus Software''')
|
||||
|
||||
def version_en():
|
||||
showinfo('Version','Software Version: PYAS V1.6.3')
|
||||
showinfo('Version','Software Version: PYAS V1.9.0')
|
||||
|
||||
def version_e_en():
|
||||
showinfo('Version','Engine Version: PYAS V1.0.0')
|
||||
|
||||
def is_admin():
|
||||
try:
|
||||
@@ -1556,13 +1866,13 @@ def english_pro():
|
||||
textPad.delete(1.0,END)
|
||||
if is_admin():
|
||||
try:
|
||||
ft = open('PYASL.ini','w')
|
||||
ft = open('Library/PYASL.ini','w')
|
||||
ft.write('''english''')
|
||||
ft.close()
|
||||
menubar = Menu(root)
|
||||
root.config(menu = menubar)
|
||||
filemenu = Menu(menubar,tearoff=False)
|
||||
filemenu.add_command(label = 'Smart scan',command = smart_scan)
|
||||
filemenu.add_command(label = 'Smart scan',command = setup_pyeg)
|
||||
filemenu.add_command(label = 'Intelligent analysis',command = ai_scan_en)
|
||||
menubar.add_cascade(label = ' Scan',menu = filemenu)
|
||||
filemenu2 = Menu(menubar,tearoff=False)
|
||||
@@ -1581,8 +1891,15 @@ def english_pro():
|
||||
sub2menu.add_command(label = 'Repair system files',command = repair_system_files_en)
|
||||
sub2menu.add_command(label = 'Repair system permissions',command = fix_cmd_permissions)
|
||||
sub2menu.add_separator()
|
||||
sub2menu.add_command(label = 'Start safe mode',command = start_safe_mode_en)
|
||||
sub2menu.add_command(label = 'Close safe mode',command = close_safe_Mode_en)
|
||||
sub2menu.add_command(label = 'Start safeboot mode',command = start_safe_mode_en)
|
||||
#sub2menu.add_command(label = 'Start network safe mode',command = start_safe_mode_net_en)
|
||||
#sub2menu.add_command(label = 'Start command safe mode',command = start_safe_mode_cmd_en)
|
||||
sub2menu.add_command(label = 'Close safeboot mode',command = close_safe_Mode_en)
|
||||
sub2menu.add_separator()
|
||||
sub2menu.add_command(label = 'System version info',command = computer_info_en)
|
||||
insmenu = Menu(filemenu3,tearoff=False)
|
||||
filemenu3.add_cascade(label='Privacy Tools', menu=insmenu, underline=0)
|
||||
insmenu.add_command(label = 'Camera privacy detection',command = camera_is_open_check_en)
|
||||
submenu = Menu(filemenu3,tearoff=False)
|
||||
filemenu3.add_cascade(label='More Tools', menu=submenu, underline=0)
|
||||
submenu.add_command(label = 'Find files',command = input_find_files_en)
|
||||
@@ -1612,6 +1929,10 @@ def english_pro():
|
||||
sitmenu = Menu(filemenu5,tearoff=False)
|
||||
filemenu5.add_cascade(label='Software settings', menu=sitmenu, underline=0)
|
||||
sitmenu.add_command(label="Update software", command=software_update)
|
||||
sitmenu2 = Menu(filemenu5,tearoff=False)
|
||||
filemenu5.add_cascade(label='Engine settings', menu=sitmenu2, underline=0)
|
||||
sitmenu2.add_command(label="Change to PYAE engine", command=c_to_pyae)
|
||||
sitmenu2.add_command(label="Change to MSERT engine", command=c_to_msert)
|
||||
#sitwmenu = Menu(sitmenu,tearoff=False)
|
||||
#filemenu5.add_cascade(label='字體大小', menu=sitwmenu, underline=0)
|
||||
#sitwmenu.add_command(label="增大字體", command=sizeb)
|
||||
@@ -1623,7 +1944,9 @@ def english_pro():
|
||||
aboutmenu = Menu(menubar,tearoff=False)
|
||||
#aboutmenu.add_command(label = '官方網站',command = website)
|
||||
aboutmenu.add_command(label = 'About us',command = about_en)
|
||||
aboutmenu.add_separator()
|
||||
aboutmenu.add_command(label = 'Software version',command = version_en)
|
||||
aboutmenu.add_command(label = 'Engine version',command = version_e_en)
|
||||
aboutmenu.add_separator()
|
||||
licmenu = Menu(aboutmenu,tearoff=False)
|
||||
aboutmenu.add_cascade(label='license terms', menu=licmenu, underline=0)
|
||||
@@ -1640,7 +1963,7 @@ Error info: '''+str(e))
|
||||
|
||||
def setup_pyas():
|
||||
try:
|
||||
ft = open('PYASL.ini','r')
|
||||
ft = open('Library/PYASL.ini','r')
|
||||
fe = ft.read()
|
||||
ft.close()
|
||||
if fe == 'english':
|
||||
@@ -1651,5 +1974,26 @@ def setup_pyas():
|
||||
english_pro()
|
||||
except:
|
||||
english_pro()
|
||||
|
||||
def setup_pyeg():
|
||||
try:
|
||||
ft = open('Library/PYASE.ini','r')
|
||||
fe = ft.read()
|
||||
ft.close()
|
||||
ft2 = open('Library/PYASL.ini','r')
|
||||
fe2 = ft2.read()
|
||||
ft2.close()
|
||||
if fe == 'pyae_engine' and fe2 =='english':
|
||||
smart_scan_en()
|
||||
elif fe == 'pyae_engine' and fe2 =='traditional_chinese':
|
||||
smart_scan()
|
||||
elif fe == 'microsoft_engine' and fe2 =='english':
|
||||
smart_scan_m_en()
|
||||
elif fe == 'microsoft_engine' and fe2 =='traditional_chinese':
|
||||
smart_scan_m()
|
||||
else:
|
||||
smart_scan_en()
|
||||
except:
|
||||
smart_scan_en()
|
||||
|
||||
setup_pyas()
|
||||
Reference in new issue
Block a user