https://github.com/danielfvm/memorymodifier
Linux MemoryModifier Tool + Lib
https://github.com/danielfvm/memorymodifier
Last synced: 7 months ago
JSON representation
Linux MemoryModifier Tool + Lib
- Host: GitHub
- URL: https://github.com/danielfvm/memorymodifier
- Owner: danielfvm
- License: gpl-2.0
- Created: 2020-05-04T16:47:41.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-06-13T14:32:19.000Z (almost 5 years ago)
- Last Synced: 2025-01-11T00:12:43.133Z (over 1 year ago)
- Language: C++
- Size: 256 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MemoryModifier
MemoryModifier is a tool and a library for scanning and modifying memory on Linux.
It can also be used for creating patterns to search in your own C scripts.
## Installation
```
$ cd MemoryModifier
$ make
$ make install
```
## Use MemoryModifier
To use this tool you will need sudo permissions.
```
$ sudo mm
```
## Use library
[examples](https://github.com/danielfvm/MemoryModifier/tree/master/examples)
### Open a process
First open a process by name
```c
Process *p;
if ((p = openProcess("application")) == NULL) {
fprintf(stderr, "Failed to open process memory");
}
```
### Open Memory Region
Now open the memory region, you can manually look at it in ``/proc/PID/maps``
In this case we open the heap.
```c
MemoryRegion heap;
if (getMemoryRegion(p, "[heap]", &heap) == 0) {
fprintf(stderr, "Failed to open memory region");
}
```
### Read memory
```c
byte number[4];
if (readProcessMemory(heap, heap.start + offset, number, sizeof(int)) == 0) {
fprintf(stderr, "Failed to read memory");
}
```
### Write to memory
```c
if (writeProcessMemory(heap, heap.start + offset, getBytes(int, 1234), sizeof(int)) == 0) {
fprintf(stderr, "Failed to write to memory");
}
```