def add_instrument(self, instrument): if not isinstance(instrument, ScaleSynth): return index = len(self.instruments) self.instruments.append(instrument) scale_plot = ScalePlot(self) scale_plot.draw_scale(instrument.scale) scale_plot.grid(column=1, row=self.row, sticky='nesw') self.scale_plots.append(scale_plot) instrument.add_observer(scale_plot) control_frame = Frame(self) self.control_frames.append(control_frame) activate_button = Radiobutton(control_frame, # text=str(instrument.name), textvar=instrument.id_variable, variable=self.radio_btn_var, value=index, command=self.activate_instrument, width=15, ) activate_button.pack() self.radio_btn_var.set(index) self.activate_instrument() control_frame.grid(column=0, row=self.row, sticky='nesw') self.row += 1
def initUI(self): self.parent.title("Graphs") self.style = Style() self.style.theme_use("clam") self.pack(fill=BOTH, expand=1) self.columnconfigure(1, weight=1) self.columnconfigure(3, weight=1) self.columnconfigure(6, pad=7) self.rowconfigure(3, weight=1) self.rowconfigure(5, pad=7) menu = Menu(self.parent) self.parent.config(menu=menu) filemenu = Menu(menu) menu.add_cascade(label="File", menu=filemenu) filemenu.add_command(label="Load data",command = self.load_data) # lable to show current file and chanel self.file_lbl = Label(self, text="") self.file_lbl.grid(row = 0 , column = 3, pady=4, padx=5) # list box fro data files self.file_list = ScrolledList(self,lambda x: self.load_hunt_data(x)) self.file_list.grid(row=1, column=0, columnspan=3, rowspan=4, padx=5, sticky=E+W+S+N) # chanel graph viewer self.graph_viewer = TkinterGraph(self) self.graph_viewer.grid(row=1, column=3, columnspan=2, rowspan=4, padx=5, sticky=E+W+S+N) btn1 = Button(self, text="Left",command = lambda: self.plot_left()) btn1.grid(row=1, column=6) btn2 = Button(self, text="Right", command = lambda:self.plot_right()) btn2.grid(row=2, column=6, pady=4) # frames for the classifier for the two chanels self.frame_left = Frame(self, borderwidth=1) self.frame_right = Frame(self, borderwidth=1) self.frame_left.grid(row=5,column=3,columnspan=2, rowspan=1) btn4 = Button(self, text="SAVE", command = lambda:self.save_graph()) btn4.grid(row=5, column=6) # note manual addition of labels so that the lable will be to the right of tha radio button self.classify_left = StringVar() Label(self.frame_left,text="Left :").pack(side=LEFT) Label(self.frame_left,text="Type A").pack(side=LEFT) rb1 = Radiobutton(self.frame_left,variable=self.classify_left,value="TypeA") rb1.pack(side=LEFT) Label(self.frame_left,text="Type B").pack(side=LEFT) rb1 = Radiobutton(self.frame_left,variable=self.classify_left,value="TypeB") rb1.pack(side=LEFT) Label(self.frame_left,text="Type C").pack(side=LEFT) rb1 = Radiobutton(self.frame_left,variable=self.classify_left,value="TypeC") rb1.pack(side=LEFT) Label(self.frame_left,text="Type D").pack(side=LEFT) rb1 = Radiobutton(self.frame_left,variable=self.classify_left,value="TypeD") rb1.pack(side=LEFT) self.classify_right = StringVar() Label(self.frame_right,text="Right :").pack(side=LEFT) Label(self.frame_right,text="Type A").pack(side=LEFT) rb1 = Radiobutton(self.frame_right,variable=self.classify_right,value="TypeA") rb1.pack(side=LEFT) Label(self.frame_right,text="Type B").pack(side=LEFT) rb1 = Radiobutton(self.frame_right,variable=self.classify_right,value="TypeB") rb1.pack(side=LEFT) Label(self.frame_right,text="Type C").pack(side=LEFT) rb1 = Radiobutton(self.frame_right,variable=self.classify_right,value="TypeC") rb1.pack(side=LEFT) Label(self.frame_right,text="Type D").pack(side=LEFT) rb1 = Radiobutton(self.frame_right,variable=self.classify_right,value="TypeD") rb1.pack(side=LEFT)
def initUI(self): self.parent.title("Append Data") self.pack(fill=BOTH, expand=True) labelfont20 = ('Roboto', 15, 'bold') labelfont10 = ('Roboto', 10, 'bold') labelfont8 = ('Roboto', 8, 'bold') frame0 = Frame(self) frame0.pack() lbl0 = Label(frame0, text="Hi Nakul") lbl0.config(font=labelfont20) lbl0.pack(padx=5, pady=5) lbl00 = Label(frame0, text="Fill the data here") lbl00.config(font=labelfont10) lbl00.pack(padx=5, pady=5) #################################### frame1 = Frame(self) frame1.pack() frame1.place(x=50, y=100) lbl1 = Label(frame1, text="Name", width=15) lbl1.pack(side=LEFT, padx=7, pady=5) self.entry1 = Entry(frame1, width=20) self.entry1.pack(padx=5, expand=True) #################################### frame2 = Frame(self) frame2.pack() frame2.place(x=50, y=130) lbl2 = Label(frame2, text="F Name", width=15) lbl2.pack(side=LEFT, padx=7, pady=5) self.entry2 = Entry(frame2) self.entry2.pack(fill=X, padx=5, expand=True) ###################################### frame3 = Frame(self) frame3.pack() frame3.place(x=50, y=160) lbl3 = Label(frame3, text="DOB(D/M/Y)", width=15) lbl3.pack(side=LEFT, padx=7, pady=5) self.entry3 = Entry(frame3) self.entry3.pack(fill=X, padx=5, expand=True) ####################################### frame4 = Frame(self) frame4.pack() frame4.place(x=50, y=190) lbl4 = Label(frame4, text="Medium(H/E)", width=15) lbl4.pack(side=LEFT, padx=7, pady=5) self.entry4 = Entry(frame4) self.entry4.pack(fill=X, padx=5, expand=True) ########################################## frame5 = Frame(self) frame5.pack() frame5.place(x=50, y=225) MODES = [ ("M", "Male"), ("F", "Female"), ] lbl5 = Label(frame5, text="Gender", width=15) lbl5.pack(side=LEFT, padx=7, pady=5) global v v = StringVar() v.set("Male") # initialize for text, mode in MODES: b = Radiobutton(frame5, text=text, variable=v, value=mode) b.pack(side=LEFT, padx=10) ############################################ #####printing line lbl5a = Label( text="___________________________________________________") lbl5a.pack() lbl5a.place(x=45, y=255) ############################################ frame6 = Frame(self) frame6.pack() frame6.place(x=50, y=290) lbl6 = Label(frame6, text="Phone No:", width=15) lbl6.pack(side=LEFT, padx=7, pady=5) self.entry6 = Entry(frame6) self.entry6.pack(fill=X, padx=5, expand=True) ################################################ frame7 = Frame(self) frame7.pack() frame7.place(x=50, y=320) lbl7 = Label(frame7, text="Landline No:", width=15) lbl7.pack(side=LEFT, padx=7, pady=5) self.entry7 = Entry(frame7) self.entry7.pack(fill=X, padx=5, expand=True) ############################################### frame8 = Frame(self) frame8.pack() frame8.place(x=50, y=350) lbl8 = Label(frame8, text="Email:", width=15) lbl8.pack(side=LEFT, padx=7, pady=5) self.entry8 = Entry(frame8) self.entry8.pack(fill=X, padx=5, expand=True) ############################################# frame9 = Frame(self) frame9.pack() frame9.place(x=50, y=380) lbl9 = Label(frame9, text="HomeTown:", width=15) lbl9.pack(side=LEFT, padx=7, pady=5) self.entry9 = Entry(frame9) self.entry9.pack(fill=X, padx=5, expand=True) ############################################### frame10 = Frame(self) frame10.pack() frame10.place(x=60, y=415) lbl10 = Label(frame10, text="Address:") lbl10.pack(padx=5, pady=5) self.entry10 = Text(frame10, height=5, width=28) self.entry10.pack(padx=5, expand=True) ############################################## ############################################# frame11 = Frame(self) frame11.pack() frame11.place(x=350, y=100) lbl11x = Label(frame11, text="_______Class 10th Data_______") lbl11x.pack(padx=0, pady=0) lbl11 = Label(text="%", width=15) lbl11.pack(side=LEFT, padx=0, pady=0) lbl11.place(x=350, y=130) self.entry11 = Entry(width=12) self.entry11.pack(padx=1, expand=True) self.entry11.place(x=420, y=130) lbl11a = Label(text="Passing Year", width=15) lbl11a.pack(padx=0, pady=2) lbl11a.place(x=350, y=160) self.entry11a = Entry(width=12) self.entry11a.pack(padx=1, expand=True) self.entry11a.place(x=420, y=160) lbl11b = Label(text="Board Name", width=15) lbl11b.pack(padx=0, pady=2) lbl11b.place(x=350, y=190) self.entry11b = Entry(width=12) self.entry11b.pack(padx=1, expand=True) self.entry11b.place(x=420, y=190) #################################################### frame12 = Frame(self) frame12.pack() frame12.place(x=510, y=100) lbl12x = Label(frame12, text="_______Class 12th Data_______") lbl12x.pack(padx=0, pady=0) lbl12 = Label(text="%", width=15) lbl12.pack(side=LEFT, padx=0, pady=0) lbl12.place(x=510, y=130) self.entry12 = Entry(width=12) self.entry12.pack(padx=1, expand=True) self.entry12.place(x=580, y=130) lbl12a = Label(text="Passing Year", width=15) lbl12a.pack(padx=0, pady=2) lbl12a.place(x=510, y=160) self.entry12a = Entry(width=12) self.entry12a.pack(padx=1, expand=True) self.entry12a.place(x=580, y=160) lbl12b = Label(text="Board Name", width=15) lbl12b.pack(padx=0, pady=2) lbl12b.place(x=510, y=190) self.entry12b = Entry(width=12) self.entry12b.pack(padx=1, expand=True) self.entry12b.place(x=580, y=190) ##################################################### frame13 = Frame(self) frame13.pack() frame13.place(x=670, y=100) lbl13x = Label(frame13, text="________B.Tech Data_________") lbl13x.pack(padx=0, pady=0) lbl13 = Label(text="%", width=15) lbl13.pack(side=LEFT, padx=0, pady=0) lbl13.place(x=670, y=130) self.entry13 = Entry(width=12) self.entry13.pack(padx=1, expand=True) self.entry13.place(x=740, y=130) lbl13a = Label(text="Passing Year", width=15) lbl13a.pack(padx=0, pady=2) lbl13a.place(x=670, y=160) self.entry13a = Entry(width=12) self.entry13a.pack(padx=1, expand=True) self.entry13a.place(x=740, y=160) lbl13b = Label(text="College", width=15) lbl13b.pack(padx=0, pady=2) lbl13b.place(x=670, y=190) self.entry13b = Entry(width=12) self.entry13b.pack(padx=1, expand=True) self.entry13b.place(x=740, y=190) #################################################### frame14 = Frame(self) frame14.pack() frame14.place(x=380, y=255) lbl14 = Label(frame14, text="Any Other Info:") lbl14.pack(padx=5, pady=5) self.entry14 = Text(frame14, height=5, width=28) self.entry14.pack(padx=5, expand=True) frame15 = Frame(self) frame15.pack() frame15.place(x=650, y=290) openButton = Button(frame15, text="Attatch Resume", width=15, command=self.openResume) openButton.pack(padx=5, pady=5) self.entry15 = Entry(frame15) self.entry15.pack(fill=X, padx=4, expand=True) ############################################################# frame16 = Frame(self) frame16.pack() frame16.place(x=450, y=500) closeButton = Button(frame16, text="SUBMIT", width=35, command=self.getDatax) closeButton.pack(padx=5, pady=5) ####################################### framexxx = Frame(self) framexxx.pack() framexxx.place(x=700, y=600) self.xxx = Label(framexxx, text="Recent Changes Will Appear Here") self.xxx.config(font=labelfont8) self.xxx.pack() ####################################### frame000 = Frame(self) frame000.pack() frame000.place(x=50, y=600) self.lbl000 = Label(frame000, text="Beta/Sample2.0 | (c) Nakul Rathore") self.lbl000.config(font=labelfont8) self.lbl000.pack(padx=5, pady=5)
def initUI(self): self.parent.title("Append Data") self.pack(fill=BOTH, expand=True) labelfont20 = ('Roboto', 15, 'bold') labelfont10 = ('Roboto', 10, 'bold') labelfont8 = ('Roboto', 8, 'bold') frame0 = Frame(self) frame0.pack() lbl0 = Label(frame0, text="Hi Nakul") lbl0.config(font=labelfont20) lbl0.pack( padx=5, pady=5) lbl00 = Label(frame0, text="Fill the data here") lbl00.config(font=labelfont10) lbl00.pack( padx=5, pady=5) #################################### frame1 = Frame(self) frame1.pack() frame1.place(x=50, y=100) lbl1 = Label(frame1, text="Name", width=15) lbl1.pack(side=LEFT,padx=7, pady=5) self.entry1 = Entry(frame1,width=20) self.entry1.pack(padx=5, expand=True) #################################### frame2 = Frame(self) frame2.pack() frame2.place(x=50, y=130) lbl2 = Label(frame2, text="F Name", width=15) lbl2.pack(side=LEFT, padx=7, pady=5) self.entry2 = Entry(frame2) self.entry2.pack(fill=X, padx=5, expand=True) ###################################### frame3 = Frame(self) frame3.pack() frame3.place(x=50, y=160) lbl3 = Label(frame3, text="DOB(D/M/Y)", width=15) lbl3.pack(side=LEFT, padx=7, pady=5) self.entry3 = Entry(frame3) self.entry3.pack(fill=X, padx=5, expand=True) ####################################### frame4 = Frame(self) frame4.pack() frame4.place(x=50, y=190) lbl4 = Label(frame4, text="Medium(H/E)", width=15) lbl4.pack(side=LEFT, padx=7, pady=5) self.entry4 = Entry(frame4) self.entry4.pack(fill=X, padx=5, expand=True) ########################################## frame5 = Frame(self) frame5.pack() frame5.place(x=50, y=225) MODES = [ ("M", "Male"), ("F", "Female"), ] lbl5 = Label(frame5, text="Gender", width=15) lbl5.pack(side=LEFT, padx=7, pady=5) global v v = StringVar() v.set("Male") # initialize for text, mode in MODES: b = Radiobutton(frame5, text=text,variable=v, value=mode) b.pack(side=LEFT,padx=10) ############################################ #####printing line lbl5a = Label(text="___________________________________________________") lbl5a.pack() lbl5a.place(x=45, y=255) ############################################ frame6 = Frame(self) frame6.pack() frame6.place(x=50, y=290) lbl6 = Label(frame6, text="Phone No:", width=15) lbl6.pack(side=LEFT, padx=7, pady=5) self.entry6 = Entry(frame6) self.entry6.pack(fill=X, padx=5, expand=True) ################################################ frame7 = Frame(self) frame7.pack() frame7.place(x=50, y=320) lbl7 = Label(frame7, text="Landline No:", width=15) lbl7.pack(side=LEFT, padx=7, pady=5) self.entry7 = Entry(frame7) self.entry7.pack(fill=X, padx=5, expand=True) ############################################### frame8 = Frame(self) frame8.pack() frame8.place(x=50, y=350) lbl8 = Label(frame8, text="Email:", width=15) lbl8.pack(side=LEFT, padx=7, pady=5) self.entry8 = Entry(frame8) self.entry8.pack(fill=X, padx=5, expand=True) ############################################# frame9 = Frame(self) frame9.pack() frame9.place(x=50, y=380) lbl9 = Label(frame9, text="HomeTown:", width=15) lbl9.pack(side=LEFT, padx=7, pady=5) self.entry9 = Entry(frame9) self.entry9.pack(fill=X, padx=5, expand=True) ############################################### frame10 = Frame(self) frame10.pack() frame10.place(x=60, y=415) lbl10 = Label(frame10, text="Address:") lbl10.pack( padx=5, pady=5) self.entry10 = Text(frame10,height=5, width=28) self.entry10.pack(padx=5, expand=True) ############################################## ############################################# frame11 = Frame(self) frame11.pack() frame11.place(x=350, y=100) lbl11x = Label(frame11,text="_______Class 10th Data_______") lbl11x.pack(padx=0, pady=0) lbl11 = Label(text="%",width=15) lbl11.pack(side=LEFT,padx=0, pady=0) lbl11.place(x=350, y=130) self.entry11 = Entry(width=12) self.entry11.pack(padx=1, expand=True) self.entry11.place(x=420, y=130) lbl11a = Label(text="Passing Year",width=15) lbl11a.pack(padx=0, pady=2) lbl11a.place(x=350, y=160) self.entry11a = Entry(width=12) self.entry11a.pack(padx=1, expand=True) self.entry11a.place(x=420, y=160) lbl11b = Label(text="Board Name",width=15) lbl11b.pack(padx=0, pady=2) lbl11b.place(x=350, y=190) self.entry11b = Entry(width=12) self.entry11b.pack(padx=1, expand=True) self.entry11b.place(x=420, y=190) #################################################### frame12 = Frame(self) frame12.pack() frame12.place(x=510, y=100) lbl12x = Label(frame12,text="_______Class 12th Data_______") lbl12x.pack(padx=0, pady=0) lbl12 = Label(text="%",width=15) lbl12.pack(side=LEFT,padx=0, pady=0) lbl12.place(x=510, y=130) self.entry12 = Entry(width=12) self.entry12.pack(padx=1, expand=True) self.entry12.place(x=580, y=130) lbl12a = Label(text="Passing Year",width=15) lbl12a.pack(padx=0, pady=2) lbl12a.place(x=510, y=160) self.entry12a = Entry(width=12) self.entry12a.pack(padx=1, expand=True) self.entry12a.place(x=580, y=160) lbl12b = Label(text="Board Name",width=15) lbl12b.pack(padx=0, pady=2) lbl12b.place(x=510, y=190) self.entry12b = Entry(width=12) self.entry12b.pack(padx=1, expand=True) self.entry12b.place(x=580, y=190) ##################################################### frame13 = Frame(self) frame13.pack() frame13.place(x=670, y=100) lbl13x = Label(frame13,text="________B.Tech Data_________") lbl13x.pack(padx=0, pady=0) lbl13 = Label(text="%",width=15) lbl13.pack(side=LEFT,padx=0, pady=0) lbl13.place(x=670, y=130) self.entry13 = Entry(width=12) self.entry13.pack(padx=1, expand=True) self.entry13.place(x=740, y=130) lbl13a = Label(text="Passing Year",width=15) lbl13a.pack(padx=0, pady=2) lbl13a.place(x=670, y=160) self.entry13a = Entry(width=12) self.entry13a.pack(padx=1, expand=True) self.entry13a.place(x=740, y=160) lbl13b = Label(text="College",width=15) lbl13b.pack(padx=0, pady=2) lbl13b.place(x=670, y=190) self.entry13b = Entry(width=12) self.entry13b.pack(padx=1, expand=True) self.entry13b.place(x=740, y=190) #################################################### frame14 = Frame(self) frame14.pack() frame14.place(x=380, y=255) lbl14 = Label(frame14, text="Any Other Info:") lbl14.pack( padx=5, pady=5) self.entry14 = Text(frame14,height=5, width=28) self.entry14.pack(padx=5, expand=True) frame15 = Frame(self) frame15.pack() frame15.place(x=650, y=290) openButton = Button(frame15, text="Attatch Resume",width=15,command=self.openResume) openButton.pack(padx=5, pady=5) self.entry15 = Entry(frame15) self.entry15.pack(fill=X, padx=4, expand=True) ############################################################# frame16 = Frame(self) frame16.pack() frame16.place(x=450, y=500) closeButton = Button(frame16, text="SUBMIT",width=35,command=self.getDatax) closeButton.pack(padx=5, pady=5) ####################################### framexxx = Frame(self) framexxx.pack() framexxx.place(x=700, y=600) self.xxx = Label(framexxx,text="Recent Changes Will Appear Here") self.xxx.config(font=labelfont8) self.xxx.pack() ####################################### frame000 = Frame(self) frame000.pack() frame000.place(x=50, y=600) self.lbl000= Label(frame000, text="Beta/Sample2.0 | (c) Nakul Rathore") self.lbl000.config(font=labelfont8) self.lbl000.pack( padx=5, pady=5)
class guiDemo3(Frame): def __init__(self,parent): Frame.__init__(self,parent) self.parent = parent self.dict = {} #temporary self.initUI() #start up the main menu def initUI(self): try: self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.mainMenuLabel= Label(self, text="Main Menu") self.mainMenuLabel.pack(side=TOP,padx=5, pady=5) self.singleModeButton= Button(self, text="Single Computer Mode", command=self.unpackInitUI_LoadSingleComputerMode) self.singleModeButton.pack(side=TOP, padx=5, pady=5) self.networkModeButton= Button(self, text="Networking Mode", command=self.unpackInitUI_LoadNetworkMode) self.networkModeButton.pack(side=TOP, padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in initUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" #end of initUI//////////////////////////// def unpackInitUI_LoadSingleComputerMode(self): self.closeButton.pack_forget() self.mainMenuLabel.pack_forget() self.singleModeButton.pack_forget() self.networkModeButton.pack_forget() self.singleModeUI() def unpackInitUI_LoadNetworkMode(self): self.closeButton.pack_forget() self.mainMenuLabel.pack_forget() self.singleModeButton.pack_forget() self.networkModeButton.pack_forget() self.networkModeUI() def unpackSingleModeUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.singleModeLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.initUI() def unpackSingleModeUI_LoadSingleDictionaryUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.singleModeLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.dictionaryCrackingMethodUI(0) def unpackSingleModeUI_LoadSingleBruteForceUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.singleModeLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodUI(0) def unpackSingleModeUI_LoadSingleRainbowTableUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.singleModeLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodUI(0) def singleModeUI(self): try: self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackSingleModeUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.singleModeLabel= Label(self, text="Single Computer Mode") self.singleModeLabel.pack(side=TOP, padx=5, pady=5) self.selectCrackingMethodLabel= Label(self, text="Select Your Cracking Method") self.selectCrackingMethodLabel.pack(side=TOP, padx=5, pady=5) self.dictionaryCrackingMethodButton= Button(self, text="Dictionary", command=self.unpackSingleModeUI_LoadSingleDictionaryUI) self.dictionaryCrackingMethodButton.pack(side=TOP, padx=5, pady=5) self.bruteForceCrackingMethodButton= Button(self, text="Brute-Force (default)", command=self.unpackSingleModeUI_LoadSingleBruteForceUI) self.bruteForceCrackingMethodButton.pack(side=TOP, padx=5, pady=5) self.rainbowTableCrackingMethodButton= Button(self, text="Rainbow Table", command=self.unpackSingleModeUI_LoadSingleRainbowTableUI) self.rainbowTableCrackingMethodButton.pack(side=TOP, padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in singleModeUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" #End of single mode def unpackNetworkModeUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkModeLabel.pack_forget() self.selectNetworkModuleLabel.pack_forget() self.serverModuleButton.pack_forget() self.clientModuleButton.pack_forget() self.initUI() def networkModeUI(self): try: self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackNetworkModeUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.networkModeLabel= Label(self, text="Network Mode: Server/Client Selection Screen") self.networkModeLabel.pack(side=TOP, padx=5, pady=5) self.selectNetworkModuleLabel= Label(self, text="Select Server or Client") self.selectNetworkModuleLabel.pack(side=TOP, padx=5, pady=5) self.serverModuleButton= Button(self, text="I am the Server", command= self.unpackNetworkModeUI_LoadNetworkServerUI) self.serverModuleButton.pack(side=TOP, padx=5, pady=5) self.clientModuleButton= Button(self, text="I am a Client", command= self.unpackNetworkModeUI_LoadNetworkClientUI) self.clientModuleButton.pack(side=TOP, padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in networkModeUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" #end of networkModeUI def unpackNetworkModeUI_LoadNetworkServerUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkModeLabel.pack_forget() self.selectNetworkModuleLabel.pack_forget() self.serverModuleButton.pack_forget() self.clientModuleButton.pack_forget() self.networkServerUI() def unpackNetworkModeUI_LoadNetworkClientUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkModeLabel.pack_forget() self.selectNetworkModuleLabel.pack_forget() self.serverModuleButton.pack_forget() self.clientModuleButton.pack_forget() self.networkClientUI() def unpackNetworkClientUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkClientLabel.pack_forget() self.insertServerIPLabel.pack_forget() self.insertServerIPTextfield.pack_forget() self.startClientButton.pack_forget() self.initUI() def networkClientUI(self): try: self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackNetworkClientUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.networkClientLabel= Label(self, text="Network Client") self.networkClientLabel.pack(side=TOP, padx=5, pady=5) self.insertServerIPLabel= Label(self, text="Enter in the Server's IP:") self.insertServerIPLabel.pack(side=TOP, padx=5, pady=5) self.insertServerIPTextfield= Entry(self, bd=5) self.insertServerIPTextfield.pack(side=TOP, padx=5, pady=5) #TODO allow right click for pasting into box self.startClientButton= Button(self, text="Start Client", command=lambda: self.startClient(str(self.insertServerIPTextfield.get()))) self.startClientButton.pack(side=TOP, padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in networkClientUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" #end of networkclient UI def startClient(self,inputIP): try: if(len(inputIP) < 1): showwarning("Network Client Start Warning: NO IP","No IP address has been entered!") else: self.networkClient= Process(target=Client, args=(inputIP,)) self.networkClient.start() self.networkClientStatusUI() except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in startClient definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" def networkClientStatusUI(self): self.networkClientStatusWindow= Tk() self.networkClientStatusWindow.geometry("640x480") self.networkClientStatusWindow.title("Network Client Status Window") self.networkClientStatusWindow.style = Style() self.networkClientStatusWindow.style.theme_use("default") self.networkClientStatusWindow.pack(fill=BOTH, expand=1) #TODO throws an attribute error on 'pack', thus nothing is drawn to the screen, fix this self.CloseButton= Button(self, text="Close Status Window", command=lambda: closeStatusWindow()) self.CloseButton.pack(side=BOTTOM, padx=5, pady=5) def closeStatusWindow(self): self.networkClientStatusWindow.destroy() def unpackNetworkServerUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkServerLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.initUI() def networkServerUI(self): try: self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackNetworkServerUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.networkServerLabel= Label(self, text="Network Server") self.networkServerLabel.pack(side=TOP, padx=5, pady=5) self.selectCrackingMethodLabel= Label(self, text="Select Your Cracking Method") self.selectCrackingMethodLabel.pack(side=TOP, padx=5, pady=5) self.dictionaryCrackingMethodButton= Button(self, text="Dictionary", command=self.unpackNetworkServerUI_LoadNetworkDictionaryUI) self.dictionaryCrackingMethodButton.pack(side=TOP, padx=5, pady=5) self.bruteForceCrackingMethodButton= Button(self, text="Brute-Force (default)", command=self.unpackNetwrokServerUI_LoadNetworkBruteForceUI) self.bruteForceCrackingMethodButton.pack(side=TOP, padx=5, pady=5) self.rainbowTableCrackingMethodButton= Button(self, text="Rainbow Table", command=self.unpackNetworkServerUI_LoadNetworkRainbowTableUI) self.rainbowTableCrackingMethodButton.pack(side=TOP, padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in networkServerUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" #end of networkServerUI def unpackNetworkServerUI_LoadNetworkDictionaryUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkServerLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.dictionaryCrackingMethodUI(1) def unpackNetwrokServerUI_LoadNetworkBruteForceUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkServerLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodUI(1) def unpackNetworkServerUI_LoadNetworkRainbowTableUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkServerLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodUI(1) def unpackDictionaryCrackingMethodUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.dictionaryCrackingMethodLabel.pack_forget() self.currentModeLabel.pack_forget() self.dictionaryFileLocationLabel.pack_forget() self.selectedDictionaryFileLabel.pack_forget() self.selectDictionaryFileButton.pack_forget() self.inputHashTextFieldLabel.pack_forget() self.inputHashTextField.pack_forget() self.selectAlgorithmLabel.pack_forget() self.md5RadioButton.pack_forget() self.sha1RadioButton.pack_forget() self.sha224RadioButton.pack_forget() self.sha256RadioButton.pack_forget() self.sha512RadioButton.pack_forget() self.startDictionaryCrackButton.pack_forget() self.initUI() def dictionaryCrackingMethodUI(self,mode): #mode is either 1 (network) or 0 (single) currentMode= "ERROR: Mode not selected" #initialize variable self.selectedDictionaryFile= "" selectedAlgorithm= "MD5" #set to md5 as the default inputHash= StringVar() inputHash.set("") try: if(mode == 0): currentMode= "Single" elif(mode == 1): currentMode= "Network" else: raise Exception("ERROR: Invalid mode parameter: '"+str(mode)+"'") self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackDictionaryCrackingMethodUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.dictionaryCrackingMethodLabel= Label(self, text="Dictionary Cracking Method") self.dictionaryCrackingMethodLabel.pack(side=TOP, padx=5, pady=5) self.currentModeLabel = Label(self,text="Current Mode: "+str(currentMode)) self.currentModeLabel.pack(side=TOP, padx=5, pady=5) self.dictionaryFileLocationLabel= Label(self, text="Dictionary File to be used:") self.dictionaryFileLocationLabel.pack(side=TOP, padx=5, pady=5) self.selectedDictionaryFileLabel= Label(self, text=str(self.selectedDictionaryFile)) self.selectedDictionaryFileLabel.pack(side=TOP, padx=5, pady=5) self.selectDictionaryFileButton= Button(self, text="Select Dictionary File", textvariable= str(self.selectedDictionaryFile), command=self.selectFileWindow) # self.selectDictionaryFileButton.pack(side=TOP, padx=5, pady=5) #TODO modify the dictionary file so that when a file is selected, that filepath is passed onto server #TODO check for dictionary file existance before handling (and file extensions for windows) #TODO insert option to crack a file of hashes (pass file to the server/single) #TODO check for file existance before handling (and file extensions for windows) self.inputHashTextFieldLabel= Label(self, text="The hash to be cracked:") self.inputHashTextFieldLabel.pack(side=TOP, padx=5, pady=5) self.inputHashTextField= Entry(self, bd=5, textvariable= inputHash) self.inputHashTextField.pack(side=TOP, padx=5, pady=5) self.selectAlgorithmLabel = Label(self, text="Select the Cracking Algorithm:") self.selectAlgorithmLabel.pack(side=TOP, padx=5, pady=5) self.md5RadioButton= Radiobutton(self, text="MD5 (default)", variable= selectedAlgorithm, value="MD5" ) self.md5RadioButton.pack(side=LEFT, padx=5, pady=5) self.sha1RadioButton= Radiobutton(self, text="SHA 1", variable= selectedAlgorithm, value="SHA 1") self.sha1RadioButton.pack(side=LEFT, padx=5, pady=5) self.sha224RadioButton= Radiobutton(self, text="SHA 224", variable= selectedAlgorithm, value="SHA 224") self.sha224RadioButton.pack(side=LEFT, padx=5, pady=5) self.sha256RadioButton= Radiobutton(self, text="SHA 256", variable= selectedAlgorithm, value="SHA 256") self.sha256RadioButton.pack(side=LEFT, padx=5, pady=5) self.sha512RadioButton= Radiobutton(self, text="SHA 512", variable= selectedAlgorithm, value="SHA 512") self.sha512RadioButton.pack(side=LEFT, padx=5, pady=5) #TODO display result in a noneditable text view if(currentMode is 'Single'): self.dict = {'cracking method': "dic", 'file name': str(self.selectedDictionaryFileLabel.cget("text")), 'algorithm': selectedAlgorithm, 'hash': str(inputHash.get()), 'single':"True"} print "selectedDictionaryFileLabel text="+str(self.selectedDictionaryFileLabel.cget("text")) self.startDictionaryCrackButton= Button(self, text="Start Dictionary Crack (Single Mode)", command=lambda: self.startNetworkServer(self.dict)) self.startDictionaryCrackButton.pack(side=BOTTOM, padx=5, pady=5) elif(currentMode is 'Network'): print "GUI DEBUG: Inside elif(currentMode is 'Network)" if(len(str(self.inputHashTextField)) < 1): showwarning("Empty hash text field", "The hash text field is empty") else: print "GUI DEBUG: '"+str(self.inputHashTextField.get())+"'" self.dict = {'cracking method': "dic", 'file name': str(self.selectedDictionaryFile), 'algorithm': selectedAlgorithm, 'hash': str(inputHash.get())} self.startDictionaryCrackButton= Button(self, text="Start Dictionary Crack (Network Mode)", command=lambda: self.startNetworkServer(self.dict)) self.startDictionaryCrackButton.pack(side=BOTTOM, padx=5, pady=5) else: raise Exception("GUI ERROR: Invalid currentMode in startDictionaryCrackButton: '"+str(currentMode)+"'") except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in dictionaryCrackingMethodUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" #end of dictionary cracking methodUI def setDictHash(self,newHash): print "GUI DEBUG: hash is: '"+str(newHash)+"'" self.dict['hash']= str(newHash) def startNetworkServer(self, crackingMethod): print "GUI DEBUG: hash is: '"+str(crackingMethod['hash'])+"'" self.networkServer= Process(target=Server, args=(crackingMethod,)) self.networkServer.start() #TODO idea: create a server is running window, with the stats def unpackBruteForceCrackingMethodUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.inputHashTextFieldLabel.pack_forget() self.inputHashTextField.pack_forget() self.bruteForceCrackingMethodLabel.pack_forget() self.currentModeLabel.pack_forget() self.startBruteForceCrackButton.pack_forget() self.algorithmSelectionLabel.pack_forget() self.algorithmOptionMenu.pack_forget() self.alphabetSelectionLabel.pack_forget() self.alphabetOptionMenu.pack_forget() self.minKeyLengthLabel.pack_forget() self.minKeyLengthTextField.pack_forget() self.maxKeyLengthLabel.pack_forget() self.maxKeyLengthTextField.pack_forget() self.outputHashTextFieldLabel.pack_forget() self.outputHashTextField.pack_forget() self.initUI() def bruteForceCrackingMethodUI(self, mode): #mode is either 1 (network) or 0 (single) currentMode= None selectedAlgorithm= StringVar() selectedAlgorithm.set("MD5") selectedAlphabet= StringVar() selectedAlphabet.set("All") minKeyLength= IntVar() minKeyLength.set(5) maxKeyLength= IntVar() maxKeyLength.set(15) inputHash= StringVar() inputHash.set("") try: if(mode==0): currentMode= "Single" elif(mode ==1): currentMode= "Network" else: raise Exception("ERROR: Invalid mode parameter: '"+str(mode)+"'") self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackBruteForceCrackingMethodUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.bruteForceCrackingMethodLabel = Label(self, text="Brute-Force Cracking Method") self.bruteForceCrackingMethodLabel.pack(side=TOP, padx=5, pady=5) self.currentModeLabel= Label(self, text="Current Mode: "+str(currentMode)) self.currentModeLabel.pack(side=TOP, padx=5, pady=5) self.algorithmSelectionLabel= Label(self, text="Select which algorithm you want to use:") self.algorithmSelectionLabel.pack(side=TOP, padx=5, pady=5) self.algorithmOptionMenu= OptionMenu(self, selectedAlgorithm, "MD5", "SHA 1", "SHA 224", "SHA 256", "SHA 512") self.algorithmOptionMenu.pack(side=TOP, padx=5, pady=5) self.alphabetSelectionLabel= Label(self, text="Select which alphabet you want to use:") self.alphabetSelectionLabel.pack(side=TOP, padx=5, pady=5) self.alphabetOptionMenu= OptionMenu(self, selectedAlphabet, "All", "ASCII_Uppercase", "ASCII_Lowercase", "Digits", "Special_Symbols") self.alphabetOptionMenu.pack(side=TOP, padx=5, pady=5) self.minKeyLengthLabel= Label(self, text="Select the minimum key length: (Default is 5)") self.minKeyLengthLabel.pack(side=TOP, padx=5, pady=5) self.minKeyLengthTextField= Entry(self, bd=5, textvariable= minKeyLength) self.minKeyLengthTextField.pack(side=TOP, padx=5, pady=5) self.maxKeyLengthLabel= Label(self, text="Select the maximum key length: (Default is 15)") self.maxKeyLengthLabel.pack(side=TOP, padx=5, pady=5) self.maxKeyLengthTextField= Entry(self, bd=5, textvariable= maxKeyLength) self.maxKeyLengthTextField.pack(side=TOP, padx=5, pady=5) #TODO add support for combination of alphabets #TODO insert option to hash a file of hashes (pass the file to server/single) #TODO check for file existance before handling (and file extensions for windows) self.inputHashTextFieldLabel= Label(self, text="The hash to be cracked:") self.inputHashTextFieldLabel.pack(side=TOP, padx=5, pady=5) self.inputHashTextField= Entry(self, bd=5, textvariable= inputHash) self.inputHashTextField.pack(side=TOP, padx=5, pady=5) #TODO display results is a copiable textview if(currentMode is 'Single'): self.dict = {'cracking method': "bf", 'hash': str(inputHash.get()), 'algorithm':str(selectedAlgorithm.get()), 'alphabet':str(selectedAlphabet.get()), 'min key length':int(minKeyLength.get()), 'max key length':int(maxKeyLength.get()), 'single':"True"} self.startBruteForceCrackButton= Button(self, text="Start Brute-Force Crack (Single Mode)", command=lambda: self.startNetworkServer(self.dict)) self.startBruteForceCrackButton.pack(side=BOTTOM, padx=5, pady=5) elif(currentMode is 'Network'): # print "GUI DEBUG: Inside elif(currentMode is 'Network)" #if(len(str(inputHash.get())) < 1): # showwarning("Empty hash text field", "The hash text field is empty") #else: print "GUI DEBUG: '"+str(self.inputHashTextField.get())+"'" self.dict = {'cracking method': "bf", 'hash': str(inputHash.get()), 'algorithm':str(selectedAlgorithm.get()), 'alphabet':str(selectedAlphabet.get()), 'min key length':int(minKeyLength.get()), 'max key length':int(maxKeyLength.get())} self.startBruteForceCrackButton= Button(self, text="Start Brute-Force Crack (Network Mode)", command=lambda: self.startNetworkServer(self.dict)) self.startBruteForceCrackButton.pack(side=BOTTOM, padx=5, pady=5) else: raise Exception("ERROR: Invalid mode parameter in Brute-Force CrackingUI: '"+str(mode)+"'") #This will display the results, could set to show up after the program is run. self.outputHashTextFieldLabel= Label(self, text="Results") self.outputHashTextFieldLabel.pack(side=TOP, padx=5, pady=5) self.outputHashTextField= Entry(self, bd=5) self.outputHashTextField.insert(0, "Test") self.outputHashTextField.pack(side=TOP,padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in bruteForceCrackingMethodUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" #end of brute force cracking UI def unpackRainbowTableCrackingMethodUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.rainbowTableCrackingMethodLabel.pack_forget() self.currentModeLabel.pack_forget() self.initUI() def rainbowTableCrackingMethodUI(self, mode): #mode is either 1 (network) or 0 (single) currentMode= None try: if(mode == 0): currentMode = "Single" elif(mode == 1): currentMode = "Network" else: raise Exception("ERROR: Invalid mode parameter: '"+str(mode)+"'") self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackRainbowTableCrackingMethodUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.rainbowTableCrackingMethodLabel= Label(self, text="Rainbow Table Cracking Method") self.rainbowTableCrackingMethodLabel.pack(side=TOP, padx=5, pady=5) self.currentModeLabel= Label(self,text="Current Mode: "+str(currentMode)) self.currentModeLabel.pack(side=TOP, padx=5, pady=5) #TODO insert Rainbow table settings here except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in rainbowTableCrackingMethodUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" #end of rainbow table cracking UI def selectFileWindow(self): filename= "" filename= askopenfilename() #remove the file extension # modifiedFileName= self.removeFileNameExtension(filename) print "Modified fileName= '"+str(filename)+"'" self.selectedDictionaryFileLabel.config(text=str(filename)) self.selectedDictionaryFile= str(self.selectedDictionaryFileLabel.cget("text")) ''' def removeFileNameExtension(self, inputFileName): outboundFileName= "" lastForwardSlashPos=0 for i in range(0, len(inputFileName)): if(inputFileName[i] == "."): break elif(inputFileName[i] == "/"): lastForwardSlashPos= i outboundFileName+= inputFileName[i] else: outboundFileName+= inputFileName[i] print "FileName after extension is removed: '"+str(outboundFileName)+"'" pathlessFileName= self.removeAbsoluteFilePath(outboundFileName, lastForwardSlashPos) print "FileName after absolute filepath was removed: '"+str(pathlessFileName)+"'" return pathlessFileName def removeAbsoluteFilePath(self, inboundFilePath, lastForwardSlashPos): relativeFilePath= "" for i in range(lastForwardSlashPos+1, len(inboundFilePath)): if(inboundFilePath[i] is not None): relativeFilePath+= inboundFilePath[i] else: break return relativeFilePath ''' def confirmExit(self): result= askyesno('Exit Confirmation', 'Are you sure you want to quit this application? \n (WARNING: All server, client, and single computer processes will be terminated!!)') if result == True: self.onExit() #if no is selected, then the window just closes def onExit(self): # self.networkServer.join() try: self.networkServer.terminate() except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in onExit terminate networkserver process Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" #self.networkClient.join() try: self.networkClient.terminate() except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in onExit terminate networkclient process Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" self.parent.destroy()
def initUI(self): self.parent.title("Graphs") self.style = Style() self.style.theme_use("clam") self.pack(fill=BOTH, expand=1) self.columnconfigure(1, weight=1) self.columnconfigure(3, weight=1) self.columnconfigure(6, pad=7) self.rowconfigure(3, weight=1) self.rowconfigure(5, pad=7) menu = Menu(self.parent) self.parent.config(menu=menu) filemenu = Menu(menu) menu.add_cascade(label="File", menu=filemenu) filemenu.add_command(label="Load data", command=self.load_data) # lable to show current file and chanel self.file_lbl = Label(self, text="") self.file_lbl.grid(row=0, column=3, pady=4, padx=5) # list box fro data files self.file_list = ScrolledList(self, lambda x: self.load_hunt_data(x)) self.file_list.grid(row=1, column=0, columnspan=3, rowspan=4, padx=5, sticky=E + W + S + N) # chanel graph viewer self.graph_viewer = TkinterGraph(self) self.graph_viewer.grid(row=1, column=3, columnspan=2, rowspan=4, padx=5, sticky=E + W + S + N) btn1 = Button(self, text="Left", command=lambda: self.plot_left()) btn1.grid(row=1, column=6) btn2 = Button(self, text="Right", command=lambda: self.plot_right()) btn2.grid(row=2, column=6, pady=4) # frames for the classifier for the two chanels self.frame_left = Frame(self, borderwidth=1) self.frame_right = Frame(self, borderwidth=1) self.frame_left.grid(row=5, column=3, columnspan=2, rowspan=1) btn4 = Button(self, text="SAVE", command=lambda: self.save_graph()) btn4.grid(row=5, column=6) # note manual addition of labels so that the lable will be to the right of tha radio button self.classify_left = StringVar() Label(self.frame_left, text="Left :").pack(side=LEFT) Label(self.frame_left, text="Type A").pack(side=LEFT) rb1 = Radiobutton(self.frame_left, variable=self.classify_left, value="TypeA") rb1.pack(side=LEFT) Label(self.frame_left, text="Type B").pack(side=LEFT) rb1 = Radiobutton(self.frame_left, variable=self.classify_left, value="TypeB") rb1.pack(side=LEFT) Label(self.frame_left, text="Type C").pack(side=LEFT) rb1 = Radiobutton(self.frame_left, variable=self.classify_left, value="TypeC") rb1.pack(side=LEFT) Label(self.frame_left, text="Type D").pack(side=LEFT) rb1 = Radiobutton(self.frame_left, variable=self.classify_left, value="TypeD") rb1.pack(side=LEFT) self.classify_right = StringVar() Label(self.frame_right, text="Right :").pack(side=LEFT) Label(self.frame_right, text="Type A").pack(side=LEFT) rb1 = Radiobutton(self.frame_right, variable=self.classify_right, value="TypeA") rb1.pack(side=LEFT) Label(self.frame_right, text="Type B").pack(side=LEFT) rb1 = Radiobutton(self.frame_right, variable=self.classify_right, value="TypeB") rb1.pack(side=LEFT) Label(self.frame_right, text="Type C").pack(side=LEFT) rb1 = Radiobutton(self.frame_right, variable=self.classify_right, value="TypeC") rb1.pack(side=LEFT) Label(self.frame_right, text="Type D").pack(side=LEFT) rb1 = Radiobutton(self.frame_right, variable=self.classify_right, value="TypeD") rb1.pack(side=LEFT)
class guiDemo3(Frame): def __init__(self,parent): Frame.__init__(self,parent) self.parent = parent self.initUI() #start up the main menu def initUI(self): try: self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.mainMenuLabel= Label(self, text="Main Menu") self.mainMenuLabel.pack(side=TOP,padx=5, pady=5) self.singleModeButton= Button(self, text="Single Computer Mode", command=self.unpackInitUI_LoadSingleComputerMode) self.singleModeButton.pack(side=TOP, padx=5, pady=5) self.networkModeButton= Button(self, text="Networking Mode", command=self.unpackInitUI_LoadNetworkMode) self.networkModeButton.pack(side=TOP, padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in initUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" #end of initUI//////////////////////////// def unpackInitUI_LoadSingleComputerMode(self): self.closeButton.pack_forget() self.mainMenuLabel.pack_forget() self.singleModeButton.pack_forget() self.networkModeButton.pack_forget() self.singleModeUI() def unpackInitUI_LoadNetworkMode(self): self.closeButton.pack_forget() self.mainMenuLabel.pack_forget() self.singleModeButton.pack_forget() self.networkModeButton.pack_forget() self.networkModeUI() def unpackSingleModeUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.singleModeLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.initUI() def unpackSingleModeUI_LoadSingleDictionaryUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.singleModeLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.dictionaryCrackingMethodUI(0) def unpackSingleModeUI_LoadSingleBruteForceUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.singleModeLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodUI(0) def unpackSingleModeUI_LoadSingleRainbowTableUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.singleModeLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodUI(0) def singleModeUI(self): try: self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackSingleModeUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.singleModeLabel= Label(self, text="Single Computer Mode") self.singleModeLabel.pack(side=TOP, padx=5, pady=5) self.selectCrackingMethodLabel= Label(self, text="Select Your Cracking Method") self.selectCrackingMethodLabel.pack(side=TOP, padx=5, pady=5) self.dictionaryCrackingMethodButton= Button(self, text="Dictionary", command=self.unpackSingleModeUI_LoadSingleDictionaryUI) self.dictionaryCrackingMethodButton.pack(side=TOP, padx=5, pady=5) self.bruteForceCrackingMethodButton= Button(self, text="Brute-Force (default)", command=self.unpackSingleModeUI_LoadSingleBruteForceUI) self.bruteForceCrackingMethodButton.pack(side=TOP, padx=5, pady=5) self.rainbowTableCrackingMethodButton= Button(self, text="Rainbow Table", command=self.unpackSingleModeUI_LoadSingleRainbowTableUI) self.rainbowTableCrackingMethodButton.pack(side=TOP, padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in singleModeUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" def unpackNetworkModeUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkModeLabel.pack_forget() self.selectNetworkModuleLabel.pack_forget() self.serverModuleButton.pack_forget() self.clientModuleButton.pack_forget() self.initUI() def networkModeUI(self): try: self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackNetworkModeUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.networkModeLabel= Label(self, text="Network Mode: Server/Client Selection Screen") self.networkModeLabel.pack(side=TOP, padx=5, pady=5) self.selectNetworkModuleLabel= Label(self, text="Select Server or Client") self.selectNetworkModuleLabel.pack(side=TOP, padx=5, pady=5) self.serverModuleButton= Button(self, text="I am the Server", command= self.unpackNetworkModeUI_LoadNetworkServerUI) self.serverModuleButton.pack(side=TOP, padx=5, pady=5) self.clientModuleButton= Button(self, text="I am a Client", command= self.unpackNetworkModeUI_LoadNetworkClientUI) self.clientModuleButton.pack(side=TOP, padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in networkModeUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" def unpackNetworkModeUI_LoadNetworkServerUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkModeLabel.pack_forget() self.selectNetworkModuleLabel.pack_forget() self.serverModuleButton.pack_forget() self.clientModuleButton.pack_forget() self.networkServerUI() def unpackNetworkModeUI_LoadNetworkClientUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkModeLabel.pack_forget() self.selectNetworkModuleLabel.pack_forget() self.serverModuleButton.pack_forget() self.clientModuleButton.pack_forget() self.networkClientUI() def unpackNetworkClientUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkClientLabel.pack_forget() self.insertServerIPLabel.pack_forget() self.insertServerIPTextfield.pack_forget() self.startClientButton.pack_forget() self.initUI() def networkClientUI(self): try: self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackNetworkClientUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.networkClientLabel= Label(self, text="Network Client") self.networkClientLabel.pack(side=TOP, padx=5, pady=5) self.insertServerIPLabel= Label(self, text="Enter in the Server's IP:") self.insertServerIPLabel.pack(side=TOP, padx=5, pady=5) self.insertServerIPTextfield= Entry(self, bd=5) self.insertServerIPTextfield.pack(side=TOP, padx=5, pady=5) self.startClientButton= Button(self, text="Start Client", command=lambda:self.startClient(str(self.insertServerIPTextfield))) self.startClientButton.pack(side=TOP, padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in networkClientUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" def startClient(self,inputIP): try: if(len(inputIP) < 1): showwarning("Network Client Start Warning: NO IP","No IP address has been entered!") else: self.networkClient= Process(target=Client, args=(inputIP,)) self.networkClient.start() except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in startClient definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" def unpackNetworkServerUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkServerLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.initUI() def networkServerUI(self): try: self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackNetworkServerUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.networkServerLabel= Label(self, text="Network Server") self.networkServerLabel.pack(side=TOP, padx=5, pady=5) self.selectCrackingMethodLabel= Label(self, text="Select Your Cracking Method") self.selectCrackingMethodLabel.pack(side=TOP, padx=5, pady=5) self.dictionaryCrackingMethodButton= Button(self, text="Dictionary", command=self.unpackNetworkServerUI_LoadNetworkDictionaryUI) self.dictionaryCrackingMethodButton.pack(side=TOP, padx=5, pady=5) self.bruteForceCrackingMethodButton= Button(self, text="Brute-Force (default)", command=self.unpackNetwrokServerUI_LoadNetworkBruteForceUI) self.bruteForceCrackingMethodButton.pack(side=TOP, padx=5, pady=5) self.rainbowTableCrackingMethodButton= Button(self, text="Rainbow Table", command=self.unpackNetworkServerUI_LoadNetworkRainbowTableUI) self.rainbowTableCrackingMethodButton.pack(side=TOP, padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in networkServerUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" def unpackNetworkServerUI_LoadNetworkDictionaryUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkServerLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.dictionaryCrackingMethodUI(1) def unpackNetwrokServerUI_LoadNetworkBruteForceUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkServerLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodUI(1) def unpackNetworkServerUI_LoadNetworkRainbowTableUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.networkServerLabel.pack_forget() self.selectCrackingMethodLabel.pack_forget() self.dictionaryCrackingMethodButton.pack_forget() self.bruteForceCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodButton.pack_forget() self.rainbowTableCrackingMethodUI(1) def unpackDictionaryCrackingMethodUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.dictionaryCrackingMethodLabel.pack_forget() self.currentModeLabel.pack_forget() self.dictionaryFileLocationLabel.pack_forget() self.selectedDictionaryFileLabel.pack_forget() self.selectDictionaryFileButton.pack_forget() self.inputHashTextFieldLabel.pack_forget() self.inputHashTextField.pack_forget() self.selectAlgorithmLabel.pack_forget() self.md5RadioButton.pack_forget() self.sha1RadioButton.pack_forget() self.sha224RadioButton.pack_forget() self.sha256RadioButton.pack_forget() self.sha512RadioButton.pack_forget() self.startDictionaryCrackButton.pack_forget() self.initUI() def dictionaryCrackingMethodUI(self,mode): #mode is either 1 (network) or 0 (single) currentMode= "ERROR: Mode not selected" #initialize variable selectedDictionaryFile= "No Dictionary file has been selected" selectedAlgorithm= "MD5" #set to md5 as the default try: if(mode == 0): currentMode= "Single" elif(mode == 1): currentMode= "Network" else: raise Exception("ERROR: Invalid mode parameter: '"+str(mode)+"'") self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackDictionaryCrackingMethodUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) if(currentMode is 'Single'): self.startDictionaryCrackButton= Button(self, text="Start Dictionary Crack (Single Mode)") self.startDictionaryCrackButton.pack(side=BOTTOM, padx=5, pady=5) #TODO create call method to start the dictionary crack elif(currentMode is 'Network'): self.startDictionaryCrackButton= Button(self, text="Start Dictionary Crack (Network Mode)") self.startDictionaryCrackButton.pack(side=BOTTOM, padx=5, pady=5) #TODO create call method to start the dictionary crack else: raise Exception("GUI ERROR: Invalid currentMode in startDictionaryCrackButton: '"+str(currentMode)+"'") self.dictionaryCrackingMethodLabel= Label(self, text="Dictionary Cracking Method") self.dictionaryCrackingMethodLabel.pack(side=TOP, padx=5, pady=5) self.currentModeLabel = Label(self,text="Current Mode: "+str(currentMode)) self.currentModeLabel.pack(side=TOP, padx=5, pady=5) self.dictionaryFileLocationLabel= Label(self, text="Dictionary File to be used:") self.dictionaryFileLocationLabel.pack(side=TOP, padx=5, pady=5) self.selectedDictionaryFileLabel= Label(self, text=str(selectedDictionaryFile)) self.selectedDictionaryFileLabel.pack(side=TOP, padx=5, pady=5) self.selectDictionaryFileButton= Button(self, text="Select Dictionary File", command=self.selectFileWindow) self.selectDictionaryFileButton.pack(side=TOP, padx=5, pady=5) self.inputHashTextFieldLabel= Label(self, text="The hash to be cracked:") self.inputHashTextFieldLabel.pack(side=TOP, padx=5, pady=5) self.inputHashTextField= Entry(self, bd=5) self.inputHashTextField.pack(side=TOP, padx=5, pady=5) self.selectAlgorithmLabel = Label(self, text="Select the Cracking Algorithm:") self.selectAlgorithmLabel.pack(side=TOP, padx=5, pady=5) self.md5RadioButton= Radiobutton(self, text="MD5 (default)", variable= selectedAlgorithm, value="MD5" ) self.md5RadioButton.pack(side=LEFT, padx=5, pady=5) self.sha1RadioButton= Radiobutton(self, text="SHA 1", variable= selectedAlgorithm, value="SHA 1") self.sha1RadioButton.pack(side=LEFT, padx=5, pady=5) self.sha224RadioButton= Radiobutton(self, text="SHA 224", variable= selectedAlgorithm, value="SHA 224") self.sha224RadioButton.pack(side=LEFT, padx=5, pady=5) self.sha256RadioButton= Radiobutton(self, text="SHA 256", variable= selectedAlgorithm, value="SHA 256") self.sha256RadioButton.pack(side=LEFT, padx=5, pady=5) self.sha512RadioButton= Radiobutton(self, text="SHA 512", variable= selectedAlgorithm, value="SHA 512") self.sha512RadioButton.pack(side=LEFT, padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in dictionaryCrackingMethodUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" def unpackBruteForceCrackingMethodUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.inputHashTextFieldLabel.pack_forget() self.inputHashTextField.pack_forget() self.bruteForceCrackingMethodLabel.pack_forget() self.currentModeLabel.pack_forget() self.startBruteForceCrackButton.pack_forget() self.outputHashTextFieldLabel.pack_forget() self.outputHashTextField.pack_forget() self.initUI() def bruteForceCrackingMethodUI(self, mode): #mode is either 1 (network) or 0 (single) currentMode= None try: if(mode==0): currentMode= "Single" elif(mode ==1): currentMode= "Network" else: raise Exception("ERROR: Invalid mode parameter: '"+str(mode)+"'") self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackBruteForceCrackingMethodUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) if(currentMode is 'Single'): self.startBruteForceCrackButton= Button(self, text="Start Brute-Force Crack (Single Mode)") self.startBruteForceCrackButton.pack(side=BOTTOM, padx=5, pady=5) #TODO create call method to start the brute force crack elif(currentMode is 'Network'): self.startBruteForceCrackButton= Button(self, text="Start Brute-Force Crack (Network Mode)") self.startBruteForceCrackButton.pack(side=BOTTOM, padx=5, pady=5) #TODO create call method to start the brute force crack else: raise Exception ("GUI ERROR: Invalid currentMode in startBruteForceCrackButton: '"+str(currentMode)+"'") self.bruteForceCrackingMethodLabel = Label(self, text="Brute-Force Cracking Method") self.bruteForceCrackingMethodLabel.pack(side=TOP, padx=5, pady=5) self.currentModeLabel= Label(self, text="Current Mode: "+str(currentMode)) self.currentModeLabel.pack(side=TOP, padx=5, pady=5) self.inputHashTextFieldLabel= Label(self, text="The hash to be cracked:") self.inputHashTextFieldLabel.pack(side=TOP, padx=5, pady=5) self.inputHashTextField= Entry(self, bd=5) self.inputHashTextField.pack(side=TOP, padx=5, pady=5) #self.selectAlgorithmLabel = Label(self, text="Select the Cracking Algorithm:") #self.selectAlgorithmLabel.pack(side=TOP, padx=5, pady=5) #self.md5RadioButton= Radiobutton(self, text="MD5 (default)", value="MD5" ) #self.md5RadioButton.pack(side=LEFT, padx=5, pady=5) #self.sha1RadioButton= Radiobutton(self, text="SHA 1", value="SHA 1") #self.sha1RadioButton.pack(side=LEFT, padx=5, pady=5) #self.sha224RadioButton= Radiobutton(self, text="SHA 224", value="SHA 224") #self.sha224RadioButton.pack(side=LEFT, padx=5, pady=5) #self.sha256RadioButton= Radiobutton(self, text="SHA 256", value="SHA 256") #self.sha256RadioButton.pack(side=LEFT, padx=5, pady=5) #self.sha512RadioButton= Radiobutton(self, text="SHA 512", value="SHA 512") #self.sha512RadioButton.pack(side=LEFT, padx=5, pady=5) #self.selectAlgorithm = #This will display the results, could set to show up after the program is run. self.outputHashTextFieldLabel= Label(self, text="Results") self.outputHashTextFieldLabel.pack(side=TOP, padx=5, pady=5) self.outputHashTextField= Entry(self, bd=5) self.outputHashTextField.insert(0, "Test") #This will disable modification but you cant hightlight and copy it. #self.outputHashTextField.config(state='disabled') self.outputHashTextField.pack(side=TOP,padx=5, pady=5) except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in bruteForceCrackingMethodUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" def unpackRainbowTableCrackingMethodUI_LoadInitUI(self): self.closeButton.pack_forget() self.returnToInitUIButton.pack_forget() self.rainbowTableCrackingMethodLabel.pack_forget() self.currentModeLabel.pack_forget() self.initUI() def rainbowTableCrackingMethodUI(self, mode): #mode is either 1 (network) or 0 (single) currentMode= None try: if(mode == 0): currentMode = "Single" elif(mode == 1): currentMode = "Network" else: raise Exception("ERROR: Invalid mode parameter: '"+str(mode)+"'") self.parent.title("Mighty Cracker") self.style = Style() self.style.theme_use("default") self.pack(fill=BOTH, expand=1) #load buttons and labels self.closeButton= Button(self, text="Close Program", command=self.confirmExit) self.closeButton.pack(side=BOTTOM, padx=5, pady=5) self.returnToInitUIButton= Button(self, text="Return to Main Menu", command=self.unpackRainbowTableCrackingMethodUI_LoadInitUI) self.returnToInitUIButton.pack(side=BOTTOM, padx=5, pady=5) self.rainbowTableCrackingMethodLabel= Label(self, text="Rainbow Table Cracking Method") self.rainbowTableCrackingMethodLabel.pack(side=TOP, padx=5, pady=5) self.currentModeLabel= Label(self,text="Current Mode: "+str(currentMode)) self.currentModeLabel.pack(side=TOP, padx=5, pady=5) #TODO insert Rainbow table settings here except Exception as inst: print "=============================================================================================" print "GUI ERROR: An exception was thrown in rainbowTableCrackingMethodUI definition Try block" #the exception instance print type(inst) #srguments stored in .args print inst.args #_str_ allows args tto be printed directly print inst print "=============================================================================================" def selectFileWindow(self): filename= "" filename= askopenfilename() self.selectedDictionaryFileLabel.config(text=str(filename)) def confirmExit(self): result= askyesno('Exit Confirmation', 'Are you sure you want to quit this application? \n (WARNING: All server, client, and single computer processes will be terminated!!)') if result == True: self.onExit() #if no is selected, then the window just closes def onExit(self): self.quit()