Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ProcMem.h"
- #include <windows.h>
- #include <iostream>
- #include <TlHelp32.h>
- #include <string>
- #include <sstream>
- void Trigger();
- ProcMem Mem;
- Mem.Process("csgo.exe"); // Choosing the process // Prozessauswahl
- DWORD ClientDLL = Mem.Module("client.dll"); //Client.dll lesen/schreiben
- // Offsets definieren
- // 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! // Offsets die sich nicht ändern.
- const DWORD teamOffset = 0xF0;
- const DWORD healthOffset = 0xFC;
- const DWORD EntLoopDist = 0x10;
- DWORD LocalPlayer = Mem.Read<DWORD>(ClientDLL + 0xA68A14); // our player // ClientDLL + playerBase Offset // Muss geupdated werden
- int LocalTeam = Mem.Read<int>(LocalPlayer + 0xF0); // 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. // LocalPlayer + teamOffset // muss nicht geupdated werden
- int CrossHairID = Mem.Read<int>(LocalPlayer + 0x23F8); // our player's crosshair ID, it is used for reading what is in our crosshair // muss geupdated werden // LocalPlayer + CrosshairOffset
- int main()
- {
- while (true)
- {
- Trigger();
- // Add a Sleep() here for less cpu usage.
- }
- }
- 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()
- Sleep(25);
- 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);
- Sleep(10);
- // use Sleep() here for a 'cooldown' between shots.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement