Compare commits

..
6 Commits
Author SHA1 Message Date
87owo 6072d2db2d Add files via upload 2022-01-31 11:55:44 +08:00
87owo 2dfa73ba67 Add files via upload 2021-12-03 18:39:36 +08:00
87owo 3d72861627 Delete virustotal.txt 2021-11-26 01:26:36 +08:00
87owo 0980449e99 Add files via upload 2021-11-26 01:26:14 +08:00
87owo 11408e5816 Add files via upload 2021-11-15 18:03:06 +08:00
87owo 12cd3e5ff3 Add files via upload 2021-10-28 07:27:41 +08:00
+257 -34
View File
@@ -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,12 @@ import hashlib
import getpass
import json
import stat
import threading
import zipfile
import platform
import cryptocode
import tkinter as tk
from tkinter import ttk
from tkinter import *
from os import listdir
#import pyinstaller_versionfile
@@ -28,17 +34,17 @@ from Expansion_pack import *
'''
pyinstaller_versionfile.create_versionfile(
output_file="versionfile.txt",
version="1.6.3",
version="1.8.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.8.0')
#root.resizable(0,0)
root.geometry('800x450')
textPad=Text(root,undo=True)
@@ -47,7 +53,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():
@@ -124,6 +130,69 @@ 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 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 +228,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,6 +236,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)+'''
''')
@@ -219,11 +290,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 +324,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 +337,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 +405,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 +421,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)
@@ -380,7 +482,9 @@ def find_files_info(ffile):
def findfile(path,ffile,fss,start):
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)
@@ -410,6 +514,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 +535,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 +595,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 +623,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 +841,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 +857,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.3')
showinfo('Version','軟體版本: PYAS V1.8.0')
def is_admin():
try:
@@ -845,7 +975,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)
@@ -932,6 +1071,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")
@@ -968,11 +1126,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 +1160,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 +1242,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 +1259,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(e.get())).grid(row=0,column=2,sticky='e'+'w',pady=2)
def find_files_info_en(ffile):
textPad.delete(1.0,END)
@@ -1131,7 +1320,9 @@ Time consuming: '''+str(end - start)+''' sec''')
def findfile_en(path,ffile,fss,start):
try:
textPad.insert("insert", 'Searching: '+str(path)+' ,Please wait.')
for fd in os.listdir(path):
root.update()
fullpath = os.path.join(path,fd)
if os.path.isdir(fullpath):
#print('正在掃描: ',fullpath)
@@ -1203,6 +1394,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 +1414,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 +1553,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 +1581,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 +1665,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 +1680,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.3')
showinfo('Version','Software Version: PYAS V1.8.0')
def is_admin():
try:
@@ -1581,8 +1797,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)
@@ -1651,5 +1874,5 @@ def setup_pyas():
english_pro()
except:
english_pro()
setup_pyas()