-1

I am trying to recreate the exported functions of a dll based of the result of a existing DLL. The reson being is that this DLL is read into a really old software and there is lacking documentation on how to create the DLL.

This is the result of DUMPBIN /exports Dumpbin exports

The documentation states that the function header should be:

DLLEXPORT long WINAPI User_Write(char *Command, char *Parameter)

But i can't find any way to use that exact line and replicate the outputs so i have created a DLL with the following function header:

extern "C" __declspec(dllexport) long __cdecl User_Write(char *Command, char *Parameter)

When i export this DLL with DUMPBIN /exports i get the following:

enter image description here

It is similar but not the same and the software is not accepting the DLL. I really need some help here!

Community
  • 1
  • 1
Sultanen
  • 3,084
  • 5
  • 25
  • 46
  • 1
    "not accepting the DLL" is not a proper problem description. Most obvious thing that's wrong is the mismatch between the calling conventions (you wrote cdecl but the declaration requires stdcall). And not getting the exported functions decorated at all. You never mentioned using a DEF file (required to remove the decoration) so you probably built an x64 DLL and the program requires an x86 DLL. – Hans Passant Nov 03 '16 at 12:20
  • The software implements functionality to load a user built DLL, it is supposed to export 3 simple functions as above. The original DLL does not pair with any DEF file, its only a single DLL file so is the DLL i have built. The DLL i have built is made with Microsoft Visual C++ V6.0 since i have gotten input that its probably what was used to create the original DLL. – Sultanen Nov 03 '16 at 12:36

1 Answers1

0

Try by changing the calling convention extern "C" __declspec(dllexport) long __stdcall User_Write(char *Command, char *Parameter)

aks
  • 302
  • 2
  • 10
  • Thanks for the reply !This gives me the following result, not really the goal: `1 0 00001063 _User_GetErrorMsg@8 2 1 0000104F _User_Read@8 3 2 0000103B _User_Write@8` – Sultanen Nov 03 '16 at 11:11