Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f21fbc8c10 | ||
|
|
5ee0c4bb34 |
@@ -14,7 +14,7 @@
|
||||
####################################################################################
|
||||
|
||||
#版本資訊
|
||||
pyas_virsion = '2.0.0'
|
||||
pyas_virsion = '2.0.2'
|
||||
pyae_virsion = '1.1.0'
|
||||
pyas_copyright = 'Copyright© 2020-2022 PYAS Python Antivirus Software.'
|
||||
|
||||
@@ -86,7 +86,7 @@ pyas_divider = '='*80
|
||||
|
||||
#載入模組套件
|
||||
try:
|
||||
import os, time, sys, psutil, socket, subprocess, binascii, platform, cryptocode, webbrowser, requests
|
||||
import os, time, sys, psutil, socket, subprocess, binascii, platform, cryptocode, webbrowser, requests, threading
|
||||
from cv2 import VideoCapture
|
||||
from ctypes import windll
|
||||
from pefile import PE
|
||||
@@ -101,7 +101,8 @@ except Exception as e:
|
||||
#載入窗口介面
|
||||
root = Tk()
|
||||
root.title('PYAS V'+pyas_virsion)
|
||||
root.geometry('800x450')
|
||||
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)
|
||||
textPad.pack(expand=YES,fill=BOTH)
|
||||
scroll=Scrollbar(textPad)
|
||||
@@ -119,7 +120,6 @@ en_welcome = '''Welcome To Python Antivirus Software !!!
|
||||
Language: Setting > Change Language
|
||||
'''#Help Info: About > PYAS Help
|
||||
|
||||
|
||||
####################################################################################
|
||||
|
||||
#許可條款
|
||||
@@ -221,6 +221,40 @@ def pyas_scan_start(file,rfp):
|
||||
|
||||
####################################################################################
|
||||
|
||||
#定義防護
|
||||
def protect_threading_init_en():
|
||||
if messagebox.askokcancel('Warning','''Enable Real Time Protection Needs More Then 4GB Of RAM. Do you want to continue?''', default="cancel", icon="warning"):
|
||||
textPad.insert("insert", en_init_file)
|
||||
root.update()
|
||||
t = threading.Thread(target = pyas_protect_init_en)
|
||||
t.start()
|
||||
else:
|
||||
pass
|
||||
|
||||
#定義全盤掃描
|
||||
def pyas_protect_init_en():
|
||||
with open('Library/MD5/Viruslist.md5','r') as fp:
|
||||
rfp = fp.read()
|
||||
pyas_clear()
|
||||
textPad.insert("insert", en_success)
|
||||
root.update()
|
||||
while 1:
|
||||
for p in psutil.process_iter():
|
||||
try:
|
||||
if pyas_scan_start(p.exe(),rfp):
|
||||
pyas_clear()
|
||||
of = subprocess.call('taskkill /f /im '+str(p.name()),shell=True)
|
||||
if of == 0:
|
||||
textPad.insert("insert", 'Successfully blocked a malware: '+str(p.name()))
|
||||
else:
|
||||
textPad.insert("insert", 'Malware blocking failed: '+str(p.name()))
|
||||
else:
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
|
||||
####################################################################################
|
||||
|
||||
#定義智能掃描
|
||||
def pyas_scan_smart_en():
|
||||
pyas_clear()
|
||||
@@ -237,6 +271,10 @@ def pyas_scan_smart_en():
|
||||
|
||||
#定義檔案掃描
|
||||
def pyas_file_scan_en():
|
||||
try:
|
||||
os.remove('Library/PYASV.tmp')
|
||||
except:
|
||||
pass
|
||||
pyas_clear()
|
||||
textPad.insert("insert", en_init_file+'\n')
|
||||
root.update()
|
||||
@@ -257,6 +295,10 @@ def pyas_file_scan_en():
|
||||
|
||||
#定義路徑掃描
|
||||
def pyas_scan_path_init_en():
|
||||
try:
|
||||
os.remove('Library/PYASV.tmp')
|
||||
except:
|
||||
pass
|
||||
pyas_clear()
|
||||
textPad.insert("insert", en_init_file+'\n')
|
||||
root.update()
|
||||
@@ -295,6 +337,10 @@ def pyas_scan_path_en(path,rfp):
|
||||
|
||||
#定義全盤掃描
|
||||
def pyas_scan_disk_init_en():
|
||||
try:
|
||||
os.remove('Library/PYASV.tmp')
|
||||
except:
|
||||
pass
|
||||
pyas_clear()
|
||||
textPad.insert("insert", en_init_file+'\n')
|
||||
root.update()
|
||||
@@ -440,7 +486,14 @@ def process_kill_en(app):
|
||||
done = True
|
||||
break
|
||||
else:
|
||||
textPad.insert("insert", 'Process not found "'+str(app)+'"')
|
||||
try:
|
||||
of = subprocess.call('taskkill /f /im '+str(app),shell=True)
|
||||
if of == 0:
|
||||
textPad.insert("insert", en_success)
|
||||
else:
|
||||
textPad.insert("insert", en_failed)
|
||||
except:
|
||||
textPad.insert("insert", 'Process not found "'+str(app)+'"')
|
||||
done = True
|
||||
break
|
||||
|
||||
@@ -614,7 +667,7 @@ def input_custom_regedit_command_en():
|
||||
pyas_clear()
|
||||
if messagebox.askokcancel('Warning','''Improper use of custom commands may have serious consequences. Do you want to continue?''', default="cancel", icon="warning"):
|
||||
t=Toplevel(root)
|
||||
t.title('自訂指令')
|
||||
t.title('Custom Command')
|
||||
t.geometry('260x110')
|
||||
t.transient(root)
|
||||
Label(t,text=' Path: ').grid(row=0,column=0,sticky='e')
|
||||
@@ -752,7 +805,7 @@ def input_receive_text_en():
|
||||
pyas_clear()
|
||||
if messagebox.askokcancel('Warning','''Waiting for the receiving process will take a while, do you want to continue?''', default="cancel", icon="warning"):
|
||||
t=Toplevel(root)
|
||||
t.title('接收訊息')
|
||||
t.title('Receive Text')
|
||||
t.geometry('260x70')
|
||||
t.transient(root)
|
||||
Label(t,text=' IP: ').grid(row=1,column=0,sticky='e')
|
||||
@@ -790,6 +843,28 @@ def system_disk_clean_en():
|
||||
os.system('cleanmgr /autoclean')
|
||||
pyas_clear()
|
||||
|
||||
def change_user_password_init_en():
|
||||
pyas_clear()
|
||||
messagebox.showinfo('Version','''Before changing the user password, please make sure you have entered the safe mode before using this function.''')
|
||||
t=Toplevel(root)
|
||||
t.title('Change Password')
|
||||
t.geometry('260x60')
|
||||
t.transient(root)
|
||||
Label(t,text='User 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()
|
||||
Label(t,text='New PassWord: ').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()
|
||||
Button(t,text='OK',command=lambda :change_user_password_en(e.get(),e2.get())).grid(row=1,column=2,sticky='e'+'w',pady=0)
|
||||
|
||||
def change_user_password_en(user,password):
|
||||
os.system('net user '+str(user)+' "'+str(password)+'"')
|
||||
|
||||
################################################################################
|
||||
|
||||
#關於
|
||||
@@ -834,10 +909,11 @@ def english():
|
||||
filemenu.add_command(label = 'full Scan',command = pyas_scan_disk_init_en)
|
||||
menubar.add_cascade(label = ' Scan',menu = filemenu)
|
||||
filemenu2 = Menu(menubar,tearoff=False)
|
||||
#filemenu2.add_command(label = 'Data Protect',command = #)
|
||||
filemenu2.add_command(label = 'Enable Real Time Protection',command = protect_threading_init_en)
|
||||
#filemenu2.add_command(label = 'Disable Auto Protect',command = dprotect_threading_init_en)
|
||||
#filemenu2.add_command(label = 'Behavioural Protect',command = #)
|
||||
#filemenu2.add_command(label = 'Network Protect',command = #)
|
||||
#menubar.add_cascade(label = 'Protect',menu = filemenu2)
|
||||
menubar.add_cascade(label = 'Protect',menu = filemenu2)
|
||||
filemenu3 = Menu(menubar,tearoff=False)
|
||||
menubar.add_cascade(label = 'Tools',menu = filemenu3)
|
||||
sub2menu = Menu(filemenu3,tearoff=False)
|
||||
@@ -868,6 +944,8 @@ def english():
|
||||
submenu.add_command(label = 'Send Message',command = input_send_text_en)
|
||||
submenu.add_command(label = 'Receive Message',command = input_receive_text_en)
|
||||
submenu.add_separator()
|
||||
submenu.add_command(label = 'Change User Password',command = change_user_password_init_en)
|
||||
submenu.add_separator()
|
||||
submenu.add_command(label = 'Internet Location Query',command = ip_detect_en)
|
||||
submenu.add_command(label = 'Reset System Network',command = reset_network_en)
|
||||
devmenu = Menu(filemenu3,tearoff=False)
|
||||
@@ -918,6 +996,41 @@ Error Info: '''+str(e))
|
||||
|
||||
###########################################################################################################################################################################################
|
||||
|
||||
#定義防護
|
||||
def protect_threading_init_zh():
|
||||
if messagebox.askokcancel('Warning','''啟動實時防護需要 4GB 以上的 RAM,是否繼續?''', default="cancel", icon="warning"):
|
||||
pyas_clear()
|
||||
textPad.insert("insert", zh_init_file)
|
||||
root.update()
|
||||
t = threading.Thread(target = pyas_protect_init_zh)
|
||||
t.start()
|
||||
else:
|
||||
pass
|
||||
|
||||
#定義全盤掃描
|
||||
def pyas_protect_init_zh():
|
||||
with open('Library/MD5/Viruslist.md5','r') as fp:
|
||||
rfp = fp.read()
|
||||
pyas_clear()
|
||||
textPad.insert("insert", zh_success)
|
||||
root.update()
|
||||
while 1:
|
||||
for p in psutil.process_iter():
|
||||
try:
|
||||
if pyas_scan_start(p.exe(),rfp):
|
||||
pyas_clear()
|
||||
of = subprocess.call('taskkill /f /im '+str(p.name()),shell=True)
|
||||
if of == 0:
|
||||
textPad.insert("insert", '成功攔截了一個惡意軟體: '+str(p.name()))
|
||||
else:
|
||||
textPad.insert("insert", '惡意軟體攔截失敗: '+str(p.name()))
|
||||
else:
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
|
||||
####################################################################################
|
||||
|
||||
#定義紀錄掃描
|
||||
def pyas_scan_write_zh(file):
|
||||
ft = open('Library/PYASV.tmp','a')
|
||||
@@ -985,6 +1098,10 @@ def pyas_scan_start(file,rfp):
|
||||
|
||||
#定義智能掃描
|
||||
def pyas_scan_smart_zh():
|
||||
try:
|
||||
os.remove('Library/PYASV.tmp')
|
||||
except:
|
||||
pass
|
||||
pyas_clear()
|
||||
textPad.insert("insert", zh_init_file+'\n')
|
||||
root.update()
|
||||
@@ -999,6 +1116,10 @@ def pyas_scan_smart_zh():
|
||||
|
||||
#定義檔案掃描
|
||||
def pyas_file_scan_zh():
|
||||
try:
|
||||
os.remove('Library/PYASV.tmp')
|
||||
except:
|
||||
pass
|
||||
pyas_clear()
|
||||
textPad.insert("insert", zh_init_file+'\n')
|
||||
root.update()
|
||||
@@ -1019,6 +1140,10 @@ def pyas_file_scan_zh():
|
||||
|
||||
#定義路徑掃描
|
||||
def pyas_scan_path_init_zh():
|
||||
try:
|
||||
os.remove('Library/PYASV.tmp')
|
||||
except:
|
||||
pass
|
||||
pyas_clear()
|
||||
textPad.insert("insert", zh_init_file+'\n')
|
||||
root.update()
|
||||
@@ -1057,6 +1182,10 @@ def pyas_scan_path_zh(path,rfp):
|
||||
|
||||
#定義全盤掃描
|
||||
def pyas_scan_disk_init_zh():
|
||||
try:
|
||||
os.remove('Library/PYASV.tmp')
|
||||
except:
|
||||
pass
|
||||
pyas_clear()
|
||||
textPad.insert("insert", zh_init_file+'\n')
|
||||
root.update()
|
||||
@@ -1202,7 +1331,14 @@ def process_kill_zh(app):
|
||||
done = True
|
||||
break
|
||||
else:
|
||||
textPad.insert("insert", '未找到進程: "'+str(app)+'"')
|
||||
try:
|
||||
of = subprocess.call('taskkill /f /im '+str(app),shell=True)
|
||||
if of == 0:
|
||||
textPad.insert("insert", zh_success)
|
||||
else:
|
||||
textPad.insert("insert", zh_failed)
|
||||
except:
|
||||
textPad.insert("insert", '未找到進程: "'+str(app)+'"')
|
||||
done = True
|
||||
break
|
||||
|
||||
@@ -1552,6 +1688,28 @@ def system_disk_clean_zh():
|
||||
os.system('cleanmgr /autoclean')
|
||||
pyas_clear()
|
||||
|
||||
def change_user_password_init_zh():
|
||||
pyas_clear()
|
||||
messagebox.showinfo('Version','''變更用戶密碼前,請先確保您已經進入安全模式再使用此功能。''')
|
||||
t=Toplevel(root)
|
||||
t.title('變更密碼')
|
||||
t.geometry('260x60')
|
||||
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()
|
||||
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()
|
||||
Button(t,text='確定',command=lambda :change_user_password_zh(e.get(),e2.get())).grid(row=1,column=2,sticky='e'+'w',pady=0)
|
||||
|
||||
def change_user_password_zh(user,password):
|
||||
os.system('net user '+str(user)+' "'+str(password)+'"')
|
||||
|
||||
################################################################################
|
||||
|
||||
#關於
|
||||
@@ -1590,16 +1748,17 @@ def traditional_chinese():
|
||||
menubar = Menu(root)
|
||||
root.config(menu = menubar)
|
||||
filemenu = Menu(menubar,tearoff=False)
|
||||
#filemenu.add_command(label = 'Smart Scan',command = pyas_scan_smart_zh)
|
||||
#filemenu.add_command(label = '',command = )
|
||||
filemenu.add_command(label = '檔案掃描',command = pyas_file_scan_zh)
|
||||
filemenu.add_command(label = '路徑掃描',command = pyas_scan_path_init_zh)
|
||||
filemenu.add_command(label = '全盤掃描',command = pyas_scan_disk_init_zh)
|
||||
menubar.add_cascade(label = ' 掃描',menu = filemenu)
|
||||
filemenu2 = Menu(menubar,tearoff=False)
|
||||
#filemenu2.add_command(label = 'Data Protect',command = #)
|
||||
filemenu2.add_command(label = '啟動實時防護',command = protect_threading_init_zh)
|
||||
#filemenu2.add_command(label = '關閉實時防護',command = dprotect_threading_init_zh)
|
||||
#filemenu2.add_command(label = 'Behavioural Protect',command = #)
|
||||
#filemenu2.add_command(label = 'Network Protect',command = #)
|
||||
#menubar.add_cascade(label = 'Protect',menu = filemenu2)
|
||||
menubar.add_cascade(label = '防護',menu = filemenu2)
|
||||
filemenu3 = Menu(menubar,tearoff=False)
|
||||
menubar.add_cascade(label = '工具',menu = filemenu3)
|
||||
sub2menu = Menu(filemenu3,tearoff=False)
|
||||
@@ -1630,6 +1789,8 @@ def traditional_chinese():
|
||||
submenu.add_command(label = '傳送訊息',command = input_send_text_zh)
|
||||
submenu.add_command(label = '接收訊息',command = input_receive_text_zh)
|
||||
submenu.add_separator()
|
||||
submenu.add_command(label = '更改用戶密碼',command = change_user_password_init_zh)
|
||||
submenu.add_separator()
|
||||
submenu.add_command(label = '網路位置查詢',command = ip_detect_zh)
|
||||
submenu.add_command(label = '重製系統網路',command = reset_network_zh)
|
||||
devmenu = Menu(filemenu3,tearoff=False)
|
||||
@@ -1685,6 +1846,29 @@ def simplified_chinese():
|
||||
|
||||
####################################################################################
|
||||
|
||||
#初始化驗證
|
||||
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()
|
||||
ft = open('./Library/PYAS/PYAS.key','r')
|
||||
fe = ft.read()
|
||||
ft.close()
|
||||
if fe == readable_hash:
|
||||
setup_pyas()
|
||||
else:
|
||||
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()
|
||||
|
||||
|
||||
####################################################################################
|
||||
|
||||
#初始化選項
|
||||
def setup_pyas():
|
||||
try:
|
||||
@@ -1700,6 +1884,9 @@ def setup_pyas():
|
||||
else:
|
||||
english()
|
||||
except Exception as e:
|
||||
messagebox.showinfo('Welcome',en_welcome)
|
||||
#messagebox.showinfo('Welcome',en_welcome)
|
||||
english()
|
||||
setup_pyas()
|
||||
try:
|
||||
pyas_key()
|
||||
except:
|
||||
pass
|
||||
Reference in new issue
Block a user