C ++名称手动调用 [英] C++ name mangling by hand

查看:177
本文介绍了C ++名称手动调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Python中使用页

  • A 致电约定 PDF文档,其中描述了各种编译器的方案



  • 名称Mangling 上的维基百科页面。


    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?

    解决方案

    I finally got around to dig a little.

    Unfortunately I could not find tool, I did find resources though.

    If all you want is mangle names in the gcc3 fashion, then know that gcc3 use the Itanium C++ ABI, which has a standardized name mangling scheme. I found two documents:

    For reference, both come from the Wikipedia page on Name Mangling.

    这篇关于C ++名称手动调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆