Example #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
Example #2
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):
        get_codeblock(descendant).color = other_color

    get_codeblock(ea).color = source_color
Example #3
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
Example #4
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):
        get_codeblock(descendant).color = other_color

    get_codeblock(ea).color = source_color
Example #5
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
Example #6
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 get_flowchart(ea):
        if block.startEA not in descendants:
            block.color = other_color

    get_codeblock(ea).color = source_color
Example #7
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
Example #8
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:
            get_codeblock(node_ea).color = other_color

    get_codeblock(ea).color = source_color
Example #9
0
    def __init__(self, sarkFunc):
        self.startEA = sarkFunc.startEA
        self.endEA = sarkFunc.endEA

        nxg = sark.get_nx_graph(sarkFunc.startEA)
        f_startEAs = nxg.nodes()
        self.codeblocks = {
            cb.startEA:
            (cb.endEA, map(lambda s: s.startEA,
                           cb.succs()), map(lambda s: s.startEA, cb.preds()))
            for cb in sark.codeblocks(start=self.startEA, end=self.endEA)
            if cb.startEA in f_startEAs
        }