Created
January 7, 2025 21:12
-
-
Save RobinDavid/083079417a7ba1227ba9fc8ad2898c11 to your computer and use it in GitHub Desktop.
Try creating strings whenever possible in the given range in IDA
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 ida_bytes | |
from ida_idaapi import BADADDR | |
import ida_nalt | |
def mk_strings(ea: int, end: int = BADADDR): | |
addr = ea | |
while True: | |
addr = ida_bytes.next_unknown(addr, end) | |
if addr == end: | |
break | |
c = ida_bytes.get_byte(addr) | |
if str(c).isprintable(): | |
if ida_bytes.create_strlit(addr, 0, ida_nalt.STRTYPE_C): | |
s = ida_bytes.get_strlit_contents(addr, -1, ida_nalt.STRTYPE_C) | |
print(f"{addr:#08x} -> {s}") | |
else: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment