What would be the best way to go about this?

RCF support and general discussion.
Post Reply
Rectangle
Posts: 3
Joined: Mon May 06, 2013 9:35 pm

What would be the best way to go about this?

Post by Rectangle »

I have a project which is mainly used for remote debugging.
The way it works is the client would launch a process in suspended mode, then inject the server DLL into the target process where it would then hook several Windows API functions, and then it would resume the main thread of the target process.
It has been suggested to me that I implement some IPC/RPC techniques to allow the client executable to seamlessly communicate with the server library in order to have full debugging control over the target process.
That's when I found out about RcfLib...

I was thinking that the client should be able to tell the server which functions it should hook, as well as when to resume the target process's main thread.
But I'm having trouble figuring out how to establish a proper 2-way communication between the server and the client.
I need to have the client become notified when the server has been initialized, and then I need the client tell the server which functions to hook and when to continue the main thread, then I need the server to notify the client that the main thread has been resumed.

What would be the best way to implement this type of design using RcfLib?
Would I simply create a shared stub interface and set up some callback functions on both the client AND the server?

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: What would be the best way to go about this?

Post by jarl »

The simplest way to do this is to run a RcfServer in both the client and server. If you use named pipes with names known to both the server and the client, they won't have any problems finding each other. If you use TCP, you'll need to use fixed port numbers, or else have some other way of communicating the port number between the two processes.

Hope that helps.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

Post Reply