2005-11-27 00:39:09

by Mohamed El Dawy

[permalink] [raw]
Subject: Reading another process memory?

Hi,
How are you? I hope you are fine.

I am trying to write a function that involves reading other processes
memory.
Here is what I can do

1. traverse the linked list of running processes searching for the
required pid
2. Follow the "mm" pointer to get the mm_struct
3. Traverse the "mmap" linked list in that mm_struct to get a list of
all ranges of addresses
3b. And read the "pgd" field too in the mm_sturct which contains the
page directory

Now, I have the page directory, and some logical addresses. Now comes
the tricky part, how can I actually read the memory? I am not really
sure how to read an address given a page directory and a logical
address. Do I need to translate it myself? Are there any functions to
do the job for me?

Thanks a lot in advacne


2005-11-27 02:30:19

by Bodo Eggert

[permalink] [raw]
Subject: Re: Reading another process memory?

Mohamed El Dawy <[email protected]> wrote:

> I am trying to write a function that involves reading other processes
> memory.

Most likely you should
a) use ptrace.
b) use shared memory.

--
Ich danke GMX daf?r, die Verwendung meiner Adressen mittels per SPF
verbreiteten L?gen zu sabotieren.