Created
August 6, 2020 16:11
-
-
Save hshrzd/1ce09bdbe53db6c4713a4ab914b8e8b2 to your computer and use it in GitHub Desktop.
IDA script to fetch string references
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment