Created
January 28, 2020 01:42
-
-
Save hasherezade/4ceb59d6701d2fe95747543d77c04276 to your computer and use it in GitHub Desktop.
IDA script snippets
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
#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") |
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
#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