ExportsToC++ is a Windows GUI tool that parses dumpbin.exe output and converts a DLL's exported function list into C++ proxy code. This is useful for creating proxy DLLs to intercept API calls.
- Windows
- .NET Framework 2.0
dumpbin.exe(included with Visual Studio) — automatically located in Visual Studio 8 or 9 install directories, or anywhere on yourPATH
- Open a DLL in the tool via File > Open (or pass it as a command-line argument)
- The tool runs
dumpbin.exe /EXPORTSand displays the raw export table in the top pane - Click Generate to produce C++ proxy code in the bottom pane
- When prompted, enter the name of the proxy DLL (without
.dll) - Copy the output to clipboard or save it as a
.cppfile via File > Save
You can also launch with a file pre-loaded:
ExportsToC++.exe path\to\target.dll
The tool accepts any Windows DLL (.dll) that exports functions. Internally it runs:
dumpbin.exe /EXPORTS "target.dll"
The raw dumpbin output is displayed in the top pane. The export table must contain at least one function — if the DLL has no exports the tool will warn you and skip generation.
The generated .cpp file contains:
- Standard includes (
stdafx.h,windows.h,iostream) - A
#pragma comment(linker, ...)directive for each exported function, forwarding it from the proxy DLL to the real one by name and ordinal:
#include "stdafx.h"
#include <iostream>
#include <windows.h>
using namespace std;
#pragma comment (linker, "/export:SomeFunction=reallib.SomeFunction,@1")
#pragma comment (linker, "/export:AnotherFunction=reallib.AnotherFunction,@2")
// ...
BOOL WINAPI DllMain(HINSTANCE hInst, DWORD reason, LPVOID)
{
return true;
}The proxy DLL name used in the forwarding directives (e.g. reallib above) is entered when you click Generate. The output can be copied to the clipboard or saved as a .cpp source file.
MIT License. See LICENSE for details.