Guest User

Untitled

a guest
Nov 16th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #pragma once
  2. #include <windows.h>
  3.  
  4. class memoryHelper
  5. {
  6. public:
  7.     //memory information
  8.     template <class T>
  9.     static T Read(DWORD address)
  10.     {
  11.         if (address < 0xFF)
  12.             return (T)NULL;
  13.         return *(T*)address;
  14.     }
  15.     static void* getData(DWORD address, DWORD size);
  16.  
  17.     template <class T>
  18.     static bool Write(DWORD address, T value)
  19.     {
  20.         if (address < 0xFF)
  21.             return false;
  22.         *(T*)(address) = value;
  23.         return true;
  24.     }
  25.     static bool setData(DWORD address, void* value, DWORD size);
  26.     static bool fillData(DWORD address, DWORD value, DWORD size);
  27.  
  28.     //memory protection
  29.     static DWORD allowOPCodeModification(DWORD address, DWORD size);
  30.     static DWORD disallowOPCodeModification(DWORD address, DWORD size);
  31.     static DWORD setRegionProtection(DWORD address, DWORD size, DWORD protection);
  32. private:
  33.     static DWORD oldProtect;
  34.  
  35. };
Add Comment
Please, Sign In to add comment