I created a wrapper DLL using a DEF file for describing its EXPORTS
.
From the original DLL's exports (generated using dumpbin):
EXPORTS
??0FooBar@@QAE@ABV0@@Z @1
From the created DEF file for my wrapper DLL:
EXPORTS
??0FooBar@@QAE@ABV0@@Z=__E__0__ @1
When checking the resulting wrapper DLL using OllyDbg, I can see that the export actually gets changed towards:
Names in FooBarDLL, item 0
Address=0F085685
Section=.text
Type=Export
Name=??0FooBar
As you see, it is missing that additional garbledegock (@@QAE@ABV0@@Z
) usually generated by Microsoft Visual C++ for this type of a class/function/parameter combination.
To make sure that this is not a user error on the usage of OllyDbg, I checked the original DLL's exports as well and to no surprise those looked just like the stuff I was expecting:
Names in FooBarDLLOriginal, item 1
Address=1003A800
Section=.text
Type=Export
Name=??0FooBar@@QAE@ABV0@@Z
As I need my wrapper DLL to look exactly like the original DLL, this result is obviously no good.
How can I prevent Visual C++ from ignoring fragments of my DEF exports definitions?
I have tried to play with many compiler and linker options but utterly failed in getting any closer to my goal.