SHARE
TWEET

Read Write Memory tutorial

a guest Dec 12th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Diagnostics;
  7. using System.Threading;
  8.  
  9.  
  10. namespace Trainer
  11. {
  12.     class Program
  13.     {
  14.         static void Main(string[] args)
  15.         {
  16.             Process[] processes = Process.GetProcessesByName("ac_client");
  17.             if (processes.Length > 0)
  18.             {
  19.                 IntPtr BaseAddress = IntPtr.Zero;
  20.                 Process MyProc = processes[0];
  21.  
  22.                 foreach (ProcessModule module in MyProc.Modules)
  23.                 {
  24.                     if (module.ModuleName.Contains("ac_client"))
  25.                     {
  26.                         BaseAddress = module.BaseAddress;
  27.                     }
  28.                 }
  29.  
  30.                 if (BaseAddress != IntPtr.Zero)
  31.                 {
  32.                     VAMemory memory = new VAMemory("ac_client");
  33.                     int finalAdress = memory.ReadInt32((IntPtr)BaseAddress + 0x109B74);
  34.                     int health = memory.ReadInt32((IntPtr)finalAdress + 0xF8);
  35.                     Console.WriteLine("Current health: " + health.ToString());
  36.  
  37.                     while (true)
  38.                     {
  39.                         int NewHealth = 177;
  40.                         memory.WriteInt32((IntPtr)finalAdress + 0xF8, NewHealth);
  41.                         Console.WriteLine("New Health: " + NewHealth.ToString());
  42.                         Thread.Sleep(1000);
  43.                     }
  44.                 }
  45.             }
  46.  
  47.         }
  48.          
  49.     }
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top