4
votes

I have got a x86 DLL (to which I have no source) which I need to call from a C++ program (VC++ 10).

Ive been told the calling convention is left to right, with the first three parameters passed in the EAX, ECX and EDX registers, and callee stack cleanup (as well as other details like floating point args/returns, etc).

Is there some way to automate this (e.g. generate from a file I have containing each of the several hundred function definitions, or even better "tell" the compiler about the convention) so that I can then call these functions as normal? The types used are all nice simple ones (void, int, char*, float, etc) if that helps.

1
To clarify, custom entry and exit code = your own assembly code that adapts from a supported to the unsupported calling convention. - Jon
Well thats doing somthing within the called function after you get there? But I need to do somthing at the call site? - Fire Lancer
After you get there, you can theoretically manipulate the registers and stack so that when the called function runs (immediately afterwards, that is) it will find them as it wants them. No conceptual difference than manipulating the calling convention. - Jon

1 Answers

2
votes