Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Windows.h>
- #include <iostream>
- #include "HackProcess.h"
- #include <math.h>
- #include <vector>
- #include <algorithm>
- CHackProcess fProcess;
- using namespace std;
- const DWORD Player_Base = 0x10222AC;
- #define F6_KEY 0x75
- bool b_ShotNow = false;
- const DWORD dw_attack = 0x104EC08;
- const DWORD dw_teamOffset = 0xAC;
- const DWORD dw_pos = 0x360;
- const DWORD dw_angRotation = 0x4629AC;
- int i_shoot = 5;
- int i_DontShoot = 4;
- const DWORD dw_health = 0xA4;
- int NumOfPlayers = 32;
- const DWORD dw_PlayerCount = 0x5CF0DC;
- const DWORD dw_crosshairOffs = 0x1754;
- const DWORD dw_entityBase = 0x102F924;
- const DWORD dw_EntityLoopDistance = 0x10;
- struct TargetList_t{
- float Distance;
- float AimbotAngle[3];
- TargetList_t(){
- }
- TargetList_t(float aimbotAngle[], float myCoords[], float enemyCoords[]){
- AimbotAngle[0] = aimbotAngle[0];
- AimbotAngle[1] = aimbotAngle[1];
- AimbotAngle[2] = aimbotAngle[2];
- }
- };
- struct MyPlayer{
- DWORD CLocalPlayer;
- int Team;
- int CrosshairEntityID;
- float Position[3];
- void ReadInformation(){
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &CLocalPlayer, sizeof(DWORD), 0);
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_teamOffset), &Team, sizeof(int), 0);
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_crosshairOffs), &CrosshairEntityID, sizeof(int), 0);
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_pos), &Position, sizeof(float[3]), 0);
- }
- }MyPlayer;
- struct PlayerList{
- DWORD CBaseEntity;
- int Team;
- float Position[3];
- float AimbotAngle[3];
- void ReadInformation(int Player){
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_entityBase + (Player*dw_EntityLoopDistance )), &CBaseEntity, sizeof(DWORD), 0);
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + dw_teamOffset), &Team, sizeof(int), 0);
- ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + dw_pos), &Position, sizeof(float[3]), 0);
- Position[2] = Position[2]-20;
- }
- }PlayerList[32];
- void CalcAngle(float *src, float *dst, float *angles){
- double delta[3] = {(src[0]-dst[0]),(src[1]-dst[1]),(src[2]-dst[2])};
- double hyp = sqrt(delta[0]*delta[0] + delta[1]*delta[1]);
- angles[0] = (float) ((asinf(delta[2]/hyp) * 57.295779513082f));
- angles[1] = (float) ((atanf(delta[1]/delta[0]) * 57.295779513082f));
- angles[2] = 0;
- if(delta[0] >= 0.0){
- angles[1] += 180.0f;
- }
- }
- void Aimbot(int target){
- TargetList_t * TargetList = new TargetList_t[32];
- PlayerList[target].ReadInformation(target);
- CalcAngle(MyPlayer.Position, PlayerList[target].Position, PlayerList[target].AimbotAngle);
- TargetList[0] = TargetList_t(PlayerList[target].AimbotAngle, MyPlayer.Position, PlayerList[target].Position);
- WriteProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine + dw_angRotation), TargetList[0].AimbotAngle, 12, 0);
- delete TargetList;
- }
- void TriggerBot(){
- if(!b_ShotNow){
- WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_attack), &i_DontShoot, sizeof(int), NULL);
- b_ShotNow = !b_ShotNow;
- }
- if(MyPlayer.CrosshairEntityID == 0){
- return;
- }
- if(PlayerList[MyPlayer.CrosshairEntityID-1].Team == MyPlayer.Team)
- return;
- if(MyPlayer.CrosshairEntityID > 32)
- return;
- if(b_ShotNow){
- Aimbot(MyPlayer.CrosshairEntityID-1);
- WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_attack), &i_shoot, sizeof(int), NULL);
- b_ShotNow = !b_ShotNow;
- }
- }
- int main(){
- fProcess.RunProcess();
- std::cout << "Game Found! Triggerboat Activated" << std::endl;
- while(!GetAsyncKeyState(F6_KEY)){
- try
- {
- MyPlayer.ReadInformation();
- for(int c = 0; c < 32; c++){
- PlayerList[c].ReadInformation(c);
- }
- TriggerBot();
- }
- catch (int e)
- {
- cout << "Error: " << e << '\n';
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement