Click here to Skip to main content
15,390,952 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi
after solving my problem that i had here [^], now, i have another question and that's how can i find all decorated API names or is there a function that returns the decorated name of an API.

What I have tried:

googling
trying some functions of dbghelp.h
Posted
Updated 22-Jun-22 5:45am
v2

The export with dumpbin works with User32.Lib as well as libuser32.a.

The function MessageBox is included in both, but in the VS version in the User32.Lib with underscore and with gcc in libuser32.a without underscore. In addition, the functions in the MS lib are also decorated.

"C:\...\VC\bin\dumpbin.exe"  /EXPORTS   "C:\...\x86\User32.Lib" >user32.lib.exports.txt
"C:\...\VC\bin\dumpbin.exe"  /EXPORTS   "C:\...\TDM-GCC-64\x86_64-w64-mingw32\lib\libuser32.a"


Dump of file C:\...\x86\User32.Lib

File Type: LIBRARY

     Exports

       ordinal    name

                  _ActivateKeyboardLayout@8
                  _AddClipboardFormatListener@4
                  _AdjustWindowRect@12
                  _AdjustWindowRectEx@16
                  _AdjustWindowRectExForDpi@20
                  ...
                  _MessageBoxA@16
                  _MessageBoxExA@20
                  _MessageBoxExW@20
                  _MessageBoxIndirectA@4
                  _MessageBoxIndirectW@4
                  _MessageBoxTimeoutA@24
                  _MessageBoxTimeoutW@24
                  _MessageBoxW@16
                  ...


Dump of file C:\...\TDM-GCC-64\x86_64-w64-mingw32\lib\libuser32.a

File Type: LIBRARY

     Exports

       ordinal    name

                  wvsprintfW
                  wvsprintfA
                  wsprintfW
                  wsprintfA
                  ....
                  MessageBoxW
                  MessageBoxTimeoutW
                  MessageBoxTimeoutA
                  MessageBoxIndirectW
                  MessageBoxIndirectA
                  MessageBoxExW
                  MessageBoxExA
                  MessageBoxA
                  ...
   
The DUMPBIN Reference | Microsoft Docs[^] utility can do it for you.
   
Comments
reverser69 22-Jun-22 4:52am
   
what commands should i use? i tried several commands but couldn't get what i wanted; like /imports, it shows normal API names.

update: i was passing the .exe instead of the .lib file itself.
Richard MacCutchan 22-Jun-22 5:02am
   
I would suggest probably /EXPORTS and /SYMBOLS would be a reasonable choice. See also Decorated names | Microsoft Docs[^].
merano99 22-Jun-22 11:10am
   
+5; works with /EXPORTS
Richard MacCutchan 22-Jun-22 11:30am
   
Thanks, it is a long time since I needed to use this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900