Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ProcMem.h"
- #include <iostream>
- #include <Windows.h>
- ProcMem Mem;
- DWORD ClientDLL;
- //dynamic
- const DWORD playerBase = 0x00A323E4;
- const DWORD entityBase = 0x04A4FCA4;
- //static
- const DWORD dw_m_fFlags = 0x100;
- const DWORD crosshairOffset = 0xAA44;
- const DWORD teamOffset = 0xF0;
- const DWORD healthOffset = 0xFC;
- const DWORD EntLoopDist = 0x10;
- DWORD LocalPlayer;
- int LocalTeam;
- int CrossHairID;
- DWORD EnemyInCH;
- int EnemyHealth;
- int EnemyTeam;
- int m_fFlags;
- bool triggerEnabled = false;
- void ShowOptions()
- {
- std::cout << std::boolalpha;//makes it print true/false instead of 1/0
- std::cout << "Trigger = " << triggerEnabled << std::endl;
- }
- void Toggle()
- {
- if (GetAsyncKeyState(VK_F2))
- {
- triggerEnabled = !triggerEnabled;
- Sleep(100);
- system("cls");//clears console for the options, won't refresh if we wont do this
- ShowOptions();
- }
- }
- void Trigger()
- {
- LocalPlayer = Mem.Read<DWORD>(ClientDLL + playerBase);
- LocalTeam = Mem.Read<int>(LocalPlayer + teamOffset);
- CrossHairID = Mem.Read<int>(LocalPlayer + crosshairOffset);
- EnemyInCH = Mem.Read<DWORD>(ClientDLL + entityBase + ((CrossHairID - 1) * EntLoopDist));
- EnemyHealth = Mem.Read<int>(EnemyInCH + healthOffset);
- EnemyTeam = Mem.Read<int>(EnemyInCH + teamOffset);
- if (LocalTeam != EnemyTeam && EnemyHealth > 0 && triggerEnabled)
- {
- //You can add sleep here for a delay
- mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
- mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
- }
- }
- void Bhop()
- {
- #define BunnyKey9 0x39
- #define BunnyKey9_sc 0x0A
- m_fFlags = Mem.Read<int>(LocalPlayer + dw_m_fFlags);
- if (GetAsyncKeyState(VK_SPACE) & 0x8000 && m_fFlags == 257)
- {
- std::cout << "poop" << std::endl;
- keybd_event(BunnyKey9, BunnyKey9_sc, 0, 0);
- Sleep(100);
- keybd_event(BunnyKey9, BunnyKey9_sc, KEYEVENTF_KEYUP, 0);
- }
- }
- int main()
- {
- Mem.Process("csgo.exe");
- ClientDLL = Mem.Module("client.dll");
- ShowOptions();
- while (true)
- {
- Bhop();
- Toggle();
- Trigger();
- Sleep(1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement