By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,446 Members | 3,019 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,446 IT Pros & Developers. It's quick & easy.

Read others Process Memory?

P: n/a
Hello everyone.

A not too long time ago, i wrote a Post about "Reading process memory".

Now, i got a good answer, about using the "marshal" class.

I read over the class quickly, but i could not find a solution to write
anothers process memory.

As it was done in C++ (WinAPI)
IntPtr hProcess

where i can pass by a processes adress.

Now, i read the Process-List with
Process[] pArray = Process.GetProcessesByName("Tibia");
in C#

As i found in the marshal class, the function ReadByte in the Marshal
class would fit fine. But how to read of the process memory of the other
Process? I cant find anything where ic an pass by a Process-Object or
Object-Reference.

Thank you,
Grabler Georg

PS: Sorry that i dont use a "real" E-Mail this time, last time i got
spammed by hundreds of e-mails an hour with several viruses and other
things.
The ones who want to write an E-Mail, please to
georg at grabler.net

Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Now, i got a good answer, about using the "marshal" class.


I don't think it'll help you here. The Marshal class only works with
addresses in your own process space.

I think you have to use the ReadProcessMemory Win32 API, since there's
no corresponding functionality in the BCL.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 15 '05 #2

P: n/a

"GRABLER Georg" <ma**@not.set> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
Hello everyone.

A not too long time ago, i wrote a Post about "Reading process memory".

Now, i got a good answer, about using the "marshal" class.

I read over the class quickly, but i could not find a solution to write
anothers process memory.

As it was done in C++ (WinAPI)
IntPtr hProcess

where i can pass by a processes adress.

Now, i read the Process-List with
Process[] pArray = Process.GetProcessesByName("Tibia");
in C#

As i found in the marshal class, the function ReadByte in the Marshal
class would fit fine. But how to read of the process memory of the other
Process? I cant find anything where ic an pass by a Process-Object or
Object-Reference.

Thank you,
Grabler Georg

PS: Sorry that i dont use a "real" E-Mail this time, last time i got
spammed by hundreds of e-mails an hour with several viruses and other
things.
The ones who want to write an E-Mail, please to
georg at grabler.net


Not quite clear why you need to read another process memory, anyway you need
to call the Win32 API "ReadProcessMemory" using PInvoke.

Willy.
Nov 15 '05 #3

P: n/a
Willy Denoyette [MVP] wrote:
"GRABLER Georg" <ma**@not.set> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
Hello everyone.

A not too long time ago, i wrote a Post about "Reading process memory".

Now, i got a good answer, about using the "marshal" class.

I read over the class quickly, but i could not find a solution to write
anothers process memory.

As it was done in C++ (WinAPI)
IntPtr hProcess

where i can pass by a processes adress.

Now, i read the Process-List with
Process[] pArray = Process.GetProcessesByName("Tibia");
in C#

As i found in the marshal class, the function ReadByte in the Marshal
class would fit fine. But how to read of the process memory of the other
Process? I cant find anything where ic an pass by a Process-Object or
Object-Reference.

Thank you,
Grabler Georg

PS: Sorry that i dont use a "real" E-Mail this time, last time i got
spammed by hundreds of e-mails an hour with several viruses and other
things.
The ones who want to write an E-Mail, please to
georg at grabler.net

Not quite clear why you need to read another process memory, anyway you need
to call the Win32 API "ReadProcessMemory" using PInvoke.

Willy.


Thank you for your repiles.

Reading and Writing other process memory is sometimes necessary for
preventing gameservers opening direct3d windows where you can set the
options. with writing in the others userspace i can tell, that i have
set the options and finished with using the default values.

Thank you for your replies, it makes me stop .NET development again.

Grabler Georg

Nov 15 '05 #4

P: n/a
I thought that writing into another's process space was a privilege required
by debuggers only ;-).
What's your problem using PInvoke, and there is Managed C++ (which is also
part of .NET.), just curious how did you manage this before .NET?

Willy.

"GRABLER Georg" <ma**@not.set> wrote in message
news:uK**************@TK2MSFTNGP09.phx.gbl...
Willy Denoyette [MVP] wrote:
"GRABLER Georg" <ma**@not.set> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
Hello everyone.

A not too long time ago, i wrote a Post about "Reading process memory".

Now, i got a good answer, about using the "marshal" class.

I read over the class quickly, but i could not find a solution to write
anothers process memory.

As it was done in C++ (WinAPI)
IntPtr hProcess

where i can pass by a processes adress.

Now, i read the Process-List with
Process[] pArray = Process.GetProcessesByName("Tibia");
in C#

As i found in the marshal class, the function ReadByte in the Marshal
class would fit fine. But how to read of the process memory of the other
Process? I cant find anything where ic an pass by a Process-Object or
Object-Reference.

Thank you,
Grabler Georg

PS: Sorry that i dont use a "real" E-Mail this time, last time i got
spammed by hundreds of e-mails an hour with several viruses and other
things.
The ones who want to write an E-Mail, please to
georg at grabler.net

Not quite clear why you need to read another process memory, anyway you need to call the Win32 API "ReadProcessMemory" using PInvoke.

Willy.


Thank you for your repiles.

Reading and Writing other process memory is sometimes necessary for
preventing gameservers opening direct3d windows where you can set the
options. with writing in the others userspace i can tell, that i have
set the options and finished with using the default values.

Thank you for your replies, it makes me stop .NET development again.

Grabler Georg

Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.