PDA

View Full Version : C++ fork() another process?



XtrmJosh
July 10th, 2013, 12:09 AM
I'm trying to read the memory of a process which I have no real access to. The process is a game, and I want to find values within its memory. I'm currently using ptrace, but it pauses the game, so I'm looking to fork the process, ptrace it, then unfork it (if that's a thing!)

I'm reading memory just fine, just can't work out how to fork using a PID.

Can anyone advise?

Kind regards

Tony Flury
July 11th, 2013, 08:57 AM
What do you mean "fork using a pid".

Fork creates a brand new process - it sounds like you want to attach somehow to an already running process.

Also not sure what you mean by "unfork" - do you mean kill the process - or do you mean detach from it ?

XtrmJosh
July 11th, 2013, 10:26 AM
What do you mean "fork using a pid".

Fork creates a brand new process - it sounds like you want to attach somehow to an already running process.

Also not sure what you mean by "unfork" - do you mean kill the process - or do you mean detach from it ?

I want to read a processes memory without interrupting the process. Currently, when using ptrace I'm forced to freeze the process whilst reading. I was hoping to duplicate the external process which I'm trying to read, read from the dupe, then dispose of it. Is there any better way you could advise to do this? Or even just to read memory without freezing the process?