emS-St1ks

CS Source AimBot by St1ks

Oct 7th, 2014
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.85 KB | None | 0 0
  1. //need - Dll source code ---> need an injector
  2. #include <MATH.H>
  3.  
  4. #define PI 3.141592654
  5.  
  6. typedef struct{
  7.     DWORD   dwHeath;
  8.     float   fPosX;
  9.     float   fPosY;
  10.     float   fPosZ;
  11.     float   PlayerDistance;
  12.     int     Team;
  13.     char    *PlayerName;
  14. }PlayerData;
  15.  
  16. class eAimbot
  17. {
  18. public:
  19.     bool        GetPlayerData();
  20.     void        AimToPlayer(int PlayerNumber);
  21.     float       GetDistance(int PlayerID);
  22.     void        DoAimbot();
  23.     PlayerData  cPlayer[32];
  24.     PlayerData  mPlayer;
  25. private:
  26.     bool        IsAim;
  27.     int         PlayerAimed;
  28.     int         NumberOfBot;
  29. };
  30.  
  31. bool    eAimbot::GetPlayerData()
  32. {
  33.     DWORD BaseAddress = (DWORD)GetModuleHandleA(NULL);
  34.     if (*(DWORD*)(BaseAddress+0x110D90) == 0)// If it's not bot mode then return false
  35.         return false;
  36.     NumberOfBot = *(BYTE*)(BaseAddress+0x10F500);
  37.      
  38.  
  39.     mPlayer.dwHeath = *(DWORD*)(*(DWORD*)(BaseAddress + 0x109B74) + 0xF8);
  40.     mPlayer.fPosY = *(float*)(*(DWORD*)(BaseAddress + 0x109B74) + 0x34);
  41.     mPlayer.fPosX = *(float*)(*(DWORD*)(BaseAddress + 0x109B74) + 0x38);
  42.     mPlayer.fPosZ = *(float*)(*(DWORD*)(BaseAddress + 0x109B74) + 0x3C);
  43.     mPlayer.PlayerDistance = 0;
  44.  
  45.     for (int i=0;i<NumberOfBot-1;i++)
  46.     {
  47.         cPlayer[i+1].dwHeath = *(DWORD*)(*(DWORD*)(*(DWORD*)(BaseAddress+0x110D90) + i*4) + 0xF8);// Get Heath
  48.         cPlayer[i+1].fPosY = *(float*)(*(DWORD*)(*(DWORD*)(BaseAddress+0x110D90) + i*4) + 0x34);// Get YPos
  49.         cPlayer[i+1].fPosX = *(float*)(*(DWORD*)(*(DWORD*)(BaseAddress+0x110D90) + i*4) + 0x38);// Get XPos
  50.         cPlayer[i+1].fPosZ = *(float*)(*(DWORD*)(*(DWORD*)(BaseAddress+0x110D90) + i*4) + 0x3C);// Get ZPos
  51.         cPlayer[i+1].PlayerDistance = GetDistance(i+1);
  52.     }
  53.     return true;
  54. }
  55.  
  56. float   eAimbot::GetDistance(int PlayerID)
  57. {
  58.     float   pDistance;
  59.     float   dX,dY,dZ;
  60.     dX = cPlayer[PlayerID].fPosX-mPlayer.fPosX;
  61.     dY = cPlayer[PlayerID].fPosY-mPlayer.fPosY;
  62.     dZ = cPlayer[PlayerID].fPosZ-mPlayer.fPosZ;
  63.     pDistance = sqrt(dX*dX + dY*dY + dZ*dZ);            //Calculate Distance in 3d world
  64.     return  pDistance;
  65. }
  66.  
  67. void    eAimbot::AimToPlayer(int PlayerNumber)
  68. {
  69.     float   MouseX, MouseY, dX, dY, dZ;
  70.     dX = cPlayer[PlayerNumber].fPosX - mPlayer.fPosX;
  71.     dY = cPlayer[PlayerNumber].fPosY - mPlayer.fPosY;
  72.     dZ = cPlayer[PlayerNumber].fPosZ - mPlayer.fPosZ;
  73.  
  74.     if (dX>0 && dY>0)//Calculate MouseX
  75.         MouseX = atanf(dY/dX)*180/PI;
  76.     else if (dX>0 && dY<0)
  77.         MouseX = 360 + atanf(dY/dX)*180/PI;
  78.     else if (dX<0 && dY>0)
  79.         MouseX = 180 + atanf(dY/dX)*180/PI;
  80.     else if (dX<0 && dY<0)
  81.         MouseX = 180 + atanf(dY/dX)*180/PI;
  82.  
  83.  
  84.     MouseY = asinf(dZ/cPlayer[PlayerNumber].PlayerDistance)*180/PI;//Calculate MouseY
  85.     DWORD BaseAddress = (DWORD)GetModuleHandleA(NULL);
  86.     *(float*)(*(DWORD*)(BaseAddress + 0x109B74) + 0x40) = 180 - MouseX;
  87.     *(float*)(*(DWORD*)(BaseAddress + 0x109B74) + 0x44) = MouseY;
  88. }
  89.  
  90. void    eAimbot::DoAimbot()
  91. {
  92.     if (GetAsyncKeyState(VK_RBUTTON))
  93.     {
  94.         if (GetPlayerData() == TRUE)
  95.         {
  96.             if (IsAim == false || (cPlayer[PlayerAimed].dwHeath <= 0 || cPlayer[PlayerAimed].dwHeath > 100))
  97.             {
  98. NewAim:
  99.                 int Nearest = 1;// First Nearest player is '1' B-)
  100.                 for (int i=1;i<NumberOfBot;i++)
  101.                 {
  102.                     if (cPlayer[Nearest].PlayerDistance == 0 || cPlayer[Nearest].PlayerDistance > cPlayer[i].PlayerDistance)
  103.                         if (cPlayer[i].dwHeath > 0 && cPlayer[i].dwHeath <= 100)// Is Player alive???
  104.                             Nearest = i;
  105.                 }
  106.                 PlayerAimed = Nearest;
  107.                 AimToPlayer(Nearest);
  108.                 IsAim = true;
  109.             }
  110.             else
  111.                 AimToPlayer(PlayerAimed);
  112.         }
  113.     }
  114.     else
  115.         IsAim = false;
  116. }
Advertisement
Add Comment
Please, Sign In to add comment