def iter_exit_nodes(ea): for block in get_flowchart(ea): # Check if there are successors for successor in block.next: break else: yield block
def mark_unreachable_nodes(ea, source_color=COLOR_SOURCE, other_color=COLOR_UNREACHABLE): graph = get_nx_graph(ea) block_ea = get_block_start(ea) descendants = nx.descendants(graph, block_ea) for block in get_flowchart(ea): if block.startEA not in descendants: block.color = other_color get_codeblock(ea).color = source_color
def clear_func(ea): for block in get_flowchart(ea): block.color = COLOR_NONE