Advertisement
vovan333

lel

Jun 12th, 2017
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma comment(lib, "BlackBone.lib")
  2. #include <iostream>
  3. #include "Types.hpp"
  4. #include "Thread.cpp"
  5. #include "FOV.cpp"
  6. #include "Hack.cpp"
  7. using namespace std;
  8.  
  9. Hack hack;
  10. vector<HANDLE> threads;
  11.  
  12. void WaitForGameThenStart();
  13.  
  14. void PrintDebugInfo()
  15. {
  16.     cout << "Debug information: " << endl;
  17.     cout << "hack.ClientDll: 0x" << hex << hack.ClientDll << endl;
  18.     cout << "hack.LocalPlayerPointer: 0x" << hex << hack.LocalPlayerPointer << endl;
  19.     cout << "hack.LocalPlayer(): 0x" << hex << hack.LocalPlayer() << endl;
  20.     cout << "hGameWindow: " << hack.hGameWindow << endl;
  21.     cout << "GetForegroundWindow(): " << GetForegroundWindow() << endl;
  22. }
  23.  
  24. dw BunnyhopThread(void*)
  25. {
  26.     while (true)
  27.     {
  28.         if (GetAsyncKeyState(Key::BhopJump) && hack.IsGameWindowActive() && hack.LocalPlayer())
  29.         {
  30.             if (hack.IsPlayerOnGround())
  31.             {
  32.                 hack.Jump();
  33.             }
  34.         }
  35.     }
  36. }
  37.  
  38. dw RapidFireThread(void*)
  39. {
  40.     while (true)
  41.     {
  42.         if (GetAsyncKeyState(Key::RapidFire) && hack.IsGameWindowActive() && hack.LocalPlayer())
  43.         {
  44.             hack.Attack();
  45.             Sleep(16);
  46.         }
  47.     }
  48. }
  49.  
  50. dw ESPThread(void*)
  51. {
  52.     while (true)
  53.     {
  54.         if (GetAsyncKeyState(Key::RapidFire) && hack.IsGameWindowActive() && hack.LocalPlayer() && (hack.GlowEspEnable || hack.RadarEspEnable))
  55.         {
  56.             hack.IterateAndGlowOrSpot(Color24(0, 255, 0, 255), Color24(255, 0, 0, 255));
  57.         }
  58.     }
  59. }
  60.  
  61. dw GameStateControlThread(void*)
  62. {
  63.     while (true)
  64.     {
  65.         if (hack.IsGameRunning())
  66.         {
  67.             Sleep(1000);
  68.         }
  69.         else
  70.         {
  71.             printf("CS:GO has exited.\n");
  72.             Thread::StopMultiple(threads);
  73.             threads.clear();
  74.             break;
  75.         }
  76.     }
  77.     return 0;
  78. }
  79.  
  80. dw MiscellanousThread(void* pFOV)
  81. {
  82.     FOV* fov = (FOV*)pFOV;
  83.     while (true)
  84.     {
  85.         if (GetAsyncKeyState(Key::DebugPrint))
  86.         {
  87.             PrintDebugInfo();
  88.             Sleep(200);
  89.         }
  90.         if (hack.IsGameWindowActive())
  91.         {
  92.             if (hack.LocalPlayer())
  93.             {
  94.                 if (GetAsyncKeyState(Key::FovIncrement))
  95.                 {
  96.                     *fov++;
  97.                     Sleep(200);
  98.                 }
  99.                 if (GetAsyncKeyState(Key::FovDecrement))
  100.                 {
  101.                     *fov--;
  102.                     Sleep(200);
  103.                 }
  104.                 if (GetAsyncKeyState(Key::FovReset))
  105.                 {
  106.                     fov->Reset();
  107.                     Sleep(200);
  108.                 }
  109.             }
  110.             if (GetAsyncKeyState(Key::GlowEspToggle))
  111.             {
  112.                 hack.GlowEspEnable = !hack.GlowEspEnable;
  113.                 cout << "GlowESP is now " << (hack.GlowEspEnable ? "enabled" : "disabled") << endl;
  114.                 Sleep(200);
  115.             }
  116.             if (GetAsyncKeyState(Key::GlowEspBloomToggle))
  117.             {
  118.                 hack.GlowEspBloomEnable = !hack.GlowEspBloomEnable;
  119.                 cout << "GlowESP Bloom effect is now " << (hack.GlowEspBloomEnable ? "enabled" : "disabled") << endl;
  120.                 Sleep(200);
  121.             }
  122.             if (GetAsyncKeyState(Key::RadarEspEnable))
  123.             {
  124.                 hack.RadarEspEnable = !hack.RadarEspEnable;
  125.                 cout << "RadarESP is now " << (hack.RadarEspEnable ? "enabled" : "disabled") << endl;
  126.                 Sleep(200);
  127.             }
  128.             hack.SetFlashMaxAlpha(0.0f);
  129.         }
  130.     }
  131. }
  132.  
  133. void RunHackThreads()
  134. {
  135.     hack.InitializeOffsets();
  136.     printf("\n");
  137.     PrintDebugInfo();
  138.     FOV fov(10, &hack);
  139.     printf("\nReady. NumLock MUST be turned ON to activate hack features.\n");
  140.    
  141.     auto miscThread = Thread::Start(MiscellanousThread, &fov);
  142.     threads = Thread::StartMultiple({ BunnyhopThread, RapidFireThread, ESPThread});
  143.     threads.push_back(miscThread);
  144.     HANDLE gscThread = Thread::Start(GameStateControlThread);
  145.     WaitForSingleObject(gscThread, INFINITE);
  146.     CloseHandle(gscThread);
  147.     WaitForGameThenStart();
  148. }
  149.  
  150. void WaitForGame()
  151. {
  152.     while(true)
  153.     {
  154.         bool state = hack.IsGameRunning();
  155.         if (!state)
  156.         {
  157.             Sleep(500);
  158.         }
  159.         else
  160.         {
  161.             printf("CS:GO has started.. Loading hack..\n");
  162.             Sleep(7000);
  163.             break;
  164.         }
  165.     }
  166. }
  167.  
  168. void WaitForGameThenStart()
  169. {
  170.     printf("Waiting for CS:GO to start..\n");
  171.     WaitForGame();
  172.     RunHackThreads();
  173. }
  174.  
  175. int main()
  176. {
  177.     if (hack.EnsureDriversReady())
  178.     {
  179.         printf("Driver check succeded.\n");
  180.         WaitForGameThenStart();
  181.     }
  182.     else
  183.     {
  184.         printf("Driver check failed. Check if drivers are loaded.");
  185.         Sleep(5000);
  186.         exit(-1);
  187.     }
  188. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement