How to undecorate name from decorated name?

To avoid guessing, and still not really use tools, the UnDecorateSymbolName function may be of use. I would hope that gives an authoritative correct answer.

To do it manually, this page has some information on the scheme, as do these.

The basic outline is _name@scope@scope@@parameters@something@@something. I suspect the last two parts are stack size and calling convention or similar, but the documentation likely has more detail.


Name mangling is compiler dependant.

In the article you linked, Raymond is using an MS util (undname) to remove the mangling.

Here is a table showing how common compilers mangle.


Microsoft Visual Studio comes with a undname.exe tool.

http://msdn.microsoft.com/en-us/library/ms937379.aspx

If you have MS VS at a default location you can use:

"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\undname.exe" ?GetName@PushButton@UILibrary@@UAEPB_WPAPAVStringHolder@2@@Z

Microsoft (R) C++ Name Undecorator Copyright (C) Microsoft Corporation. All rights reserved.

Undecoration of :- "?GetName@PushButton@UILibrary@@UAEPB_WPAPAVStringHolder@2@@Z" is :- "public: virtual wchar_t const * __thiscall UILibrary::PushButton::GetName(class UILibrary::StringHolder * *)"