Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ts95/process-memory
Process memory reading/writing library.
https://github.com/ts95/process-memory
Last synced: about 2 months ago
JSON representation
Process memory reading/writing library.
- Host: GitHub
- URL: https://github.com/ts95/process-memory
- Owner: ts95
- Created: 2013-05-27T19:57:51.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-07-15T21:58:14.000Z (over 10 years ago)
- Last Synced: 2023-05-14T13:34:25.860Z (over 1 year ago)
- Language: C#
- Size: 145 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Process memory library
==============A library that simplifies the process of reading and writing to
the memory of another process in a .NET langauge.__Remember to compile with /unsafe__
Example of a program which simply reads an array
of 16 bytes from address 0x1D8153A4 in the 'program' process and then
it prints out those bytes to the console.
When passing the name of a process you can write it with or without
'.exe' at the end of the string.
```C#
unsafe class Program
{
static void Main(string[] args)
{
var pm = new ProcessMemory("program.exe", AccessLevel.Read);// The address the library will read from
long address = 0x1D8153A4;// Check if the process is running currently
if (pm.ProcessExists)
{
// Read an array of bytes from the address
byte[] bytes = pm.ReadArray(address, 16);// Print out each byte to the console
foreach (byte b in bytes)
Console.WriteLine("0x{0:X2}", b);
}
Console.Read();
}
}
```Example of a program that reads an int from memory, then
adds 10 to it and writes it back to the same address.
```C#
unsafe class Program
{
static void Main(string[] args)
{
// Implicitly using AccessLevel.All
var pm = new ProcessMemory("program.exe");long address = 0x1D8153A4;
if (pm.ProcessExists)
{
int number;number = pm.Read(address);
number += 10;
pm.Write(address, number);
}
}
}
```