I was just wondering what the easiest way to figure out how a function
gets name mangled in VC++ is.

I have this function:

class Test
{

int operator[](unsigned int index);
};

I'm trying to figure out how this gets mangled in VC++ 6.0 and VS
2005.

Any help is appreciated.

Thank you.

Re: name mangling by Brian

Brian
Thu May 24 19:43:26 CDT 2007


<mike7411@gmail.com> wrote in message
news:1180044379.159088.34690@k79g2000hse.googlegroups.com...
>I was just wondering what the easiest way to figure out how a function
> gets name mangled in VC++ is.
>
> I have this function:
>
> class Test
> {
>
> int operator[](unsigned int index);
> };
>
> I'm trying to figure out how this gets mangled in VC++ 6.0 and VS
> 2005.
>

I can't answer, but I'm curious why you care. Are you trying to link object
files compiled by different compilers?



Re: name mangling by Alex

Alex
Fri May 25 04:15:17 CDT 2007

<mike7411@gmail.com> wrote:
> I was just wondering what the easiest way to figure out
> how a function
> gets name mangled in VC++ is.


In order to figure out mangled name you need to compile the
code. There is no other way I'm aware of. You can infer some
decoration rules from this MSDN article:

"Format of a C++ Decorated Name"
http://msdn2.microsoft.com/en-us/library/2ax8kbk1(vs.80).aspx

However, a lot of info is internal to comiler/linker and may
take considerable effort to discover via reverse
engineering.

On the other hand, if you need to restore original name from
a mangled one, then there is UndName.exe tool, which is part
of VC++. Also, you can use `UnDecorateSymbolName' function
from DbgHelp.dll library.

HTH
Alex


Re: name mangling by Sylvester

Sylvester
Tue May 29 07:35:16 CDT 2007

mike7411@gmail.com wrote :
> I was just wondering what the easiest way to figure out how a function
> gets name mangled in VC++ is.
>
> I have this function:
>
> class Test
> {
>
> int operator[](unsigned int index);
> };
>
> I'm trying to figure out how this gets mangled in VC++ 6.0 and VS
> 2005.
>
> Any help is appreciated.
>
> Thank you.

Try this:
http://en.wikipedia.org/wiki/Microsoft_Visual_C++_Name_Mangling



Re: name mangling by Carl

Carl
Tue May 29 09:02:48 CDT 2007

Sylvester Hesp wrote:
> mike7411@gmail.com wrote :
>> I was just wondering what the easiest way to figure out how a
>> function gets name mangled in VC++ is.
>>
>> I have this function:
>>
>> class Test
>> {
>>
>> int operator[](unsigned int index);
>> };
>>
>> I'm trying to figure out how this gets mangled in VC++ 6.0 and VS
>> 2005.
>>
>> Any help is appreciated.
>>
>> Thank you.
>
> Try this:
> http://en.wikipedia.org/wiki/Microsoft_Visual_C++_Name_Mangling

... but be aware that it's incomplete - it doesn't cover template names.

-cd