Skip to content

Instantly share code, notes, and snippets.

@tmr232
Last active February 17, 2016 16:39
Show Gist options
  • Save tmr232/78ca497a5de36b840f88 to your computer and use it in GitHub Desktop.
Save tmr232/78ca497a5de36b840f88 to your computer and use it in GitHub Desktop.
Rename functions based on referenced strings. Useful for debug prints.
import sark
import idautils
# Rename all functions with a `.*::.*` print in them.
for si in idautils.Strings():
if '::' in str(si):
for xref in sark.Line(si.ea).xrefs_to:
sark.Function(xref.frm).set_name(str(si), anyway=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment