Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //need - Dll source code ---> need an injector
- #include <MATH.H>
- #define PI 3.141592654
- typedef struct{
- DWORD dwHeath;
- float fPosX;
- float fPosY;
- float fPosZ;
- float PlayerDistance;
- int Team;
- char *PlayerName;
- }PlayerData;
- class eAimbot
- {
- public:
- bool GetPlayerData();
- void AimToPlayer(int PlayerNumber);
- float GetDistance(int PlayerID);
- void DoAimbot();
- PlayerData cPlayer[32];
- PlayerData mPlayer;
- private:
- bool IsAim;
- int PlayerAimed;
- int NumberOfBot;
- };
- bool eAimbot::GetPlayerData()
- {
- DWORD BaseAddress = (DWORD)GetModuleHandleA(NULL);
- if (*(DWORD*)(BaseAddress+0x110D90) == 0)// If it's not bot mode then return false
- return false;
- NumberOfBot = *(BYTE*)(BaseAddress+0x10F500);
- mPlayer.dwHeath = *(DWORD*)(*(DWORD*)(BaseAddress + 0x109B74) + 0xF8);
- mPlayer.fPosY = *(float*)(*(DWORD*)(BaseAddress + 0x109B74) + 0x34);
- mPlayer.fPosX = *(float*)(*(DWORD*)(BaseAddress + 0x109B74) + 0x38);
- mPlayer.fPosZ = *(float*)(*(DWORD*)(BaseAddress + 0x109B74) + 0x3C);
- mPlayer.PlayerDistance = 0;
- for (int i=0;i<NumberOfBot-1;i++)
- {
- cPlayer[i+1].dwHeath = *(DWORD*)(*(DWORD*)(*(DWORD*)(BaseAddress+0x110D90) + i*4) + 0xF8);// Get Heath
- cPlayer[i+1].fPosY = *(float*)(*(DWORD*)(*(DWORD*)(BaseAddress+0x110D90) + i*4) + 0x34);// Get YPos
- cPlayer[i+1].fPosX = *(float*)(*(DWORD*)(*(DWORD*)(BaseAddress+0x110D90) + i*4) + 0x38);// Get XPos
- cPlayer[i+1].fPosZ = *(float*)(*(DWORD*)(*(DWORD*)(BaseAddress+0x110D90) + i*4) + 0x3C);// Get ZPos
- cPlayer[i+1].PlayerDistance = GetDistance(i+1);
- }
- return true;
- }
- float eAimbot::GetDistance(int PlayerID)
- {
- float pDistance;
- float dX,dY,dZ;
- dX = cPlayer[PlayerID].fPosX-mPlayer.fPosX;
- dY = cPlayer[PlayerID].fPosY-mPlayer.fPosY;
- dZ = cPlayer[PlayerID].fPosZ-mPlayer.fPosZ;
- pDistance = sqrt(dX*dX + dY*dY + dZ*dZ); //Calculate Distance in 3d world
- return pDistance;
- }
- void eAimbot::AimToPlayer(int PlayerNumber)
- {
- float MouseX, MouseY, dX, dY, dZ;
- dX = cPlayer[PlayerNumber].fPosX - mPlayer.fPosX;
- dY = cPlayer[PlayerNumber].fPosY - mPlayer.fPosY;
- dZ = cPlayer[PlayerNumber].fPosZ - mPlayer.fPosZ;
- if (dX>0 && dY>0)//Calculate MouseX
- MouseX = atanf(dY/dX)*180/PI;
- else if (dX>0 && dY<0)
- MouseX = 360 + atanf(dY/dX)*180/PI;
- else if (dX<0 && dY>0)
- MouseX = 180 + atanf(dY/dX)*180/PI;
- else if (dX<0 && dY<0)
- MouseX = 180 + atanf(dY/dX)*180/PI;
- MouseY = asinf(dZ/cPlayer[PlayerNumber].PlayerDistance)*180/PI;//Calculate MouseY
- DWORD BaseAddress = (DWORD)GetModuleHandleA(NULL);
- *(float*)(*(DWORD*)(BaseAddress + 0x109B74) + 0x40) = 180 - MouseX;
- *(float*)(*(DWORD*)(BaseAddress + 0x109B74) + 0x44) = MouseY;
- }
- void eAimbot::DoAimbot()
- {
- if (GetAsyncKeyState(VK_RBUTTON))
- {
- if (GetPlayerData() == TRUE)
- {
- if (IsAim == false || (cPlayer[PlayerAimed].dwHeath <= 0 || cPlayer[PlayerAimed].dwHeath > 100))
- {
- NewAim:
- int Nearest = 1;// First Nearest player is '1' B-)
- for (int i=1;i<NumberOfBot;i++)
- {
- if (cPlayer[Nearest].PlayerDistance == 0 || cPlayer[Nearest].PlayerDistance > cPlayer[i].PlayerDistance)
- if (cPlayer[i].dwHeath > 0 && cPlayer[i].dwHeath <= 100)// Is Player alive???
- Nearest = i;
- }
- PlayerAimed = Nearest;
- AimToPlayer(Nearest);
- IsAim = true;
- }
- else
- AimToPlayer(PlayerAimed);
- }
- }
- else
- IsAim = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment