Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DLL function names using dumpbin.exe

I have written a .dll library with lots of functions and classes in visual studio 2010. When I look at the content of the file with:

dumpbin.exe /EXPORTS myDll.dll

I get long function names with some kind of a function location pointer, which looks like this (second entry in .dll):

          2    1 0001100A ?Initialize@codec@codecX@@SANNN@Z = @ILT+5(?Initialize@codec@codecX@@SANNN@Z)

This is somehow hard to read, but I saw "nicer" procedure/function list from other .dll-s, like this:

141   8C 00002A08 PogoDbWriteValueProbeInfo

How can I make that .dll list look that way?

P.S.: my dll source code looks like this:

namespace codecX
{
   class codec
   {
      public:
      static __declspec(dllexport) double Initialize(double a, double b);
      ...
like image 275
TomiL Avatar asked Feb 26 '13 13:02

TomiL


People also ask

How do I get a list of functions in a DLL?

You can list function names for a specific DLL, such as user32. dll, by running a variety of command-line tools. For example, you can use dumpbin /exports user32. dll or link /dump /exports user32.

What is Dumpbin EXE?

The Microsoft COFF Binary File Dumper (DUMPBIN. EXE) displays information about Common Object File Format (COFF) binary files. You can use DUMPBIN to examine COFF object files, standard libraries of COFF objects, executable files, and dynamic-link libraries (DLLs).

What functions are in a DLL?

A DLL helps promote developing modular programs. It helps you develop large programs that require multiple language versions or a program that requires modular architecture. An example of a modular program is an accounting program that has many modules that can be dynamically loaded at run time.


1 Answers

You need to pull those static member functions into the global address space and then wrap them with extern "C". This will suppress the C++ name mangling and instead give you C name mangling which is less ugly:

extern "C" __declspec(dllexport) Initialize(double a, double b)
{
    codec::Initialize(a, b);
}

and then remove the __declspec(dllexport) on your static member functions:

class codec
{
    public:
        static double Initialize(double a, double b);
}
like image 54
John Källén Avatar answered Sep 19 '22 18:09

John Källén