prepare.py 文件源码

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

项目:choronzon 作者: CENSUS 项目源码 文件源码
def find_bbls(function_ea):
    '''
        yields all basic blocks that belong to the
        given function. The blocks are returned in
        a 2-tuple like:

            (start_address, end_address)

        Both start and end address are RELATIVE offsets
        from the image base.
    '''

    # get image base from IDA
    image_base = idaapi.get_imagebase()
    function_ea += image_base

    # get flow chart from IDA
    flow_chart = idaapi.FlowChart(
            idaapi.get_func(function_ea),
            flags=idaapi.FC_PREDS
            )

    # iterate through all basic blocks in
    # the current routine
    for block in flow_chart:
        start_addr = block.startEA - image_base
        end_addr = block.endEA - image_base
        if start_addr != end_addr:
            yield start_addr, end_addr
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号