Skip to content

danielfvm/MemoryModifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Open a process

First open a process by name

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.

MemoryRegion heap;
if (getMemoryRegion(p, "[heap]", &heap) == 0) {
    fprintf(stderr, "Failed to open memory region");
}

Read memory

byte number[4];
if (readProcessMemory(heap, heap.start + offset, number, sizeof(int)) == 0) {
    fprintf(stderr, "Failed to read memory");
}

Write to memory

if (writeProcessMemory(heap, heap.start + offset, getBytes(int, 1234), sizeof(int)) == 0) {
    fprintf(stderr, "Failed to write to memory");
}

About

Linux MemoryModifier Tool + Lib

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published