def list(cls, **type):
"""List all of the imports in the database that match ``type``.
Search can be constrained by the named argument ``type``.
like = glob match against import short name
ea, address = import is at address
fullname = glob match against import long name -> MODULE!function
module = glob match against module
ordinal = exact match against import ordinal number
name = exact match against import name
regex = regular-expression against import name
index = import name at index
pred = function predicate
"""
res = __builtin__.list(cls.iterate(**type))
maxaddr = max(__builtin__.map(utils.first, res) or [idaapi.BADADDR])
maxmodule = max(__builtin__.map(utils.compose(utils.second, utils.first, len), res) or [''])
caddr = math.floor(math.log(maxaddr)/math.log(16))
cordinal = max(__builtin__.map(utils.compose(utils.second, operator.itemgetter(2), "{:d}".format, len), res) or [1])
for ea,(module,name,ordinal) in res:
print "{:0{:d}x} {:s}<{:<d}>{:s} {:s}".format(ea, int(caddr), module, ordinal, ' '*(cordinal-len("{:d}".format(ordinal)) + (maxmodule-len(module))), name)
return
评论列表
文章目录