I am writing a script for the IDA Pro disassembler in Python using the idapython
plugin. Using this, I am able to fill in the gaps where IDA's auto-analysis falls short.
One area that has me stumped is naming locations/functions with (for want of a better term) "pretty names". An example of what I mean is illustrated below:
idapython
and IDA Pro itself only allow me to enter basic C-ish function names. If I enter disallowed symbols (e.g. the scope resolution operator), they're replaced with underscores. However, if I enter a mangled name by hand (e.g. __ZN9IOService15powerChangeDoneEm
), IDA Pro will prettify this for me.
Hence my question: how can I generate mangled names to pass through idapython
? Is there a name-mangling library available? Is one available in Python? Is my only hope to tear the mangling functionality out of g++
and work around that?