Exemple #1
0
def mark_reachable_nodes(ea,
                         source_color=COLOR_SOURCE,
                         other_color=COLOR_REACHABLE):
    graph = get_nx_graph(ea)
    block_ea = get_block_start(ea)
    for descendant in nx.descendants(graph, block_ea):
        CodeBlock(descendant).color = other_color

    CodeBlock(ea).color = source_color
Exemple #2
0
def mark_reaching_nodes(ea,
                        source_color=COLOR_SOURCE,
                        other_color=COLOR_REACHING):
    graph = get_nx_graph(ea)
    graph = graph.reverse()
    block_ea = get_block_start(ea)
    for descendant in nx.descendants(graph, block_ea):
        CodeBlock(descendant).color = other_color

    CodeBlock(ea).color = source_color
Exemple #3
0
def mark_not_reaching_nodes(ea,
                            source_color=COLOR_SOURCE,
                            other_color=COLOR_NOT_REACHING):
    graph = get_nx_graph(ea)
    graph = graph.reverse()
    block_ea = get_block_start(ea)
    reaching = nx.descendants(graph, block_ea)
    for node_ea in graph.nodes_iter():
        if node_ea not in reaching:
            CodeBlock(node_ea).color = other_color

    CodeBlock(ea).color = source_color
Exemple #4
0
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 FlowChart(ea):
        if block.startEA not in descendants:
            block.color = other_color

    CodeBlock(ea).color = source_color