Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma comment(lib, "BlackBone.lib")
- #include <iostream>
- #include "Types.hpp"
- #include "Threading.cpp"
- #include "FOV.cpp"
- #include "Hack.cpp"
- using namespace std;
- Hack hack;
- vector<HANDLE> threads;
- void WaitForGameThenStart();
- void PrintDebugInfo()
- {
- cout << "Debug information: " << endl;
- cout << "hack.ClientDll: 0x" << hex << hack.ClientDll << endl;
- cout << "hack.LocalPlayerPointer: 0x" << hex << hack.LocalPlayerPointer << endl;
- cout << "hack.LocalPlayer(): 0x" << hex << hack.LocalPlayer() << endl;
- cout << "hGameWindow: " << hack.hGameWindow << endl;
- cout << "GetForegroundWindow(): " << GetForegroundWindow() << endl;
- }
- dw BunnyhopThread(void*)
- {
- while (true)
- {
- if (GetAsyncKeyState(Key::BhopJump) && hack.IsGameWindowActive() && hack.LocalPlayer())
- {
- if (hack.IsPlayerOnGround())
- {
- hack.Jump();
- }
- }
- }
- }
- dw RapidFireThread(void*)
- {
- while (true)
- {
- if (GetAsyncKeyState(Key::RapidFire) && hack.IsGameWindowActive() && hack.LocalPlayer())
- {
- hack.Attack();
- Sleep(16);
- }
- }
- }
- dw ESPThread(void*)
- {
- while (true)
- {
- if (GetAsyncKeyState(Key::RapidFire) && hack.IsGameWindowActive() && hack.LocalPlayer() && (hack.GlowEspEnable || hack.RadarEspEnable))
- {
- hack.IterateAndGlowOrSpot(Color24(0, 255, 0, 255), Color24(255, 0, 0, 255));
- }
- }
- }
- dw GameStateControlThread(void*)
- {
- while (true)
- {
- if (hack.IsGameRunning())
- {
- Sleep(1000);
- }
- else
- {
- printf("CS:GO has exited.\n");
- StopThreads(threads);
- threads.clear();
- break;
- }
- }
- }
- dw MiscellanousThread(void* pFOV)
- {
- FOV* fov = (FOV*)pFOV;
- while (true)
- {
- if (GetAsyncKeyState(Key::DebugPrint))
- {
- PrintDebugInfo();
- Sleep(200);
- }
- if (hack.IsGameWindowActive())
- {
- if (hack.LocalPlayer())
- {
- if (GetAsyncKeyState(Key::FovIncrement))
- {
- *fov++;
- Sleep(200);
- }
- if (GetAsyncKeyState(Key::FovDecrement))
- {
- *fov--;
- Sleep(200);
- }
- if (GetAsyncKeyState(Key::FovReset))
- {
- fov->Reset();
- Sleep(200);
- }
- }
- if (GetAsyncKeyState(Key::GlowEspToggle))
- {
- hack.GlowEspEnable = !hack.GlowEspEnable;
- cout << "GlowESP is now " << (hack.GlowEspEnable ? "enabled" : "disabled") << endl;
- Sleep(200);
- }
- if (GetAsyncKeyState(Key::GlowEspBloomToggle))
- {
- hack.GlowEspBloomEnable = !hack.GlowEspBloomEnable;
- cout << "GlowESP Bloom effect is now " << (hack.GlowEspBloomEnable ? "enabled" : "disabled") << endl;
- Sleep(200);
- }
- if (GetAsyncKeyState(Key::RadarEspEnable))
- {
- hack.RadarEspEnable = !hack.RadarEspEnable;
- cout << "RadarESP is now " << (hack.RadarEspEnable ? "enabled" : "disabled") << endl;
- Sleep(200);
- }
- hack.SetFlashMaxAlpha(0.0f);
- }
- }
- }
- void RunHackThreads()
- {
- hack.InitializeOffsets();
- printf("\n");
- PrintDebugInfo();
- FOV fov(10, &hack);
- printf("\nReady. NumLock MUST be turned ON to activate hack features.\n");
- auto miscThread = StartThread(MiscellanousThread, &fov);
- threads = StartThreads({ BunnyhopThread, RapidFireThread, ESPThread});
- threads.push_back(miscThread);
- HANDLE gscThread = StartThread(GameStateControlThread);
- WaitForSingleObject(gscThread, INFINITE);
- CloseHandle(gscThread);
- WaitForGameThenStart();
- }
- void WaitForGame()
- {
- while(true)
- {
- bool state = hack.IsGameRunning();
- if (!state)
- {
- Sleep(500);
- }
- else
- {
- printf("CS:GO has started.. Loading hack..\n");
- Sleep(7000);
- break;
- }
- }
- }
- void WaitForGameThenStart()
- {
- printf("Waiting for CS:GO to start..\n");
- WaitForGame();
- RunHackThreads();
- }
- int main()
- {
- if (hack.DriversLoaded())
- {
- printf("Driver check succeded.\n");
- WaitForGameThenStart();
- }
- else
- {
- printf("Driver check failed. Check if drivers are loaded.");
- Sleep(5000);
- exit(-1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement