Original Post
For my app (Window Detective) i am using code injection to obtain information from other processes.
I am currently using two different methods:
1) DLL injection using hooks - SetWindowsHookEx(WH_CALLWNDPROC, ...). I use this to monitor messages sent to windows. Functions are defined in the DLL and called by the remote process (via Window's hook mechanism).
2) Code injection using CreateRemoteThread. I use this to extract information from within the remote process. I write a function which i then inject into the process.
I was wondering if i could use the first method for both cases. That is, can i call a function from my DLL that is loaded into a remote process? It would be a whole lot easier since i don't have to deal with all the caveats mentioned here.
I am currently using two different methods:
1) DLL injection using hooks - SetWindowsHookEx(WH_CALLWNDPROC, ...). I use this to monitor messages sent to windows. Functions are defined in the DLL and called by the remote process (via Window's hook mechanism).
2) Code injection using CreateRemoteThread. I use this to extract information from within the remote process. I write a function which i then inject into the process.
I was wondering if i could use the first method for both cases. That is, can i call a function from my DLL that is loaded into a remote process? It would be a whole lot easier since i don't have to deal with all the caveats mentioned here.