Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void FindPID()
- {
- if (!Okno)
- exit(1);
- else
- GetWindowThreadProcessId(Okno, &ProcessID);
- }
- DWORD FindBaseAddress(LPSTR NameModule)
- {
- HANDLE AllModuleProcess = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, ProcessID);
- if (!AllModuleProcess)
- return NULL;
- Entry.dwSize = sizeof(MODULEENTRY32);
- BOOL bWhile = Module32First(AllModuleProcess, &Entry);
- while (bWhile)
- {
- if (!strcmp(Entry.szModule, NameModule))
- {
- CloseHandle(AllModuleProcess);
- return (DWORD)Entry.modBaseAddr;
- }
- bWhile = Module32Next(AllModuleProcess, &Entry);
- }
- CloseHandle(AllModuleProcess);
- return NULL;
- }
- void OneStart()
- {
- FindPID();
- if (ProcessID == NULL)
- exit(1);
- ProcesGry = OpenProcess(PROCESS_ALL_ACCESS, false, ProcessID);
- if (!ProcesGry)
- exit(1);
- ClientGry = (DWORD)FindBaseAddress("client.dll");
- if (ClientGry == NULL)
- exit(1);
- EngineGry = (DWORD)FindBaseAddress("engine.dll");
- if (EngineGry == NULL)
- exit(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment