Skip to content

Instantly share code, notes, and snippets.

@Nukem9
Created May 1, 2020 07:32
Show Gist options
  • Save Nukem9/0276f7c7c874a1c8d07a13316124177e to your computer and use it in GitHub Desktop.
Save Nukem9/0276f7c7c874a1c8d07a13316124177e to your computer and use it in GitHub Desktop.
Random IDA Pro python scripts I've made
#
# Export all functions to an array in a header file
#
ftable = open(idc.AskFile(1, "func_list.h", "Save output file"), "w")
ftable.write("struct FunctionEntry\n{\n")
ftable.write("\tuintptr_t StartAddr;\n")
ftable.write("\tuintptr_t EndAddr;\n")
ftable.write("} const FunctionEntries[] =\n")
ftable.write("{\n")
for func in Functions():
# xrefCount = len(list(XrefsTo(func)))
# if xrefCount < 500:
# continue;
ftable.write("\t{ 0x%X, 0x%X },\n" % (func, idaapi.get_func(func).endEA))
ftable.write("};\n")
ftable.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment