Skip to content

Instantly share code, notes, and snippets.

@daaximus
Created May 9, 2023 01:21
Show Gist options
  • Save daaximus/098b52775aeb14697e41607117ccbf29 to your computer and use it in GitHub Desktop.
Save daaximus/098b52775aeb14697e41607117ccbf29 to your computer and use it in GitHub Desktop.
Dump all exports and their prototypes if available (IDAPython)
import idautils
import idaapi
import idc
def get_func_prototype(ea):
tinfo = idaapi.tinfo_t()
if idaapi.get_tinfo(tinfo, ea):
return idaapi.print_tinfo("", 0, 0, idaapi.PRTYPE_1LINE, tinfo, "", "")
else:
return None
def dump_exports():
for module_address, ordinal, ea, name in idautils.Entries():
try:
prototype = get_func_prototype(ea)
if prototype:
ret_type, rest = prototype.split(' ', 1)
cconv, rem = rest.split('(', 1)
func_def = ret_type + ' ' + cconv + ' ' + name + '(' + rem
print("{0}".format(func_def))
else:
continue
except:
continue
def main():
idaapi.auto_wait()
dump_exports()
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment