def DefaultView(self):
DEBUG_PRINT('IN Defaultview')
ea = self._showFunctions()
if 0 == ea:
return
idaapi.jumpto(ea, -1,1)
(startEA,endEA) = self._GetFuncRange(ea)
cid = [i for i,item in enumerate(self._tablelist) if item[0]==hex(startEA)]
if cid != []:
cindex = cid[0]
if self._tablelist[cindex][2] == '1':
return
self._tablelist[cindex][2] = '1'
else:
print 'ea not in range'
self._showComms(startEA,endEA,0)
self._choose_id = 0
idc.Refresh()
python类jumpto()的实例源码
def _ui_entry_double_click(self, index):
"""
Handle double click event on the coverage table.
A double click on the coverage table view will jump the user to
the corresponding function in the IDA disassembly view.
"""
idaapi.jumpto(self._model.row2func[index.row()])
def go(ea):
'''Jump to the specified address at ``ea``.'''
if isinstance(ea, basestring):
ea = search.by_name(None, ea)
idaapi.jumpto(interface.address.inside(ea))
return ea
# returns the offset of ea from the baseaddress
def goof(offset):
'''Jump to the specified ``offset`` within the database.'''
res = ui.current.address()-baseaddress()
ea = coof(offset)
idaapi.jumpto(interface.address.inside(ea))
return res
def show_location(self):
idaapi.jumpto(self.address)
def open_function(self):
if self.address:
if idaapi.decompile(self.address):
idaapi.open_pseudocode(self.address, 0)
else:
idaapi.jumpto(self.address)
def Jump(ea):
"""
Move cursor to the specifed linear address
@param ea: linear address
"""
return idaapi.jumpto(ea)
def dblclick(self, item):
'''Handle double click event.'''
try:
idaapi.jumpto(int(item.text(1), 16))
except:
pass
def Get_FunctionFeatures():
global ftarget, func_name_ea, dbctrl, FIRST_RUN, funlist, funfeaturelist, title, cols
origin_ftarget = ftarget #pAllocateAndInitializeMDSURF
ftarget = idc.AskStr(origin_ftarget, 'Type the Target String (CASE INSenstive)')
if ftarget == '':
print 'NO input'
return
if ftarget == origin_ftarget and not FIRST_RUN:
# if target string doesn't change, then keep previous funlist, but first time run must be excluded
DEBUG_PRINT("ftarget == origin_ftarget ")
pass
else:
funlist = []
for f in func_name_ea.keys():
if ftarget.lower() in f.lower():
# funlist.append((f,func_name_ea[f]))
funlist.append(f)
DEBUG_PRINT(funlist)
funfeaturelist = []
for fun in funlist:
funfeature = dbctrl.find_one({"name":fun})
if funfeature:
featurelist = []
for feature in funfeature:
if feature != '_id':
featurelist.append(funfeature[feature].strip('(,)').split(',')[0])
DEBUG_PRINT(featurelist)
funfeaturelist.append(featurelist)
DEBUG_PRINT(funfeaturelist)
if FIRST_RUN:
FIRST_RUN = 0
#funfeaturelist prepared
DEBUG_PRINT("To show the window")
# print title
# print cols
chooser = IdxChoose2(title, cols, funfeaturelist) #, deflt = deflt_id
id = chooser.show()
if -1 == id:
idc.Message('\n Index no change\n')
else:
ea = funfeaturelist[id][cols.index(['ea', 10])]
print 'ea',ea
type(ea)
idaapi.jumpto(int(ea,16), -1,1)
features = dbctrl.find_one({"ea":ea})
for f in features:
print '%-20s %s'%(f, features[f])
DEBUG_PRINT("show finished")