I need to create a DLL with a function in it, but wish to pass on all the other functions to the DLL I'm imitating (for want of a better word).

I've read a few things that don't entirely make sense, that are for C++ programming.

I do understand that my DLL needs to export the same functions as the DLL I'm imitating, but quite how to do this in MASM is escaping me.

To pass on functions automatically:

1) Do I write an include file with all the exports of the real DLL, and include this in my stub?

2) In my export definition file, I again include all the functions of the real DLL, so they are available to the calling application?

Will the result of this be that if the app calls a function not included in my DLL, it will pass on to the real DLL?

If not, how can I get it to do this, without having to write every function into my DLL simply to pass it on?

I hope that is clear!  :D

Best regards,
Posted on 2009-07-18 13:22:24 by Astro
I know you are on a time crunch, but I would recommend reading (or at least skimming) through everything at http://www.agner.org/optimize/... with emphasis on manual 5.
Posted on 2009-07-18 21:23:19 by SpooK
Excellent! Thanks!!  8)

Best regards,
Posted on 2009-07-19 19:20:03 by Astro
I've figured it out, and got it working!!  8)

The highlights:

; Get handle to real DLL loaded with LoadLibrary
push offset DLL
call LoadLibrary
mov handle,eax


Function proc
push offset func1
push handle
call GetProcAddress
call eax
Function endp



Best regards,
Posted on 2009-07-21 18:35:08 by Astro