def __init__(self): self.__n = 0 Form.__init__( self, r"""BUTTON YES* Yeah BUTTON NO Nope BUTTON CANCEL NONE Dropdown list test {FormChangeCb} <Dropdown list (readonly):{cbReadonly}> <Add element:{iButtonAddelement}> <Set index:{iButtonSetIndex}> <Dropdown list (editable):{cbEditable}> <Set string:{iButtonSetString}> """, { 'FormChangeCb': Form.FormChangeCb(self.OnFormChange), 'cbReadonly': Form.DropdownListControl( items=["red", "green", "blue"], readonly=True, selval=1), 'cbEditable': Form.DropdownListControl(items=["1MB", "2MB", "3MB", "4MB"], readonly=False, selval="4MB"), 'iButtonAddelement': Form.ButtonInput(self.OnButtonNop), 'iButtonSetIndex': Form.ButtonInput(self.OnButtonNop), 'iButtonSetString': Form.ButtonInput(self.OnButtonNop), })
def __init__(self, names, packageName): idx = 0 if packageName and packageName in names: idx = names.index(packageName) Form.__init__( self, ("STARTITEM 0\n" "BUTTON YES* Attach\n" "BUTTON CANCEL Cancel\n" "Attach android application\n" "\n" "<## Package Name:{names}>\n" "<## IDA Debug Port:{idaDebugPort}>\n" "Launch Options" " <Debug Mode:{debug}>{launchOptions}>\n" "\n"), { 'names': Form.DropdownListControl( items=names, readonly=True, selval=idx), 'idaDebugPort': Form.NumericInput(tp=Form.FT_DEC), "launchOptions": Form.ChkGroupControl(["debug"]) }) self.pns = names self.pn = packageName
def __init__(self, engine, modules): Form.__init__( self, r"""STARTITEM {id:address} BUTTON YES* OK BUTTON CANCEL Cancel Convert real address to IDB offset {FormChangeCb} <Module\: :{module}> <##Real address\::{address}> Module base: {mod_base} <##IDB address\: :{idb_addr}> """, { 'module': Form.DropdownListControl(items=modules, readonly=True, selval=0, swidth=20, width=20), 'address': Form.NumericInput(swidth=20, tp=Form.FT_HEX), 'mod_base': Form.StringLabel("0x0", tp='A'), 'idb_addr': Form.NumericInput(swidth=20, tp=Form.FT_HEX), 'FormChangeCb': Form.FormChangeCb(self.OnFormChange) }) self.engine = engine
def __init__(self, manager, disable_param=False): self.disable_param = disable_param self.all_funcs = IDAUtils.get_all_ida_funcs() self.funcList = FunctionListView("asm", flags=Choose.CH_MULTI, all_funcs=self.all_funcs) self.selected_funcs = [] self.configuration = manager.configuration apps = self.configuration['apps'].keys() default_app = self.configuration['default-app'] if self.configuration['default-app'] is not None: default_index = apps.index(default_app) else: default_index = 0 self.selected_app_key = default_app self.threshold = self.configuration['default-threshold'] self.topk = self.configuration['default-topk'] self.avoidSameBinary = self.configuration['default-avoidSameBinary'] Form.__init__( self, r"""BUTTON YES* Continue BUTTON CANCEL Cancel Kam1n0 {FormChangeCb} Select Function: <(Use ctrl/shift + click to select multiple functions):{fvChooser}> <Select all functions:{chkSearchAll}><Skip library functions:{chkSkipLib}>{adSearchGroup}> Configuration <Threshold:{txtSim}> <TopK :{txtTopK}> <Avoid Same Binary :{chkSameBin}>{chkGroup}> <App :{dpServer}> """, { 'adSearchGroup': Form.ChkGroupControl(["chkSearchAll", "chkSkipLib"]), 'FormChangeCb': Form.FormChangeCb(self.OnFormChange), 'txtSim': Form.StringInput( swidth=25, tp=Form.FT_ASCII, value=str(self.threshold)), 'txtTopK': Form.StringInput( swidth=25, tp=Form.FT_ASCII, value=str(self.topk)), 'chkGroup': Form.ChkGroupControl(("chkSameBin", "")), 'dpServer': Form.DropdownListControl(swidth=45, width=45, selval=default_index, items=apps, readonly=True), 'fvChooser': Form.EmbeddedChooserControl(self.funcList) }) self.Compile()
def __init__(self, title, values, idx=0): Form.__init__(self, ("STARTITEM 0\n" "BUTTON YES* OK\n" "BUTTON CANCEL Cancel\n" + title + "\n" "\n" "<Please select :{values}>\n"), {"values": Form.DropdownListControl(items=values, readonly=True, selval=0)}) self.cvs = values
def __init__(self, manager): self.cnn = manager.connector self.Kconf = manager.Kconf self.listView = ConnectionListView(manager) dpItems = self.Kconf['cnns'].keys() if self.Kconf['default-cnn'] is not None: defaultIndex = self.Kconf['cnns'].keys().index( self.Kconf['default-cnn']) else: defaultIndex = 0 Form.__init__( self, r"""BUTTON YES* OK BUTTON CANCEL NONE Kam1n0 - Manage connections {FormChangeCb} Manage Connections: <(Click to edit):{fvChooser}> <Remove :{btnRemove}> Remove selected connection. <Protocol :{txtProtocol}> <Server :{txtServer}> <Port :{txtPort}> Login Info: <User :{txtUser}> <Password :{txtPw}> <Update / Add:{btnUpdate}> <Default :{dpCnn}> < > """, { 'fvChooser': Form.EmbeddedChooserControl(self.listView), 'FormChangeCb': Form.FormChangeCb(self.OnFormChange), 'txtServer': Form.StringInput(swidth=30, tp=Form.FT_ASCII), 'txtProtocol': Form.StringInput(swidth=30, tp=Form.FT_ASCII), 'txtPort': Form.StringInput(swidth=30, tp=Form.FT_ASCII), 'txtUser': Form.StringInput(swidth=30, tp=Form.FT_ASCII), 'txtPw': Form.StringInput(swidth=30, tp=Form.FT_ASCII), 'btnRemove': Form.ButtonInput(self.OnButtonRemove), 'btnUpdate': Form.ButtonInput(self.OnButtonUpdate), 'dpCnn': Form.DropdownListControl(swidth=45, width=45, selval=defaultIndex, items=dpItems, readonly=True) }) self.Compile()
def __init__(self, title, labels, values=None, cancel="Cancel", index=0): Form.__init__(self, ("STARTITEM 0\n" "BUTTON YES* OK\n" "BUTTON CANCEL " + cancel + "\n" + title + "\n" "\n" "<Please select :{values}>\n"), {"values": Form.DropdownListControl(items=labels, readonly=True, selval=index)}) self.labels = labels self.cvs = values if values is not None else labels
def __init__(self, functions): self.functions = functions Form.__init__( self, ("STARTITEM 0\n" "BUTTON YES* StartDIE\n" "BUTTON CANCEL Cancel\n" "Form Scope Chooser\n" "\n" "<Start Function :{cbStartFunction}>\n" "<End Function :{cbEndFunction}>\n"), { 'iStartAddr': Form.NumericInput(tp=Form.FT_ADDR), 'iEndAddr': Form.NumericInput(tp=Form.FT_ADDR), 'cbStartFunction': Form.DropdownListControl( items=self.functions, readonly=True, selval=1), 'cbEndFunction': Form.DropdownListControl( items=self.functions, readonly=True, selval=1), })
def __init__(self, manager): global funcListG self.funcList = FunctionListView("asm", flags=Choose2.CH_MULTI) self.funcs = [] self.cnn = manager.connector self.Kconf = manager.Kconf dpItems = self.Kconf['cnns'].keys() if self.Kconf['default-cnn'] is not None: defaultIndex = self.Kconf['cnns'].keys().index( self.Kconf['default-cnn']) else: defaultIndex = 0 self.threshold = self.Kconf['default-threshold'] self.topk = self.Kconf['default-topk'] Form.__init__( self, r"""BUTTON YES* Search BUTTON CANCEL Cancel Kam1n0 {FormChangeCb} Select Function to be searched <(Use ctrl/shift + click to select multiple functions):{fvChooser}> <Select all functions:{chkSearchAll}><Skip library functions:{chkSkipLib}>{adSearchGroup}> Search configuration <Threshold:{txtSim}> <TopK :{txtTopK}> <Server :{dpServer}> """, { 'adSearchGroup': Form.ChkGroupControl(["chkSearchAll", "chkSkipLib"]), 'FormChangeCb': Form.FormChangeCb(self.OnFormChange), 'txtSim': Form.StringInput( swidth=25, tp=Form.FT_ASCII, value=str(self.threshold)), 'txtTopK': Form.StringInput( swidth=25, tp=Form.FT_ASCII, value=str(self.topk)), 'dpServer': Form.DropdownListControl(swidth=45, width=45, selval=defaultIndex, items=dpItems, readonly=True), 'fvChooser': Form.EmbeddedChooserControl(self.funcList) }) self.Compile()
def __init__(self, project_list): self.invert = False project_list += ["Select public project"] self._project_list = project_list Form.__init__(self, r"""STARTITEM {id:iProject} BUTTON CANCEL Cancel Project selector form {FormChangeCb} <##Select your working project:{iProject}> """, { 'FormChangeCb': Form.FormChangeCb(self.OnFormChange), 'iProject': Form.DropdownListControl(project_list) })
def __init__(self, db_list): Form.__init__(self, r"""STARTITEM {id:db_id} BUTTON YES* Close BUTTON CANCEL Cancel Close DB <##DB ID\::{db_id}> """, { 'db_id': Form.DropdownListControl( items=db_list, readonly=True, selval=0, swidth=20, width=20), })
def __init__(self): Form.__init__( self, r"""BUTTON YES* Select Select Encoding {FormChangeCb} <Select an encoding :{cbReadonly}> """, { 'cbReadonly': Form.DropdownListControl( items=ENCODING_LIST, readonly=True, selval=19), 'FormChangeCb': Form.FormChangeCb(self.OnFormChange) }) self.Compile()
def __init__(self, manager): self.allFuncs = [GetFunction(x) for x in GetFunctions()] self.funcList = FunctionListView("asm", allFuncs=self.allFuncs, flags=Choose2.CH_MULTI) self.funcs = [] self.cnn = manager.connector self.Kconf = manager.Kconf dpItems = self.Kconf['cnns'].keys() if self.Kconf['default-cnn'] is not None: defaultIndex = self.Kconf['cnns'].keys().index( self.Kconf['default-cnn']) else: defaultIndex = 0 Form.__init__( self, r"""BUTTON YES* Index BUTTON CANCEL Cancel Kam1n0 {FormChangeCb} Select Function to be indexed <(Use ctrl/shift + click to select multiple functions):{fvChooser}> <Select all functions:{chkSearchAll}> <Select all library functions:{chkOnlyLib}> <Select all but not library functions:{chkSkipLib}>{adSearchGroup}> Index configuration <Server :{dpServer}> """, { 'adSearchGroup': Form.ChkGroupControl( ["chkSearchAll", "chkSkipLib", "chkOnlyLib"]), 'FormChangeCb': Form.FormChangeCb(self.OnFormChange), 'txtSim': Form.StringInput(swidth=25, tp=Form.FT_ASCII, value='0.5'), 'dpServer': Form.DropdownListControl(swidth=45, width=45, selval=defaultIndex, items=dpItems, readonly=True), 'fvChooser': Form.EmbeddedChooserControl(self.funcList) }) self.Compile() self.activated = False
def __init__(self, db_list): Form.__init__(self, r"""STARTITEM {id:db_id} BUTTON YES* Exec BUTTON CANCEL Cancel Execute Query <##DB ID\::{db_id}> <##Query\::{db_query}> """, { 'db_id': Form.DropdownListControl( items=db_list, readonly=True, selval=0, swidth=20, width=20), 'db_query': Form.MultiLineTextControl(flags=self.textFlags, tabsize=self.textTab, width=200, swidth=200), })
def __init__(self, modules, recentOnEnter, recentOnLeave): Form.__init__( self, r"""STARTITEM {id:module} BUTTON YES* Save BUTTON CANCEL Cancel Arbitrary Hook !!! MAKE SURE YOU KNOW WHAT YOU ARE DOING HERE !!! <Module\: :{module}> <##Address\::{address}> <##Comment\::{comment}> <Instruction:{set_inst}><Function:{set_func}>{hook_type}><Once:{set_once}><Permanent:{set_perm}>{trigger}> Recent onEnter script file:{src_file_enter} <##onEnter script\::{script_enter}> <##Load from file:{loadfile_enter}><##Update from file:{update_enter}> Recent onLeave script file:{src_file_leave} <##onLeave script\::{script_leave}> <##Load from file:{loadfile_leave}><##Update from file:{update_leave}> """, { 'module': Form.DropdownListControl(items=modules, readonly=True, selval=0, swidth=20, width=20), 'address': Form.NumericInput(swidth=20, tp=Form.FT_HEX), 'comment': Form.StringInput(swidth=60), 'hook_type': Form.RadGroupControl( ("set_inst", "set_func"), secondary=False), 'trigger': Form.RadGroupControl(("set_once", "set_perm"), secondary=True), 'src_file_enter': Form.StringLabel( recentOnEnter if recentOnEnter is not None else "", tp='f'), 'script_enter': Form.MultiLineTextControl(flags=self.textFlags, tabsize=self.textTab, width=200, swidth=200), 'loadfile_enter': Form.ButtonInput(self.onLoadEnter), 'update_enter': Form.ButtonInput(self.onUpdateEnter), 'src_file_leave': Form.StringLabel( recentOnLeave if recentOnLeave is not None else "", tp='f'), 'script_leave': Form.MultiLineTextControl(flags=self.textFlags, tabsize=self.textTab, width=200, swidth=200), 'loadfile_leave': Form.ButtonInput(self.onLoadLeave), 'update_leave': Form.ButtonInput(self.onUpdateLeave), }) self.recentScriptFileEnter = recentOnEnter self.recentScriptFileLeave = recentOnLeave