[Mono-dev] {kinda OT} Linux equivalent of Win32 "ReadProcessMemory"...

Mike Edenfield kutulu at kutulu.org
Mon Apr 13 11:01:51 EDT 2009


On 4/13/2009 9:18 AM, Gladish, Jacob wrote:
> Is there a particular piece of memory you're looking for? Environmental variables, etc., or are you simply trying to read arbitrary bytes from another processes?

 From glibc's perspective it would be arbitrary memory, but there's a 
specific piece of information I want to get at.

I'm trying to port this: http://dwarfmanager.sourceforge.net/.  It's a 
utility that interacts with my current major addiction (Dwarf Fortress) 
by reading chunks of memory from the running process, and applying what 
it knows about the layout of the data structures to let you bulk-update 
data elements.

It's written n C#, and GPL'd, and it starts up fine under Mono, but the 
memory access using ReadProcessMemory, so I'm trying to write the 
equivalent Linux code to use instead.

I've already gotten far enough since my original email to know that you 
can't open /proc/<pid>/map in a file stream (I get an err: unknown 
process of all things).  Apparently I'm gonna have to mmap() the file 
into my own memory space instead.

--Mike



More information about the Mono-devel-list mailing list