database.py 文件源码

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

项目:idascripts 作者: ctfhacker 项目源码 文件源码
def search(cls, **type):
        """Search through all of the functions within the database and return the first result.
        Please review the help for functions.list for the definition of ``type``.
        """
        query_s = ', '.join("{:s}={!r}".format(k,v) for k,v in type.iteritems())

        res = __builtin__.list(cls.iterate(**type))
        if len(res) > 1:
            __builtin__.map(logging.info, (("[{:d}] {:s}".format(i, function.name(ea))) for i,ea in enumerate(res)))
            f = utils.compose(function.by,function.name)
            logging.warn("{:s}.search({:s}) : Found {:d} matching results, returning the first one. : {!r}".format('.'.join((__name__, cls.__name__)), query_s, len(res), f(res[0])))

        res = __builtin__.next(iter(res), None)
        if res is None:
            raise LookupError("{:s}.search({:s}) : Found 0 matching results.".format('.'.join((__name__, cls.__name__)), query_s))
        return res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号