Advertisement
Guest User

Untitled

a guest
May 4th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.19 KB | None | 0 0
  1. #include "ProcMem.h"
  2. #include <windows.h>
  3. #include <iostream>
  4. #include <TlHelp32.h>
  5. #include <string>
  6. #include <sstream>
  7.  
  8. void Trigger();
  9.  
  10. ProcMem Mem;
  11.  Mem.Process("csgo.exe"); // Choosing the process // Prozessauswahl
  12.  
  13.     DWORD ClientDLL = Mem.Module("client.dll"); //Client.dll lesen/schreiben
  14.  
  15.  
  16.     // Offsets definieren
  17.     // Needs to be updated when counter strike is updated.
  18.     const DWORD playerBase = 0xA68A14;
  19.     const DWORD entityBase = 0x4A0B0C4;
  20.     const DWORD crosshairOffset = 0x23F8;
  21.     // Does not change on updated, in other words, no need to update these!  // Offsets die sich nicht ändern.
  22.     const DWORD teamOffset = 0xF0;
  23.     const DWORD healthOffset = 0xFC;
  24.     const DWORD EntLoopDist = 0x10;
  25.  
  26.  
  27.    
  28.     DWORD LocalPlayer = Mem.Read<DWORD>(ClientDLL + 0xA68A14); // our player // ClientDLL + playerBase Offset // Muss geupdated werden
  29.     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
  30.     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
  31.  
  32.  
  33.     int main()
  34.     {
  35.         while (true)
  36.         {
  37.             Trigger();
  38.             // Add a Sleep() here for less cpu usage.
  39.         }
  40.     }
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.     void Trigger()
  49.     {
  50.         DWORD EnemyInCH = Mem.Read<DWORD>(ClientDLL + entityBase + ((CrossHairID - 1) * EntLoopDist)); // CH = Crosshair.
  51.         int EnemyHealth = Mem.Read<int>(EnemyInCH + healthOffset); // Enemy in crosshair's
  52.         int EnemyTeam = Mem.Read<int>(EnemyInCH + teamOffset); // Enemy in crosshair's team, we need this to compare it to our own player's team)
  53.         if (LocalTeam != EnemyTeam && EnemyHealth > 0)
  54.         {
  55.             // Here you can add a delay before shooting, to make it look legit. This is done using Sleep()
  56.             Sleep(25);
  57.             mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
  58.             // use Sleep() here for shooting several shots with an ak for example. Not usable with pisto
  59.             mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
  60.             Sleep(10);
  61.             // use Sleep() here for a 'cooldown' between shots.
  62.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement