SHOW:
|
|
- or go back to the newest paste.
| 1 | #pragma once | |
| 2 | #include <Windows.h> //DWORD, HANDLE | |
| 3 | #include <TlHelp32.h> //CreateToolhelp32Snapshot | |
| 4 | #include <tchar.h> //_tcscmp | |
| 5 | #include <Psapi.h> //GetModuleInformation | |
| 6 | #include <vector> | |
| 7 | ||
| 8 | using namespace std; | |
| 9 | ||
| 10 | class Helper | |
| 11 | {
| |
| 12 | public: | |
| 13 | Helper(); | |
| 14 | Helper(DWORD pID); | |
| 15 | ~Helper(); | |
| 16 | uintptr_t GetModuleBaseAddress(TCHAR* lpszModuleName); | |
| 17 | uintptr_t GetDynamicAddress(uintptr_t baseAddress, vector<DWORD> offsets); | |
| 18 | uintptr_t GetAddressFromSignature(vector<int> signature); | |
| 19 | void SetpID(DWORD pID); | |
| 20 | void SetpBaseAddress(char moduleName[]); | |
| 21 | DWORD GetpID(); | |
| 22 | HANDLE GetprocessHandle(); | |
| 23 | ||
| 24 | private: | |
| 25 | DWORD pID; | |
| 26 | DWORD pBaseAddress; //Base Address of exe | |
| 27 | DWORD pSize; //Size of exe module | |
| 28 | HANDLE processHandle; | |
| 29 | }; |