def loadBin(self, widget): chooser = gtk.FileChooserDialog(title=None,action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) chooser.set_current_folder('dis/navigator/dbs/') filter = gtk.FileFilter() filter.set_name("KB files") filter.add_pattern("*.kb") chooser.add_filter(filter) response = chooser.run() if response == gtk.RESPONSE_OK: self.gom.echo( 'Loading Database...', False) self.gom.echo( chooser.get_filename() , False) res = chooser.get_filename() kb = res.split('.')[0] dasm, func = rcecore.get_complete_dasm(kb) self.textbuffer.set_text(dasm) dotcode = rcecore.get_dot_code(func[0].name, kb) self.xdotr.set_dotcode(dotcode) self.rmenu.set_poc(res) self.rmenu.set_functions(func) self.dasmenu.set_options() # Adding text to Log window self.gom.echo( 'Loaded!' , False) chooser.destroy() elif response == gtk.RESPONSE_CANCEL: self.gom.echo( 'Closed, no files selected', False) chooser.destroy()
def newBin(self, widget): chooser = gtk.FileChooserDialog(title=None,action=gtk.FILE_CHOOSER_ACTION_OPEN, buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,gtk.STOCK_OPEN,gtk.RESPONSE_OK)) response = chooser.run() if response == gtk.RESPONSE_OK: self.gom.echo( 'Loading Binary...', False) self.gom.echo( chooser.get_filename(), False ) res = chooser.get_filename() rcecore.uploadFile(res) rcecore.generate_graphs(res) dasm, func = rcecore.get_complete_dasm(res) self.textbuffer.set_text(dasm) dotcode = rcecore.get_dot_code(func[0].name, res) self.xdotr.set_dotcode(dotcode) self.rmenu.set_poc(res) self.rmenu.set_functions(func) self.dasmenu.set_options() # Adding text to Log window self.gom.echo( 'Loaded!' , False) chooser.destroy() elif response == gtk.RESPONSE_CANCEL: self.gom.echo( 'Closed, no files selected', False) chooser.destroy()