Skip to content

Instantly share code, notes, and snippets.

@peta909
Last active May 21, 2018 19:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peta909/b19a84b6b33fd5f04b5b87e8f623259f to your computer and use it in GitHub Desktop.
Save peta909/b19a84b6b33fd5f04b5b87e8f623259f to your computer and use it in GitHub Desktop.
IDApython script used to rename addresses with strings of function names
#Author: Mark Lim
#Version: 0.2 (01 May 2018)
#Use while debugging target using IDAPro
#locate list of function pointers
#Make names of function pointers using strings of function names
#FuncName without DLL prefix result in IDA recognizing the API functions and populate the parameter arguments. [Credits to @nullandnull]
ea = SelStart()
end = SelEnd()
while ea < end:
addr = idc.Dword(ea)
FuncName_dll = idc.get_name(addr)
try:
FuncName = FuncName_dll.split('_')[1]
except IndexError:
FuncName = "NIL"
print hex(ea),FuncName
MakeDword(ea)
idc.MakeNameEx(ea, FuncName, idc.SN_NOWARN)
ea += 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment