Skip to content

Instantly share code, notes, and snippets.

@ret5et
Last active October 24, 2015 22:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ret5et/d99fc461b53755c503ec to your computer and use it in GitHub Desktop.
Save ret5et/d99fc461b53755c503ec to your computer and use it in GitHub Desktop.
def get_bb_id(graph, ea):
for block in graph:
if block.startEA <= ea and block.endEA > ea:
return block.id
start_ea = 0x15f9ad6
base_block_ea = 0x15f9a60
f = get_func(start_ea)
g = FlowChart(f, flags=FC_PREDS) #???
bb_id = get_bb_id(g, start_ea)
p = idaapi.node_info_t()
p.bg_color = 0x00ff00 # green
print idaapi.set_node_info2(base_block_ea, bb_id, p, idaapi.NIF_BG_COLOR | idaapi.NIF_FRAME_COLOR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment