binaryninja-api
binaryninja-api copied to clipboard
demangle_ms not properly handling calling conventions
Binary Ninja Version: 1.1.1762-dev, 49d18786 Platform: Windows 10 (10.0)
When calling demangle_ms, the returned Type just returns None for .calling_convention, although .tokens does show it.
>>> demangled = demangle_ms(Architecture['x86'], '?TestFunction@@YAIXZ')
>>> demangled
(<type: uint32_t __cdecl (void)>, ['TestFunction'])
>>> demangled[0].calling_convention is None
True
>>> demangled = demangle_ms(Architecture['x86'], '??0Callback@@QAE@XZ')
>>> demangled
(<type: public: __thiscall (void)>, ['Callback', 'Callback'])
>>> demangled[0].calling_convention is None
True
Yeah this is the line of code that does that:
result->m_callingConventionName = NoCallingConvention; //TODO: add calling convention stuff
This is slightly tricky because we don't really want to trust mangled names, because they can lie, especially with "thiscall" it will take some thought to do this properly.
I see. Is there any way to query the raw calling convention name in the meantime?
Fixed in 3.1.3761