Results 1 to 3 of 3
  1. #1
    Grooguz
    Grooguz is offline
    BanHammer Holder
    Grooguz's Avatar
    Join Date
    2010 May
    Posts
    678
    Thanks
    152
    Thanked 537 Times in 167 Posts
    Rep Power
    10

    Memory editing application with Source code

    I have never really seen any proper instructions or tutorials on making your own memory editing applications. So I searched the corners of the Internet to gain the knowledge necessary to create this source code. Now you, too, can make epic hacks.

    Please note that intermediate C# programming skills are required to properly use this class. If you are a script kiddie, you should get off this video right now.


    using System;
    using System.Text;
    using System.Collections.Generic;
    using System.Data;
    using System.Linq;
    using System.Diagnostics;
    using System.Runtime.InteropServices;

    namespace Memedit
    {

    public class MemoryEditor
    {

    [DllImport("kernel32.dll")]
    static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, UIntPtr nSize, out IntPtr lpNumberOfBytesWritten);

    [DllImport("Kernel32.dll")]
    static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, UInt32 nSize, ref UInt32 lpNumberOfBytesRead);
    string pname = "";
    IntPtr hand;
    public MemoryEditor(string ProcName)
    {
    pname = ProcName.Replace(".exe", "");
    Process[] proclist = Process.GetProcesses();
    foreach (Process pr in proclist)
    {

    if (pr.ToString() == "System.Diagnostics.Process (" + pname + ")")
    {
    hand = pr.Handle;
    }
    }
    }

    public bool Write(int Address, byte[] data)
    {
    bool success = false;
    Process[] proclist = Process.GetProcesses();
    IntPtr bytesout;
    success = WriteProcessMemory(hand, (IntPtr)Address, data, (UIntPtr)data.Length, out bytesout);
    return success;
    }

    public byte[] Read(int Address, int length)
    {
    byte[] ret = new byte[length];
    uint o = 0;
    ReadProcessMemory(hand, (IntPtr)Address, ret, (UInt32)ret.Length, ref o);
    return ret;
    }
    public int ReadInt32(int Address)
    {
    return BitConverter.ToInt32(Read(Address, 4), 0);
    }
    public float ReadSingle(int Address)
    {
    return BitConverter.ToSingle(Read(Address, 4), 0);
    }
    public string ReadString(int Address, int length, bool isUnicode)
    {
    if (isUnicode)
    {
    UnicodeEncoding enc = new UnicodeEncoding();
    return enc.GetString(Read(Address, length));
    }
    else
    {
    ASCIIEncoding enc = new ASCIIEncoding();
    return enc.GetString(Read(Address, length));
    }
    }
    }
    }

    by BerkinGG

  2. The Following 2 Users Say Thank You to Grooguz For This Useful Post:


  3. #2
    programmer
    programmer is offline
    Guest
    Join Date
    2012 Jan
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    I am having a problem I have pointers and the offsets how can I write to the memory with this? plz pm or skype me my skype is d0100110101001101 Thank you.

    Thank you,
    programmer

  4. #3
    emoisback
    emoisback is offline
    Full member
    Join Date
    2011 Dec
    Location
    Indonesia there i'm
    Posts
    508
    Thanks
    83
    Thanked 244 Times in 68 Posts
    Rep Power
    8
    Just look at Grooguz Code....

    [DllImport("kernel32.dll")]
    static extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, UIntPtr nSize, out IntPtr lpNumberOfBytesWritten);

    [DllImport("Kernel32.dll")]
    static extern bool ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, byte[] lpBuffer, UInt32 nSize, ref UInt32 lpNumberOfBytesRead);

    That is a Windows API to write and read from memory of process...
    if you want to write it, just call the function WriteProcessMemory then give a parameter..
    Learn from PGC for Share on PGC..


    For another Stuff i have make try to find it [Please, register to view links]
    If i have help you, please thanks and respect ..

Similar Threads

  1. [C++] How to make a memory hacking application
    By Grooguz in forum Programming Tutorials
    Replies: 2
    Last Post: 2014-03-25, 06:02 PM
  2. [AutoIt] RegEx Offset Finder Source code
    By Grooguz in forum AutoIt
    Replies: 1
    Last Post: 2012-08-04, 03:50 PM
  3. [C#] Offset Finder with FindPattern Source Code
    By Grooguz in forum VB, .NET Framework
    Replies: 2
    Last Post: 2012-06-22, 04:58 AM
  4. [C++] Basic Game Hacking (Memory Editing)
    By Dwar in forum Programming Tutorials
    Replies: 0
    Last Post: 2010-11-29, 04:12 PM
  5. Question about tracing source code to memory
    By Bloapie in forum General Game Research
    Replies: 1
    Last Post: 2010-10-19, 09:41 AM
Visitors found this page by searching for:

C# Memory Editing

c# memory editor

memory editing c#

c# memory hacking

memory editor source code

c# memory edit

memory editor source

c# memory hack

c# net memory editor

c# memory hacker source codememory editing c WRITE VIDEO MEMORY C SHARPmemory game c# codememory editor c#how to edit memory in c#C# memoryeditormemory game in c# source codecode for memory game in c#memory editor dll c memory editoredit memory c#memory game c# source codec# memory hacking tutorialc# memory editor source c# memory editor source code

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •