Skip to content

Instantly share code, notes, and snippets.

@tmr232
Created March 28, 2016 14:24
Show Gist options
  • Select an option

  • Save tmr232/df4392eeb46d4d1c8d67 to your computer and use it in GitHub Desktop.

Select an option

Save tmr232/df4392eeb46d4d1c8d67 to your computer and use it in GitHub Desktop.
Sometimes (ARM SOs) IDA does not name THUNKs on its own, and it needs our help.
def rename_thunks(prefix='jmp_'):
for f in sark.functions():
if f.name:
continue
jmp = None
for xref in f.xrefs_from:
if xref.type.is_jump:
if jmp:
break
jmp = xref
else:
if not jmp:
continue
f.set_name('{}{}'.format(prefix, sark.Function(jmp.to).demangled), True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment