views:

792

answers:

4

I am interested in finding either official or reverse engineered documentation detailing the name mangling scheme used by the Visual Studio C++ Compiler to translate C++ names into symbols in generated code.

I am aware that this may change between versions, and am most interested in the details for Visual Studio 2003, 2005 and 2008.

Of special interest is the handling of C++ operators, such as new, placement new, and new[]

+2  A: 

Following link may be of interest to you.

http://msdn.microsoft.com/en-us/library/ms681400(VS.85).aspx

lakshmanaraj
+1  A: 

Found a useful link, which also links to further useful information.

grrussel
+1  A: 

A serious community effort to uncover the decoration scheme: 1, 2, 3, 4, 5.

Ofek Shilon
A: 

Thanks for the references, but I have to quibble - meaning it in good humour - about both "serious" and "community". When I wrote those pages, I should have liked very much to make a serious effort, but the pages remain marked just as sketches of how research might continue. Sadly, there is next to no community support for serious efforts at studying other people's software, for this or any other topic.

In everyday practice, programmers rarely need to know the algorithm for decoration. To find how a particular C++ name gets decorated, they can use the compiler. To reverse a particular decoration, they can feed it to the CRT Library function __unDName. That's admittedly undocumented, but it has been there a long, long time. To use it these days is easy because Visual Studio comes with an UNDNAME.EXE tool.

Geoff Chappell