Hey! I am in trouble with an external cheat... So this is a simple RCS and BHOP hack. I am gonna post almost the full code cuz i rly cant understand whats wrong...
So first i tell you my problem : If i launch the cheat its say : Press ur BHOP key. i press it -> Key found. then its say OPEN CSGO in every 5 sec. But when i open csgo its start acting like a retard and stop spamming OPEN CSGO but still at the window where its say: bhop key key pressed csgo etc... when i join a match and press my activate key (NUM 3 and 5) its say : Not in game... like when my offset wrong but its all correct.. almost all... there are some plus useless offsets but they are there because i want to upgrade the cheat in the future
Code:
#include <iostream>
#include <Windows.h>
#include <string>
#include <TlHelp32.h>
#include <Thread>
#include <stdlib.h>
#include <vector>
#include <math.h>
#define spacebar VK_SPACE
#define pressed 0x8000
#define leftmouse VK_LBUTTON
#define alt VK_MENU
#define keyA 0x41
#define keyD 0x44
#define Num1 VK_NUMPAD1
#define Num2 VK_NUMPAD2
#define Num3 VK_NUMPAD3
#define Num4 VK_NUMPAD4
#define Num5 VK_NUMPAD5
#define Num6 VK_NUMPAD6
#define Num7 VK_NUMPAD7
#define Num8 VK_NUMPAD8
#define Num9 VK_NUMPAD9
#define MAXFOV 2
// OFFSETS \\
#define EntityListOff 0x4A8C804
#define localplayer 0xAAFFFC
#define glowobject 0x4FA97F8 //GlowObjectManager
#define clientstate 0x5A3334
#define AttackingOff 0x2ECEBD0 //dwForceAttack
#define spotted 0x939
#define FlashedOff 0xA304
#define CrosshairIDOffset 0xAA70
#define ViewAnglesOff 0x4D0C
#define VecPunchOff 0x301C
#define ShotsFiredOff 0xA2C0
#define BoneMatrixOff 0x2698
#define NoHandsOff 0x38F3
#define ForceUpdateOff 0x16C
// OFFSETS \\
using namespace std;
int BhopBind;
bool bBhop = true;
bool bRCS = true;
int IsIngame;
struct Vector {
float x, y, z;
};
struct VectorYX {
float x, y;
};
int KeyPressed() {
while (true) {
for (int i = 1; i < 255; i++) {
if (GetAsyncKeyState(i) & pressed) {
Sleep(250);
return i;
}
}
Sleep(10);
}
}
DWORD GetModuleBaseExtern(const DWORD dwProcessId, const char *szModuleName)
{
HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessId);
if (!hSnap) return 0;
MODULEENTRY32 me;
me.dwSize = sizeof(MODULEENTRY32);
DWORD dwReturn = 0;
if (Module32First(hSnap, &me)) {
while (Module32Next(hSnap, &me)) {
if (lstrcmpi(me.szModule, szModuleName) == 0) {
dwReturn = (DWORD)me.modBaseAddr;
break;
}
}
}
CloseHandle(hSnap);
return dwReturn;
}
void Bhop(HANDLE hProcess, HWND hWnd, DWORD clientdll) {
DWORD playerbase;
ReadProcessMemory(hProcess, (LPCVOID)(clientdll + localplayer), &playerbase, sizeof(playerbase), NULL);
if (playerbase == NULL) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
return;
}
int flags;
ReadProcessMemory(hProcess, (LPCVOID)(playerbase + 0x100), &flags, sizeof(flags), NULL);
if (flags & 0x1 == 1) {
SendMessage(hWnd, WM_KEYDOWN, spacebar, 0x390000);
Sleep(40);
SendMessage(hWnd, WM_KEYUP, spacebar, 0x390000);
Sleep(40);
}
}
void RCS(HANDLE hProcess, DWORD clientdll, DWORD enginedll) {
Vector OldVecPunch;
while (true) {
if (!bRCS || IsIngame != 6) {
std::this_thread::sleep_for(std::chrono::milliseconds(5));
continue;
}
else {
DWORD playerbase;
int shotsfired;
ReadProcessMemory(hProcess, (LPCVOID)(clientdll + localplayer), &playerbase, sizeof(playerbase), NULL);
if (playerbase == NULL) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue;
}
DWORD enginebase;
ReadProcessMemory(hProcess, (LPCVOID)(enginedll + clientstate), &enginebase, sizeof(enginebase), NULL);
Vector VecPunch;
ReadProcessMemory(hProcess, (LPCVOID)(playerbase + VecPunchOff), &VecPunch, sizeof(VecPunch), NULL);
VecPunch.x *= 2.0f;
VecPunch.y *= 2.0f;
VecPunch.z *= 2.0f;
int Attacking;
ReadProcessMemory(hProcess, (LPCVOID)(clientdll + AttackingOff), &Attacking, sizeof(Attacking), NULL);
if (Attacking == 5) {
Vector CurrentAngles;
ReadProcessMemory(hProcess, (LPCVOID)(enginebase + ViewAnglesOff), &CurrentAngles, sizeof(CurrentAngles), NULL);
Vector modify = VecPunch;
modify.x -= OldVecPunch.x;
modify.y -= OldVecPunch.y;
CurrentAngles.x -= modify.x;
CurrentAngles.y -= modify.y;
WriteProcessMemory(hProcess, (LPVOID)(enginebase + ViewAnglesOff), &CurrentAngles, sizeof(CurrentAngles), NULL);
}
OldVecPunch = VecPunch;
}
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}
void text() {
system("CLS");
cout << "Test";
if (IsIngame == 6) {
cout << "(Num2)" << endl;
cout << "Bhop ";
if (!bBhop) {
cout << "(Off)";
}
else if (bBhop) {
cout << "(On)";
}
cout << "RCS";
if (!bRCS) {
cout << "(Off)";
}
else if (bRCS) {
cout << "(On)";
}
cout << "(Num5)" << endl;
}
else {
cout << "\t Not In-Game" << endl;
}
}
void keys(HANDLE hProcess, DWORD clientdll, DWORD enginedll) {
while (true) {
if (GetAsyncKeyState(Num3) & pressed) {
bBhop = !bBhop;
text();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
else if (GetAsyncKeyState(Num5) & pressed) {
bRCS = !bRCS;
text();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}
}
void InGame(HANDLE hProcess, DWORD enginedll) {
while (true) {
DWORD Enginebase;
int x;
x = IsIngame;
ReadProcessMemory(hProcess, (LPCVOID)(enginedll + clientstate), &Enginebase, sizeof(Enginebase), NULL);
if (Enginebase == NULL) {
std::this_thread::sleep_for(std::chrono::milliseconds(1));
continue;
}
ReadProcessMemory(hProcess, (LPCVOID)(Enginebase + 0x100), &IsIngame, sizeof(IsIngame), NULL);
if (x != IsIngame) {
text();
}
std::this_thread::sleep_for(std::chrono::milliseconds(5000));
}
}
int main() {
cout << "Press key for Bhop: " << endl;
BhopBind = KeyPressed();
cout << "Key Found" << endl;
Sleep(500);
HWND hWnd;
hWnd = FindWindow(0, "Counter-Strike: Global Offensive");
DWORD pID;
while (!hWnd)
{
cout << "Open CS:GO";
Sleep(5000);
hWnd = FindWindow(0, "Counter-Strike: Global Offensive");
}
GetWindowThreadProcessId(hWnd, &pID);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
if (!hProcess)
{
cout << "Can't open process";
}
DWORD clientdll = GetModuleBaseExtern(pID, "client.dll");
DWORD enginedll = GetModuleBaseExtern(pID, "engine.dll");
thread THKeys(keys, std::ref(hProcess), std::ref(clientdll), std::ref(enginedll));
thread THInGame(InGame, std::ref(hProcess), std::ref(enginedll));
thread THRCS(RCS, std::ref(hProcess), std::ref(clientdll), std::ref(enginedll));
while (true) {
Sleep(100000);
}
}