Skip to content

Instantly share code, notes, and snippets.

@tmr232
Forked from ret5et/color_block.py
Created October 21, 2015 08:17
Show Gist options
  • Save tmr232/8e1289425e46545accbe to your computer and use it in GitHub Desktop.
Save tmr232/8e1289425e46545accbe 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