mirror of
https://github.com/idapython/src
synced 2026-06-08 14:47:00 +00:00
24 lines
663 B
Python
24 lines
663 B
Python
"""
|
|
summary: dump the strings that are present in the file
|
|
|
|
description:
|
|
This uses `idautils.Strings` to iterate over the string literals
|
|
that are present in the IDB. Contrary to @show_selected_strings,
|
|
this will not require that the "Strings" window is opened & available.
|
|
|
|
see_also: show_selected_strings
|
|
|
|
level: beginner
|
|
"""
|
|
|
|
import ida_nalt
|
|
import idautils
|
|
|
|
s = idautils.Strings(False)
|
|
s.setup(strtypes=[ida_nalt.STRTYPE_C, ida_nalt.STRTYPE_C_16])
|
|
for i, v in enumerate(s):
|
|
if v is None:
|
|
print("Failed to retrieve string index %d" % i)
|
|
else:
|
|
print("%x: len=%d type=0x%x index=%d-> '%s'" % (v.ea, v.length, v.strtype, i, str(v)))
|