|
|
|
@@ -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
|
|
|
|
@@ -15,8 +17,13 @@ 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
|
|
|
|
@@ -29,17 +36,17 @@ from Expansion_pack import *
|
|
|
|
|
'''
|
|
|
|
|
pyinstaller_versionfile.create_versionfile(
|
|
|
|
|
output_file="versionfile.txt",
|
|
|
|
|
version="1.6.4",
|
|
|
|
|
version="1.8.1",
|
|
|
|
|
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.4')
|
|
|
|
|
root.title('PYAS V1.8.1')
|
|
|
|
|
#root.resizable(0,0)
|
|
|
|
|
root.geometry('800x450')
|
|
|
|
|
textPad=Text(root,undo=True)
|
|
|
|
@@ -48,7 +55,7 @@ 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 pyas_license_terms():
|
|
|
|
@@ -127,13 +134,79 @@ It also applies even if Microsoft knew or should have known about the possibilit
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
@@ -169,6 +242,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)
|
|
|
|
|
|
|
|
|
@@ -176,6 +250,7 @@ def exe_cb():
|
|
|
|
|
textPad.delete(1.0,END)
|
|
|
|
|
pe = pefile.PE(filedialog.askopenfilename())
|
|
|
|
|
for entry in pe.DIRECTORY_ENTRY_IMPORT:
|
|
|
|
|
root.update()
|
|
|
|
|
ft = open('PYASF.txt','a')
|
|
|
|
|
ft.write(str(entry.dll)+'''
|
|
|
|
|
''')
|
|
|
|
@@ -202,7 +277,6 @@ def smart_scan():
|
|
|
|
|
#os.remove('FSCAN.bat')
|
|
|
|
|
|
|
|
|
|
def ai_scan():
|
|
|
|
|
lock.acquire()
|
|
|
|
|
textPad.delete(1.0,END)
|
|
|
|
|
blist = []
|
|
|
|
|
dblist = []
|
|
|
|
@@ -230,11 +304,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
|
|
|
|
@@ -275,6 +351,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')
|
|
|
|
@@ -332,8 +419,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')
|
|
|
|
@@ -348,6 +435,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)
|
|
|
|
@@ -395,8 +495,11 @@ def find_files_info(ffile):
|
|
|
|
|
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)
|
|
|
|
@@ -426,6 +529,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", '✔成功: 執行成功。')
|
|
|
|
@@ -446,6 +550,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"):
|
|
|
|
@@ -484,13 +610,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)
|
|
|
|
@@ -511,19 +638,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():
|
|
|
|
@@ -729,11 +856,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')
|
|
|
|
@@ -743,10 +872,10 @@ 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.4')
|
|
|
|
|
showinfo('Version','軟體版本: PYAS V1.8.1')
|
|
|
|
|
|
|
|
|
|
def is_admin():
|
|
|
|
|
try:
|
|
|
|
@@ -809,6 +938,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)
|
|
|
|
@@ -861,7 +995,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)
|
|
|
|
@@ -948,6 +1091,25 @@ 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")
|
|
|
|
@@ -984,11 +1146,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
|
|
|
|
@@ -1029,6 +1193,17 @@ def ai_scan_en():
|
|
|
|
|
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')
|
|
|
|
@@ -1087,8 +1262,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')
|
|
|
|
@@ -1103,6 +1279,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)
|
|
|
|
@@ -1150,8 +1339,11 @@ Time consuming: '''+str(end - start)+''' sec''')
|
|
|
|
|
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)
|
|
|
|
@@ -1223,6 +1415,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.')
|
|
|
|
@@ -1242,6 +1435,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)
|
|
|
|
@@ -1359,13 +1574,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)
|
|
|
|
@@ -1386,19 +1602,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():
|
|
|
|
@@ -1470,6 +1686,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()
|
|
|
|
@@ -1484,10 +1701,10 @@ 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.4')
|
|
|
|
|
showinfo('Version','Software Version: PYAS V1.8.1')
|
|
|
|
|
|
|
|
|
|
def is_admin():
|
|
|
|
|
try:
|
|
|
|
@@ -1601,8 +1818,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)
|
|
|
|
@@ -1672,4 +1896,14 @@ def setup_pyas():
|
|
|
|
|
except:
|
|
|
|
|
english_pro()
|
|
|
|
|
|
|
|
|
|
def setup_pyeg():
|
|
|
|
|
try:
|
|
|
|
|
ft = open('PYASE.ini','r')
|
|
|
|
|
fe = ft.read()
|
|
|
|
|
ft.close()
|
|
|
|
|
except:
|
|
|
|
|
ft = open('PYASE.ini','w')
|
|
|
|
|
ft.write('''microsoft_engine''')
|
|
|
|
|
ft.close()
|
|
|
|
|
|
|
|
|
|
setup_pyas()
|