Results 1 to 1 of 1
Let's say I have this function defined in a child process:
Code:
void hello()
{
printf("hello\n");
}
And I know the function's address in the virtual memory of the child ...
- 07-30-2008 #1Just Joined!
- Join Date
- Jul 2008
- Posts
- 2
Functions from Child Process's Memory
Let's say I have this function defined in a child process:
And I know the function's address in the virtual memory of the child process, say 0x8049cc4.Code:void hello() { printf("hello\n"); }
How can I share this location in memory and have the parent read it so that I can call it from the parent process. Like this:
The important part to remember when proposing a solution is that the function is called in the child process still. The real function requires variables in the child process.Code:typedef void (*hello_t)(); hello_t hello = (hello_t)0x8049cc4; //this is where I need help hello();
I know this is possible using a shared library and LD_PRELOAD, but I wish to avoid this. However, I could accept a method to load a shared library into the process after it has already started, but I wish to avoid any "illegal" methods.
Thanks.


Reply With Quote