C++ compilers need to generate multiple library symbols in compiled code for functions and data that have the same name. For example you may have two functions in a program with the same name but different function arguments.
To solve this problem C++ compilers will compile object code using name mangling. This is a technique where the symbol's name is changed to encode type information, such as the type of a function's arguments or signature.
This can be a problem later when examining object code, such as when you dump the symbol tables of compiled programs or libraries using binary file dumpers like 'nm' or 'dumpbin'. You will often see mangled debugging symbols in stack traces, crash dumps or log files. The symbols reported are often unreable.
Here are some mangled GCC symbols from part of an 'nm' dump that you can try out:
0000000000461fae W _ZNK8KxVectorI16KxfArcFileRecordjEixEj 000000000042ea8a W _ZNK8KxVectorI5KxSpeIcjEjE4sizeEv 000000000042d0e4 W _ZNK8KxVectorI5KxSpeIcjEjEixEj 0000000000433ec6 W _ZNK8KxVectorI6DlAtomjE4sizeEv 000000000043dfb0 W _ZNK8KxVectorI6DlAtomjEixEj 0000000000435f04 W _ZNK8KxVectorI6DlTypejE4sizeEv 000000000043df92 W _ZNK8KxVectorI6DlTypejEixEj 000000000042c3c8 W _ZNK8KxVectorI7KSrvHMEjE4sizeEv 00000000004435f8 W _ZNK8KxVectorIN4DlDb7DlDatumEjE4sizeEv 000000000043dc6c W _ZNK8KxVectorIN4DlDb7DlDatumEjEixEj 00000000004776da W _ZNK8KxVectorIP13KxLogObserverjE10idxIsValidEj 0000000000477684 W _ZNK8KxVectorIP13KxLogObserverjE4findERKS1_
And here are some mangled symbols produced by MSVC, dumped from 'dumpbin':
68E 00000000 SECT1FD notype External | ??_R3?$KxSet@V?$KxSpe@DI@@I@@8 691 00000000 SECT1FE notype External | ??_R2?$KxSet@V?$KxSpe@DI@@I@@8 694 00000000 SECT1FF notype External | ??_R1A@?0A@EA@?$KxSet@V?$KxSpe@DI@@I@@8 697 00000000 SECT200 notype External | ??_R1A@?0A@EA@?$KxTree@V?$KxSpe@DI@@I@@8 69A 00000000 SECT201 notype External | ??_R0?AV?$KxTree@V?$KxSpe@DI@@I@@@8 69D 00000000 SECT202 notype External | ??_R3?$KxTree@V?$KxSpe@DI@@I@@8 6A0 00000000 SECT203 notype External | ??_R2?$KxTree@V?$KxSpe@DI@@I@@8 6A3 00000000 SECT204 notype External | ??_R4?$KxTree@V?$KxSpe@DI@@I@@6B@ 6A6 00000000 SECT205 notype External | ??_R4?$KxSet@VKxSymbol32@@I@@6B@ 6A9 00000000 SECT206 notype External | ??_R0?AV?$KxSet@VKxSymbol32@@I@@@8 6AC 00000000 SECT207 notype External | ??_R3?$KxSet@VKxSymbol32@@I@@8 6AF 00000000 SECT208 notype External | ??_R2?$KxSet@VKxSymbol32@@I@@8 6B2 00000000 SECT209 notype External | ??_R1A@?0A@EA@?$KxSet@VKxSymbol32@@I@@8
This site can translate C++ and Java mangled names back to their original form, with the entire type or function signature.
We support mangled symbols generated by GCC, G++, MSVC and Java only.
Simply enter any text containing obfuscated symbols in the window below, and press "Demangle it!"
Using Demangle as a web API
You can demangle text programatically by making a POST request to:
https://demangler.com/raw
The body of the request should be encoded as a classic www-url encoded form content, or JSON or XML, with a single parameter input. You can use this for example to create a shell script that will demangle the output of another program:
#!/bin/bash curl --data-urlencode input@- https://demangler.com/raw
Which you can use like this:
nm libmylib.a | demangle.sh
Contact
Email questions and comments to rafael@demangler.com