Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
IDA script snippets
#IDA script to print all referenced strings along with their references
import idautils
sc = idautils.Strings()
for s in sc:
curr_str = str(s)
str_offset = s.ea
for xref in idautils.XrefsTo(s.ea):
func = idaapi.get_func(xref.frm)
if not func:
continue
functionName = idc.GetFunctionName(xref.frm)
print ("%x, %s") % (str_offset, curr_str)
print ("\tref: %x, %s") % (xref.frm, functionName)
print("---\n")
#IDA script to enum strings
import idautils
sc = idautils.Strings()
for s in sc:
curr_str = str(s)
print curr_str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment