def graph_function_low_level_il (function) :
'''
Returns a graph where each LLIL Basic Block is a vertex in the graph
'''
graph = Graph(0)
# get the low_level_il basic blocks
basic_blocks = function.low_level_il.basic_blocks
# We are going to add each basic block to our graph
for basic_block in basic_blocks :
graph.add_vertex(basic_block.start, basic_block)
# Now we are going to add all the edges
for basic_block in basic_blocks :
for outgoing_edge in basic_block.outgoing_edges :
target = outgoing_edge.target
graph.add_edge_by_indices(basic_block.start, target.start, None)
# Now return the graph
return graph
评论列表
文章目录