(c++) (external) How to I connect a pointer and an offset
Hello yall,
I am having trouble binding the pointer and the offset in c++
The game I am trying to hack is Assault Cube
What am I doing wrong???
Regards,
I am having trouble binding the pointer and the offset in c++
The game I am trying to hack is Assault Cube
What am I doing wrong???
Code:
// MemoryEditing.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include<iostream>
#include<Windows.h>
#include<string>
using namespace std;
int main()
{
DWORD localplayer = 0x00509b74;
DWORD health = 0xF8;
SetConsoleTitle(_T("AssaultCube Exploit"));
//int readTest = 0;
HWND hwnd = FindWindowA(NULL, "AssaultCube");
if (hwnd == NULL)
{
cout << "Cannot find Window." << endl;
Sleep(3000);
exit(-1);
}
else
{
DWORD procID;
GetWindowThreadProcessId(hwnd, &procID);
HANDLE handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, procID);
if (procID = NULL)
{
cout << "Cannot find Process." << endl;
Sleep(3000);
exit(-1);
}
else
{
int CurrentAdress = 0;
ReadProcessMemory(handle, (PBYTE)(localplayer) + health, &CurrentAdress, sizeof(CurrentAdress), 0);
//cout << "The view value was set to ";
cout << CurrentAdress << endl;
system("pause");
cout << CurrentAdress << endl;
}
}
return 0;
}

