Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <windows.h>
- class memoryHelper
- {
- public:
- //memory information
- template <class T>
- static T Read(DWORD address)
- {
- if (address < 0xFF)
- return (T)NULL;
- return *(T*)address;
- }
- static void* getData(DWORD address, DWORD size);
- template <class T>
- static bool Write(DWORD address, T value)
- {
- if (address < 0xFF)
- return false;
- *(T*)(address) = value;
- return true;
- }
- static bool setData(DWORD address, void* value, DWORD size);
- static bool fillData(DWORD address, DWORD value, DWORD size);
- //memory protection
- static DWORD allowOPCodeModification(DWORD address, DWORD size);
- static DWORD disallowOPCodeModification(DWORD address, DWORD size);
- static DWORD setRegionProtection(DWORD address, DWORD size, DWORD protection);
- private:
- static DWORD oldProtect;
- };
Add Comment
Please, Sign In to add comment