Skip to content

Instantly share code, notes, and snippets.

@darkarnium
Created January 23, 2017 01:18
Show Gist options
  • Save darkarnium/5b77b28cd11e75ab46aabd861270fc11 to your computer and use it in GitHub Desktop.
Save darkarnium/5b77b28cd11e75ab46aabd861270fc11 to your computer and use it in GitHub Desktop.
A trivial IDAPy script to dump and demangle all C++ functions
import idautils
for mangled in idautils.Functions():
demangled = idc.Demangle(
str(idaapi.get_func_name(mangled)),
idc.GetLongPrm(idc.INF_SHORT_DN)
)
if demangled is not None:
print "{} => {}".format(mangled, demangled)
@darkarnium
Copy link
Author

< yrp> fyi your code depends on IDA being aware of all function boundaries
< yrp> theres not a better way to do it
< yrp> just headsup that you might need to rerun it if you identify more functions

@z16166
Copy link

z16166 commented Feb 19, 2020

good. how to propagate these symbols in IDA?

@alexander-hanel
Copy link

import idautils

for mangled in idautils.Functions():
    demangled = idc.demangle_name(idaapi.get_func_name(mangled), idc.INF_SHORT_DN)
  
    if demangled is not None:
        print("{} => {}".format(mangled, demangled))

Updated for IDA 7+ and Python 3+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment