Read others Process Memory?

  • Thread starter Thread starter GRABLER Georg
  • Start date Start date
G

GRABLER Georg

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
 
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
 
GRABLER Georg said:
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.
 
Willy said:
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
 
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 said:
Willy said:
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
 
Back
Top