Question

I would like to know if it is poosible to change the virtual address space of a child process in Unix like operating system. I want to have the ability to

(a) Load/unload shared libraries

(b) Write to random user space memory locations of the child process ( not shared memory)

I basically want complete control (think windows 95 like control) over the process address space of a child process.

I know debuggers achieve this to a certain extent, but do you achieve this (system calls to be used, tutorials about subject,etc)??

Était-ce utile?

La solution

You need to look into ptrace.

 ptrace() provides tracing and debugging facilities.  It allows one
 process (the tracing process) to control another (the traced process).

You can use PTRACE_ATTACH to start tracing, PTRACE_GETREGS (SETREGS) to get/set registers, PTRACE_PEEKUSER (POKEUSER) to read/write user data and PTRACE_PEEKDATA (POKEDATA) to read/write data/code sections.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top