Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace memorybot
- {
- using System.Diagnostics;
- using System.Runtime.InteropServices;
- internal class Program
- {
- [DllImport("kernel32.dll")]
- public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);
- [DllImport("kernel32.dll")]
- public static extern bool ReadProcessMemory(int hProcess, int lpBaseAddress, byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);
- const int PROCESS_WM_READ = 0x0010;
- static void Main(string[] args)
- {
- Process process = Process.GetProcessesByName("WoW")[0];
- IntPtr processHandle = OpenProcess(PROCESS_WM_READ, false, process.Id);
- int bytesRead = 0;
- byte[] buffer = new byte[12];
- //int BaseAddress = process.MainModule.BaseAddress.ToInt32();
- //PLAYER HEALTH OFFSET 0x 0FB0
- ReadProcessMemory((int)processHandle, 0x00CD87A8 + 0xFB0, buffer, buffer.Length, ref bytesRead);
- Console.WriteLine(buffer[0]);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement