IDA Pro

Created:2015.08.06, last modified: 2015.08.06 by Sam L. Thomas
Status: In Progress

Notes, code snippets and information regarding the use of IDA Pro.

Scripting with IDAPython

Map an address to its enclosing basic block

def address_to_basic_block(address):
    f = idaapi.get_func(address)

    if not f:
        return None

    for b in idaapi.FlowChart(f):
        if b.startEA <= address < b.endEA:
            return (b.startEA, b.endEA)

    return None