Forwarding calls to functions with the same name in multiple DLLs #221
Unanswered
lowleveldesign
asked this question in
Q&A
Replies: 1 comment
-
Don't use the same replacement function for multiple different functions, then you won't have that problem. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to hook the
DllGetClassObject
andDllCanUnloadNow
functions in the "COM" DLLs loaded by a given process. I already hooked LoadLibrary* functions, but I have difficulties creatingDllGetClassObject
hooks dynamically. The problem is that I want to call the original function in my hook function (let's call itmyDllGetClassObject
). As themyDllGetClassObject
body is the same for all the created hooks, I need to find a way to pick the correct function to which I will forward the call.The only idea that comes to my mind is to find the return address of
myDllGetClassObject
and move backward to find the trampoline address. The trampoline address uniquely identifies a given hook and will allow me to do the call. But it seems a bit complicated, and I'm not sure if it's portable between platforms. Could you please advise if there is maybe a better way?Beta Was this translation helpful? Give feedback.
All reactions