Skip to content

MadMhmoud/MemoryManipulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧩 MemoryManipulator

📖 Overview

MemoryManipulator is a lightweight C# library that provides an intuitive API for process memory editing.
It allows you to attach to a process, resolve pointers (including multi-level ones), and perform read/write operations on integers, floats, and raw bytes.

⚠️ Disclaimer
This project is for educational and research purposes only.
Do not use it to modify software you do not own or without explicit permission.


✨ Features

  • Attach to processes by name or ID
  • Safe process attachment with error handling
  • Retrieve module base addresses
  • Pointer resolver for multi-level pointer chains
  • Read and write:
    • Integers
    • Floats
    • Raw bytes

🛠️ API Reference

Process Management

  • Attach(PID or ProcessName)
    Attaches to a process using its ID or name.

  • AttachSafe(ProcessName)
    Attaches safely by process name, preventing crashes if the process isn’t found.

Memory Utilities

  • GetModuleBaseAddress(processName, moduleName)
    Retrieves the base address of a module within the target process.

  • ResolvePointer(baseAddress, int[] offsets)
    Resolves multi-level pointers using a base address and an array of offsets.

Reading

  • ReadInt(address)int
  • ReadFloat(address)float
  • ReadBytes(address, length)byte[]

Writing

  • WriteInt(address, value)
  • WriteFloat(address, value)
  • WriteBytes(address, byte[] data)

⚙️ Example Usage

using System;

class Program
{
    static void Main()
    {
        Memory mem = new Memory();

        // Attempt to attach to Notepad safely
        if (mem.AttachSafe("myProgram"))
        {
            Console.WriteLine("✅ Attached to myProgram!");

            // Example: Read an int at some address
            IntPtr address = (IntPtr)0x12345678;
            int value = mem.ReadInt(address);
            Console.WriteLine($"Value at {address}: {value}");

            // Write a new int
            mem.WriteInt(address, 999);
            Console.WriteLine("Value updated to 999!");
        }
        else
        {
            Console.WriteLine("❌ Process not found.");
        }
    }
}

About

MemoryManipulator is a tool used for memory editing, read/write memory.

Topics

Resources

Stars

Watchers

Forks

Languages