Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # I didn't check this code, use carefully, beware of errors
- import idc
- import idaapi
- import idautils
- def set_breakpoints_on_refs(ea):
- list_of_referencing_functions = ["All"]
- print "In setting bp ..."
- for ref in idautils.DataRefsTo(ea):
- func_name = idaapi.get_func_name(ref)
- if not func_name is None and not func_name in list_of_referencing_functions:
- list_of_referencing_functions.append(func_name)
- print "refrlist done", list_of_referencing_functions
- width = 0
- for r in list_of_referencing_functions:
- if len(r) > width:
- width = len(r)
- ch = idaapi.Choose(list_of_referencing_functions, "Choose a function", 1 )
- ch.width = width
- print "Chooser created"
- res = ch.choose()
- if res > 0:
- print "selected ...",
- chosen = ch.list[res -1]
- print chosen
- set_at_all = False
- if chosen == "All":
- set_at_all = True
- for ref in idautils.DataRefsTo(ea):
- if set_at_all:
- idc.AddBpt(ref)
- continue
- func_name = idaapi.get_func_name(ref)
- if func_name == chosen:
- idc.AddBpt(ref)
- def set_breakpoints_on_refs_to_screen_ea():
- print "Started"
- set_breakpoints_on_refs(idc.ScreenEA())
- idaapi.add_hotkey("Alt-Y", set_breakpoints_on_refs_to_screen_ea)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement