SHARE
TWEET

wtf

a guest Feb 27th, 2020 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include <vector>
  4. #include <TlHelp32.h>
  5. #include <tchar.h>
  6. #include <stdint.h>
  7. #include <stdio.h>
  8. #include "ConsoleApplication3.h"
  9.  
  10.  
  11. using namespace std;
  12.  
  13. union ulf
  14. {
  15.     unsigned long ul;
  16.     float f;
  17. };
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.     DWORD dwGetModuleBaseAddress(TCHAR *lpszModuleName, DWORD pID) {
  27.     DWORD dwModuleBaseAddress = 0;
  28.     HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, pID);
  29.     MODULEENTRY32 ModuleEntry32 = { 0 };
  30.     ModuleEntry32.dwSize = sizeof(MODULEENTRY32);
  31.  
  32.    
  33.         if (Module32First(hSnapshot, &ModuleEntry32))
  34.         {
  35.             do {
  36.                 if (_tcscmp(ModuleEntry32.szModule, lpszModuleName) == 0)
  37.                 {
  38.                     dwModuleBaseAddress = (DWORD)ModuleEntry32.modBaseAddr;
  39.                     break;
  40.                 }
  41.             } while (Module32Next(hSnapshot, &ModuleEntry32));
  42.  
  43.  
  44.         }
  45.         CloseHandle(hSnapshot);
  46.         return dwModuleBaseAddress;
  47.        
  48.        
  49.     }
  50.  
  51.  
  52.  
  53.  
  54.  
  55.     int main() {
  56.  
  57.        
  58.  
  59.  
  60.         DWORD pID;
  61.         DWORD off1, off2, off3, off4, off5, off6, off7;
  62.         DWORD mp1, mp2, mp3, mp4, mp5, mp6, mp7;
  63.         DWORD baseAddress;
  64.         DWORD healthAddy;
  65.  
  66.         HWND hGameWindow;
  67.         HANDLE pHandle;
  68.  
  69.        
  70.             int currentHealth;
  71.             char moduleName[] = "zdkrc.exe";
  72.  
  73.  
  74.  
  75.  
  76.             //Get Handles
  77.             hGameWindow = FindWindow(NULL, "Dekaron");
  78.             GetWindowThreadProcessId(hGameWindow, &pID);
  79.             pHandle = OpenProcess(PROCESS_VM_READ, FALSE, pID);
  80.  
  81.             //Get Client Base Addy
  82.             DWORD clientBase = dwGetModuleBaseAddress(_T(moduleName), pID);
  83.             ReadProcessMemory(pHandle, (LPCVOID)(clientBase + 0x0087BC34), &baseAddress, sizeof(baseAddress), NULL);
  84.  
  85.  
  86.  
  87.             //Health
  88.             ReadProcessMemory(pHandle, (LPCVOID)(baseAddress + 0x4), &off1, sizeof(off1), NULL);
  89.  
  90.             ReadProcessMemory(pHandle, (LPCVOID)(off1 + 0x4C), &off2, sizeof(off2), NULL);
  91.  
  92.             ReadProcessMemory(pHandle, (LPCVOID)(off2 + 0x34), &off3, sizeof(off3), NULL);
  93.  
  94.             ReadProcessMemory(pHandle, (LPCVOID)(off3 + 0x88), &off4, sizeof(off4), NULL);
  95.  
  96.             ReadProcessMemory(pHandle, (LPCVOID)(off4 + 0x4), &off5, sizeof(off5), NULL);
  97.  
  98.             ReadProcessMemory(pHandle, (LPCVOID)(off5 + 0x50), &off6, sizeof(off6), NULL);
  99.  
  100.             ReadProcessMemory(pHandle, (LPCVOID)(off6 + 0x1C), &off7, sizeof(off7), NULL);
  101.             cout << "HP Count HEX: " << std::hex << off7 << std::endl;
  102.  
  103.             //Mana
  104.             ReadProcessMemory(pHandle, (LPCVOID)(baseAddress + 0x4), &mp1, sizeof(mp1), NULL);
  105.  
  106.             ReadProcessMemory(pHandle, (LPCVOID)(mp1 + 0xD8), &mp2, sizeof(mp2), NULL);
  107.  
  108.             ReadProcessMemory(pHandle, (LPCVOID)(mp2 + 0x4), &mp3, sizeof(mp3), NULL);
  109.  
  110.             ReadProcessMemory(pHandle, (LPCVOID)(mp3 + 0xD4), &mp4, sizeof(mp4), NULL);
  111.  
  112.             ReadProcessMemory(pHandle, (LPCVOID)(mp4 + 0x38), &mp5, sizeof(mp5), NULL);
  113.  
  114.             ReadProcessMemory(pHandle, (LPCVOID)(mp5 + 0x50), &mp6, sizeof(mp6), NULL);
  115.  
  116.             ReadProcessMemory(pHandle, (LPCVOID)(off6 + 0x20), &mp7, sizeof(mp7), NULL);
  117.             cout << "MP Count HEX: " << std::hex << mp7 << std::endl;
  118.  
  119.             //HP Float
  120.             unsigned long valuehp = off7;
  121.             float floatHP = *reinterpret_cast<float*>(&valuehp);
  122.             std::cout << "HP FLOAT = " << floatHP << "\n";
  123.  
  124.             //MP Float
  125.             unsigned long valuemp = mp7;
  126.             float floatMP = *reinterpret_cast<float*>(&valuemp);
  127.             std::cout << "MP FLOAT = " << floatMP << "\n";
  128.            
  129.    
  130.             cin.get();
  131.            
  132.        
  133.  
  134.     }
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