database.py 文件源码

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

项目:idascripts 作者: ctfhacker 项目源码 文件源码
def list(cls, **type):
        """List all of the entry-points within the database that match ``type`.

        Search can be constrained by the named argument ``type``.
        like = glob match against entry-point name
        ea, address = exact address match
        name = exact entry-point name match
        regex = regular-expression against entry-point name
        index = particular index
        greater, less = greater-or-equal against address, less-or-equal against address
        pred = function predicate
        """
        res = __builtin__.list(cls.__iterate__(**type))

        to_address = utils.compose(idaapi.get_entry_ordinal, idaapi.get_entry)
        to_numlen = utils.compose("{:x}".format, len)

        maxindex = max(res+[1])
        maxaddr = max(__builtin__.map(to_address, res) or [idaapi.BADADDR])
        maxordinal = max(__builtin__.map(idaapi.get_entry_ordinal, res) or [1])
        cindex = math.ceil(math.log(maxindex)/math.log(10))
        caddr = math.floor(math.log(maxaddr)/math.log(16))
        cordinal = math.floor(math.log(maxordinal)/math.log(16))

        for index in res:
            print "[{:{:d}d}] {:>{:d}x} : ({:{:d}x}) {:s}".format(index, int(cindex), to_address(index), int(caddr), cls.__entryordinal__(index), int(cindex), cls.__entryname__(index))
        return
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号