Начинающий
-
Автор темы
- #1
Код:
#include "stdafx.h"
#include <windows.h>
#include <string.h>
#include <Tlhelp32.h>
#include <iostream>
int main()
{
using namespace std;
DWORD address = 0x0AE4;//ping игрока
int value = 8;
DWORD pid;
HWND hwnd;
hwnd = FindWindow(NULL,L"Counter-Strike: Global Offensive");
if (!hwnd) {
cout << "window not found";
cin.get();
}
GetWindowThreadProcessId(hwnd,&pid);
HANDLE phandle = OpenProcess(PROCESS_VM_READ,0,pid);
if (!phandle) {
cout << "Couldnt get handle";
cin.get();
}
while (TRUE) {
ReadProcessMemory(phandle,(void*)address,&value,sizeof(value),0);
cout << value << "\n";
Sleep(1000);
}
}