database.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:idascripts 作者: ctfhacker 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号