Advertisement
Guest User

Untitled

a guest
May 31st, 2023
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. namespace memorybot
  2. {
  3. using System.Diagnostics;
  4. using System.Runtime.InteropServices;
  5.  
  6. internal class Program
  7. {
  8. [DllImport("kernel32.dll")]
  9. public static extern IntPtr OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);
  10.  
  11. [DllImport("kernel32.dll")]
  12. public static extern bool ReadProcessMemory(int hProcess, int lpBaseAddress, byte[] lpBuffer, int dwSize, ref int lpNumberOfBytesRead);
  13. const int PROCESS_WM_READ = 0x0010;
  14. static void Main(string[] args)
  15. {
  16. Process process = Process.GetProcessesByName("WoW")[0];
  17. IntPtr processHandle = OpenProcess(PROCESS_WM_READ, false, process.Id);
  18. int bytesRead = 0;
  19. byte[] buffer = new byte[12];
  20. //int BaseAddress = process.MainModule.BaseAddress.ToInt32();
  21. //PLAYER HEALTH OFFSET 0x 0FB0
  22. ReadProcessMemory((int)processHandle, 0x00CD87A8 + 0xFB0, buffer, buffer.Length, ref bytesRead);
  23.  
  24. Console.WriteLine(buffer[0]);
  25.  
  26. Console.ReadLine();
  27. }
  28. }
  29.  
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement