Communicating with other processes?

c++ / delphi package - dll injection and api hooking
Post Reply
GaryGlaze2496
Posts: 14
Joined: Mon Dec 27, 2004 9:38 pm

Communicating with other processes?

Post by GaryGlaze2496 »

Hey everyone,

Quick question about madCodeHook.

I've been able to successfully use WM_COPYDATA to send data out of my hook to another application, for processing.

How can I send data back in to the hook again?

Basically, I need to do some complex operations of the data that it would make no sense to put into my hook.

I want to have a background process running, and let send data back to the hook.

Any ideas?

Gary
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Do you want the hook dll (and in the same way the thread which called the hooked API) to wait for the response from your application? The thread would be blocked during that time, of course. Or do you want the thread which called the hooked API to continue and send a reply somewhen later to your hook dll?
GaryGlaze2496
Posts: 14
Joined: Mon Dec 27, 2004 9:38 pm

Wait

Post by GaryGlaze2496 »

Hey Madshi,

I'd want the app with the hook dll to wait, and have the thread be blocked...

:)

Gary
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

The easiest way would be to use madCodeHook's SendIpcMessage. That one can wait until you the app responds. And the app can directly send a reply to the IPC ("inter process communication") request.

You should be aware that this kind of communication isn't the fastest, so please don't send thousands of messages per second.
GaryGlaze2496
Posts: 14
Joined: Mon Dec 27, 2004 9:38 pm

Post by GaryGlaze2496 »

Doh,

Should have just RTFM. ;-)

Thanks Madshi!

Gary
Post Reply