Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. int ReadPointer(DWORD address, HANDLE handle, int offsets[], BOOL usebase)
  2. {
  3.     auto base = reinterpret_cast<int>(GetModuleHandleA("alefclient.exe"));
  4.     auto size = sizeof(offsets) / sizeof(*offsets);
  5.     unsigned long bytesread = 0;
  6.  
  7.     BYTE buffer[4] = { 0x00, 0x00, 0x00, 0x00};
  8.  
  9.     if (usebase)
  10.         address += base;
  11.  
  12.     ReadProcessMemory(handle, reinterpret_cast<LPCVOID>(address), &buffer, 4, 0);
  13.  
  14.     for (unsigned int i = 0; i < size; i++)
  15.     {
  16.         address = reinterpret_cast<int>(&buffer);
  17.         ReadProcessMemory(handle, reinterpret_cast<LPCVOID>(address + offsets[i]), &buffer, 4, &bytesread);
  18.     }
  19.  
  20.     return reinterpret_cast<int>(buffer);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement