demangle module

binaryninja.demangle.demangle_gnu3(arch, …)

binaryninja.demangle.demangle_ms(arch, …)

demangle_ms demangles a mangled Microsoft Visual Studio C++ name to a Type object.

binaryninja.demangle.get_qualified_name(names)

get_qualified_name gets a qualified name for the provided name list.

binaryninja.demangle.pyNativeStr(arg)

binaryninja.demangle.range(*args)

A Python2 and Python3 Compatible Range Generator

demangle_gnu3(arch, mangled_name)[source]
demangle_ms(arch, mangled_name)[source]

demangle_ms demangles a mangled Microsoft Visual Studio C++ name to a Type object.

Parameters
  • arch (Architecture) – Architecture for the symbol. Required for pointer and integer sizes.

  • mangled_name (str) – a mangled Microsoft Visual Studio C++ name

Returns

returns tuple of (Type, demangled_name) or (None, mangled_name) on error

Return type

Tuple

Example
>>> demangle_ms(Architecture["x86_64"], "[email protected]@@[email protected]@[email protected]@Z")
(<type: public: static enum Foobar::foo __cdecl (enum Foobar::foo)>, ['Foobar', 'testf'])
>>>
get_qualified_name(names)[source]

get_qualified_name gets a qualified name for the provided name list.

Parameters

names (list(str)) – name list to qualify

Returns

a qualified name

Return type

str

Example
>>> type, name = demangle_ms(Architecture["x86_64"], "[email protected]@@[email protected]@[email protected]@Z")
>>> get_qualified_name(name)
'Foobar::testf'
>>>