Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ProcMem.h" // Memory reading
- using namespace std;
- int main()
- {
- // Variables
- int PlayerBase;
- int CrosshairOffset;
- int EntityBase;
- ProcMem Mem; // Shortcut
- Mem.Process("csgo.exe"); // Choosing the process
- DWORD ClientDLL = Mem.Module("client.dll"); //Module we are reading memory from
- // Needs to be updated when counter strike is updated.
- const DWORD playerBase = 0xA68A14;
- const DWORD entityBase = 0x4A0B0C4;
- const DWORD crosshairOffset = 0x23F8;
- // Does not change on updated, in other words, no need to update these!
- const DWORD teamOffset = 0xF0;
- const DWORD healthOffset = 0xFC;
- const DWORD EntLoopDist = 0x10;
- // our player
- DWORD LocalPlayer = Mem.Read<DWORD>(ClientDLL + PlayerBase);
- // our player's team, so we can compare it to the player in our crosshair and shoot if its not our own player's team.
- int LocalTeam = Mem.Read<int>(LocalPlayer + teamOffset);
- // our player's crosshair ID, it is used for reading what is in our crosshair
- int CrossHairID = Mem.Read<int>(LocalPlayer + CrosshairOffset);
- void Trigger();
- {
- DWORD EnemyInCH = Mem.Read<DWORD>(ClientDLL + EntityBase + ((CrossHairID - 1) * EntLoopDist)); // CH = Crosshair.
- int EnemyHealth = Mem.Read<int>(EnemyInCH + healthOffset); // Enemy in crosshair's
- int EnemyTeam = Mem.Read<int>(EnemyInCH + teamOffset); // Enemy in crosshair's team, we need this to compare it to our own player's team)
- if (LocalTeam != EnemyTeam && EnemyHealth > 0)
- {
- // Here you can add a delay before shooting, to make it look legit. This is done using Sleep()
- mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
- // use Sleep() here for shooting several shots with an ak for example. Not usable with pisto
- mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
- // use Sleep() here for a 'cooldown' between shots.
- }
- if (LocalTeam != EnemyTeam)
- {
- // shoot
- }
- if (EnemyHealth > 0)
- {
- // shoot
- }
- if (LocalTeam != EnemyTeam && EnemyHealth > 0)
- {
- // Shoot
- }
- }
- {
- while(true)
- {
- Trigger();
- Sleep(10000); // Add a Sleep() here for less cpu usage.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement