unknown6656
unknown6656

Reputation: 2963

Obtain Mangled Symbol Name based on C++ Signature

Does someone know how to obtain the mangled symbol name based on a given C++ function signature? e.g.:

__stdcall unsigned char MyClass::MyFunc(const int param1, int param2);

would become:

?MyFunc@MyClass@@QGE@?BHH@Z

when using the Microsoft Visual C++ Compiler.

I was thinking about some WINAPI-function, but I did not find any...


EDIT: Ok - I know, this is not a very clearly formulated question. What I want to achieve is the following:

GetMangledName("__stdcall unsigned char MyClass::MyFunc(const int param1, int param2);");
// Returns "?MyFunc@MyClass@@QGE@?BHH@Z"

Upvotes: 1

Views: 276

Answers (1)

Elemental
Elemental

Reputation: 7476

I believe the name mangling is compiler dependent and not part of the c++ specification. So as far as I can see the only reliable way is to invoke the actual compiler that you are using and get back a mapping of how the source names map to the mangled names.

Upvotes: 1

Related Questions