Happy99

.h

Feb 28th, 2020
184
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma once
  2. #include <iostream>
  3. #include <Windows.h>
  4. #include <cmath>
  5. #include <string>
  6. #include <TlHelp32.h>
  7. #include <stdint.h>
  8.  
  9. class Memory {
  10. public:
  11.     static DWORD hPID;
  12.     static BOOL bPOn, bIOn, bProt;
  13.     static HANDLE hProc;
  14.  
  15.     /*FindPattern*/
  16.     static bool DataCompare(const BYTE* pData, const BYTE* pMask, const char* pszMask);
  17.     static DWORD FindPattern(DWORD start, DWORD size, const char* sig, const char* mask);
  18.     static DWORD FindPatternArr(DWORD start, DWORD size, const char* mask, int count, ...);
  19.  
  20.  
  21.     /*Process/Module/Read/Write*/
  22.     static bool Process(char* ProcessName);
  23.     static DWORD Module(LPSTR ModuleName, DWORD&);
  24.  
  25.     template <class cData>
  26.     static cData Read(DWORD dwAddress)
  27.     {
  28.         cData cRead;
  29.         ReadProcessMemory(hProc, (LPVOID)dwAddress, &cRead, sizeof(cData), NULL);
  30.         return cRead;
  31.     }
  32.  
  33.     template <class T>
  34.     static void Write(DWORD addr, T val) {
  35.         WriteProcessMemory(hProc, (LPVOID)addr, &val, sizeof(T), NULL);
  36.     }
  37.  
  38. };
RAW Paste Data