Skip to content

Instantly share code, notes, and snippets.

@withmorten
Created March 7, 2021 21:59
Show Gist options
  • Save withmorten/8cb00821fd05374d53a2cbd28eee2841 to your computer and use it in GitHub Desktop.
Save withmorten/8cb00821fd05374d53a2cbd28eee2841 to your computer and use it in GitHub Desktop.
check_xrefs.py
import idautils
import idc
import idaapi
def demangle(name):
mask = idc.get_inf_attr(idc.INF_LONG_DN)
demangled = idc.demangle_name(name, mask)
if demangled is None:
return name
return demangled
def check_xrefs(func_start, func_name):
for r in idautils.XrefsTo(func_start, 0):
if r.type == fl_CF or r.type == fl_CN or r.type == fl_JF or r.type == fl_JN or r.type == dr_O:
return
print hex(int(func_start)), func_name
for segea in Segments():
for funcea in Functions(segea, get_segm_end(segea)):
check_xrefs(funcea, demangle(get_func_name(funcea)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment