Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import idc
def define_func(addr, name):
idc.MakeCode(addr)
idc.MakeFunction(addr)
idc.MakeNameEx(addr, name, idc.SN_NOWARN)
print("%s @ %s" % (name, hex(addr)))
def importr2file(path):
content = ""
with open(path, "r") as f:
content = f.readlines()
sym_count = 0
for line in content:
if not line.startswith("f sym."):
continue
line = line.strip("\n")
split_line_arr = line.split(' ')
sym_name = split_line_arr[1][4:]
sym_addr = split_line_arr[3]
sym_addr_int = int(sym_addr, 16)
define_func(sym_addr_int, sym_name)
sym_count += 1
print("defined %s syms" % str(sym_count))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.