Re: How to dereference pointer pointing at memory in another process?

Diez Roggisch <[email protected]> Mon, 13 May 2013 14:23:35 +0200
Newsgroups gmane.comp.python.ctypes
Message-ID <CDB6A779.3FE6D%[email protected]>
On 5/13/13 8:16 AM, "Devon Strawn" <[email protected]> wrote:

>  Hi,
>
>I'm working on a debugger that uses ctypes structures to describe and
>store data that is read from another process's memory.
>
>This works really well, except for pointers.  Dereferencing a ctypes
>pointer for such a "mirrored" structure raises an error because ctypes
>reads the debugger process's memory instead of the debuggee's memory.
>That is incorrect, since the pointer points to memory in the other
>process.
>
>How can I modify the ctypes pointer dereferencing behavior so that the
>memory is read from somewhere other than the current process?


I doubt you can modify that, nor do I see how that would help. E.g. for
shared memory, you need to translate pointers in each sharing process
separately - *before* dereferencing.

The question is: how do you access the debugee's memory to begin with?

Diez



------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may