[CODIGO FUENTE] Assault Cube Aimbot Codigo Fuente - Externo

  • Hola Invitado, hemos creado un grupo de telegram para GamerzHacking Latino, para mas informacion ingresa al siguiente enlace AQUI


220
Me Gusta
77
Temas

c0de

MOV EAX, EDX
Registrado
19 Abr 2020
Temas
77
Mensajes
166
Ubicación
Localhost
Mejores respuestas
0
1606978307510.png


C++:
#define Q_PI ( 3.1415927f )
#define QDegToRad(A) ( A * 180.0f / Q_PI )
#define QACUBE(A) ( A / Q_PI * 180.0f + 180.0f )

struct Vec3Pos
{
float x, y, z;
};

struct Vec3Angle
{
float yaw, pitch, roll;
};

//may want to replace this with Get3DDistance, but SDK says it's ok like this
float distxy(Vec3Pos src, Vec3Pos dst)
{
    float dx = dst.x - src.x;
    float dy = dst.y - src.y;
    return sqrtf(dx*dx + dy*dy);
}

Vec3Angle CalcAngle(Vec3Pos src, Vec3Pos dst)
{
Vec3Angle angles;

angles.yaw = QACUBE((-(float)atan2(dst.x - src.x, dst.y - src.y)));
angles.pitch = QDegToRad((atan2(dst.z - src.z, distxy(src, dst))));
angles.roll = 0.0f;

return angles;
}

float Get3dDistance(Vec3Pos to, Vec3Pos from)
{
return (float)
(sqrt(
((to.x - from.x) * (to.x - from.x)) +
((to.y - from.y) * (to.y - from.y)) +
((to.z - from.z) * (to.z - from.z))
));
}

float DifferenceOfAngles(Vec3Angle vAngleToEnemy, Vec3Angle vLocalPlayerViewAngle)
{
    Vec3Angle vdifference;

    vdifference.pitch = vLocalPlayerViewAngle.pitch - vAngleToEnemy.pitch;
    vdifference.yaw = vLocalPlayerViewAngle.yaw - vAngleToEnemy.yaw;
    //vdifference.roll = 0;

    //normalize by making them positive values if they are negative
    if (vdifference.pitch < 0)
    {
        vdifference.pitch *= -1;
    }
    if (vdifference.yaw < 0)
    {
        vdifference.yaw *= -1;
    }

    //add them together and divide by 2, gives an average of the 2 angles
    float fDifference = (vdifference.pitch + vdifference.yaw) / 2;
    return fDifference;
}


//Credits GuidedHacking.com
#include <Windows.h>
#include <iostream>
#include <string>
#include <ctime>
#include <tlhelp32.h>
#include <tchar.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include "AimbotMath.h"
using namespace std;
#define WeaponSemiAuto (t_WeaponNum == 1 || t_WeaponNum == 2 || t_WeaponNum == 3 || t_WeaponNum == 5 || t_WeaponNum == 7 || t_WeaponNum == 0 || t_WeaponNum == 8)

//Globals ooooh scary!!
DWORD dwProcId = NULL;
HANDLE hProcHandle = NULL;

class TrainerDisplay
{
public:
    string sGameStatus = "Game Not Found";
    string sAimbotStatus = "OFF";
    string sNoRecoilStatus = "OFF";
    string sAimModeStatus = "Angle";
    void SetWindow()
    {
        SetConsoleTitleA("AnomanderRake's AssaultCube Aimbot v1.3");
        system("mode 53, 30");
    }
    void Print()
    {
        system("cls");
        cout << "----------------------------------------------------\n"
            << "----------------------------------------------------\n\n"
            << "                 GuidedHacking.com                  \n"
            << "     AnomanderRake's Assault Cube Aimbot v1.3       \n\n"
            << "----------------------------------------------------\n"
            << "----------------------------------------------------\n\n"
            << "              NumPad1 to Start Aimbot               \n"
            << "   Aimbot will activate when you pull the trigger   \n\n"
            << "----------------------------------------------------\n"
            << "----------------------------------------------------\n\n"
            << "GAME STATUS:           " << Display.sGameStatus << "   \n\n"
            << "[NUMPAD1] Aimbot             -> " << sAimbotStatus << " <-\n\n"
            << "[NUMPAD4] Aimbot Mode        -> " << sAimModeStatus << " <-\n\n"
            << "[NUMPAD9] No Recoil          -> " << sNoRecoilStatus << " <-\n\n"
            << "[INSERT] Exit\n\n"
            << "----------------------------------------------------\n"
            << "----------------------------------------------------\n";
    }

    void Print(string *StatusType, LPCSTR Status)
    {
        if (*StatusType != Status)
        {
            *StatusType = Status;
            Print();
        }
    }


}Display;

class HackClass
{
public:
    HWND gameWindow = NULL;
    int KeyPressTimer = 0;
    int UpdateAddressesTimer = 0;
    bool bUpdatedOnce = false;
    bool bGetProcessDataCurrent = false;
    UINT_PTR ac_clientModule = 0;
    UINT_PTR botClassAddr = 0;
    UINT_PTR localPlayerAddr = 0;
    UINT_PTR playerArrayPointer = 0x510D90;
    UINT_PTR playerArrayAddress = 0;


    bool FindProcess()
    {
        gameWindow = NULL;
        gameWindow = FindWindowA(NULL, "AssaultCube");
        while (!gameWindow)
        {
            Display.Print(&Display.sGameStatus, "Game Not Found");

            if (bGetProcessDataCurrent == true)
            {
                bGetProcessDataCurrent = false;
            }
            Sleep(300);
            gameWindow = FindWindowA(NULL, "AssaultCube");
        }

        if (gameWindow)
        {
            return true;
        }
    }

    void GetProcess()
    {
        if (FindProcess())
        {
            if (bGetProcessDataCurrent == false)
            {
                if (hProcHandle)
                {
                    CloseHandle(hProcHandle);
                }

                GetWindowThreadProcessId(gameWindow, &dwProcId);
                if (dwProcId)
                {
                    hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcId);
                    if (hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL)
                    {
                        Display.Print(&Display.sGameStatus, "Game Not Found");
                    }
                    else
                    {
                        Display.Print(&Display.sGameStatus, "Game Found");
                        bGetProcessDataCurrent = true;
                    }
                }
                else
                {
                    Display.Print(&Display.sGameStatus, "Game Not Found");
                }
            }
        }
    }

    DWORD_PTR dwGetModuleBaseAddress(DWORD dwProcID, TCHAR *szModuleName)
    {
        DWORD_PTR dwModuleBaseAddress = 0;
        HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, dwProcID);
        if (hSnapshot != INVALID_HANDLE_VALUE)
        {
            MODULEENTRY32 ModuleEntry32;
            ModuleEntry32.dwSize = sizeof(MODULEENTRY32);
            if (Module32First(hSnapshot, &ModuleEntry32))
            {
                do
                {
                    if (_tcsicmp(ModuleEntry32.szModule, szModuleName) == 0)
                    {
                        dwModuleBaseAddress = (DWORD_PTR)ModuleEntry32.modBaseAddr;
                        break;
                    }
                } while (Module32Next(hSnapshot, &ModuleEntry32));
            }
            CloseHandle(hSnapshot);
        }
        return dwModuleBaseAddress;
    }

    DWORD CalculatePointer(HANDLE hProcHandle, int PointerLevel, DWORD Offsets[], UINT_PTR BaseAddress)
    {
        DWORD Pointer = BaseAddress;
        DWORD TempBuffer;

        DWORD PointerAddress;
        for (int i = 0; i < PointerLevel; i++)
        {
            if (i == 0)
            {
                ReadProcessMemory(hProcHandle, (LPCVOID)Pointer, &TempBuffer, 4, NULL);
            }

            PointerAddress = TempBuffer + Offsets[i];
            ReadProcessMemory(hProcHandle, (LPCVOID)PointerAddress, &TempBuffer, 4, NULL);
        }
        return PointerAddress;
    }

    void UpdateAddresses()
    {
        if (!bUpdatedOnce || UpdateAddressesTimer > 5000)
        {
            ac_clientModule = dwGetModuleBaseAddress(dwProcId, _T("ac_client.exe"));
            ReadProcessMemory(hProcHandle, (LPCVOID)0x509B74, &localPlayerAddr, 4, NULL);
            ReadProcessMemory(hProcHandle, (LPCVOID)playerArrayPointer, &playerArrayAddress, 4, NULL);
            botClassAddr = ac_clientModule + 0xe4ac0;
            UpdateAddressesTimer = clock();
            Hack.bUpdatedOnce = true;
        }
    }

}Hack;

class CurrentGameData
{
public:
    int GameMode;
    int NumOfPlayers = 0;
    bool bTeamGame = false;

    void UpdateCurrentGameData()
    {
        ReadProcessMemory(hProcHandle, (LPCVOID)(Hack.ac_clientModule + 0x10F500), &NumOfPlayers, 4, NULL);

        if (NumOfPlayers != 0)
        {
            ReadProcessMemory(hProcHandle, (LPCVOID)(0x50F49C), &GameMode, 1, NULL);
            int m_teamMode[11] = { 0, 4, 5, 7, 13, 11, 14, 17, 16, 20, 21 };
            for each(int i in m_teamMode)
            {
                if (i == GameMode)
                {
                    bTeamGame = true;
                }
                else
                {
                    bTeamGame = false;
                }
            }
        }
    }

}GameData;

class playerClass
{
public:
    UINT_PTR PlayerAddress;
    char Name[16];
    BYTE Team;
    int Health;
    BYTE State;
    Vec3Pos vLocation;
    Vec3Angle vCurrentAngle;
    Vec3Angle vAimbotAngles;
    float Distance;
    float fCrosshairToTargetAngle;
    bool bWeaponSemiAuto = 0;

    //default constructor for local player
    playerClass()
    {
        PlayerAddress = Hack.localPlayerAddr;
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x225), &Name, 16, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x32c), &Team, 1, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0xF8), &Health, 4, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x34), &vLocation, 12, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x338), &State, 1, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x40), &vCurrentAngle, 12, NULL);//

        int t_WeaponNum;
        DWORD tmpOffsets[2] = { 0x374, 0x4 };
        ReadProcessMemory(hProcHandle, (LPCVOID)(Hack.CalculatePointer(hProcHandle, 2, tmpOffsets, 0x509B74)), &t_WeaponNum, 4, NULL);

        if (WeaponSemiAuto)
        {
            bWeaponSemiAuto = true;
        }
        else
        {
            bWeaponSemiAuto = false;
        }

    }

    //Constructor for other players
    playerClass(DWORD playerAddr)
    {
        PlayerAddress = playerAddr;
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x225), &Name, 16, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x32c), &Team, 1, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0xF8), &Health, 4, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x34), &vLocation, 12, NULL);
        ReadProcessMemory(hProcHandle, (LPCVOID)(PlayerAddress + 0x338), &State, 1, NULL);
    }

}localPlayer;

vector<playerClass> playerVector;
bool playerSorter(playerClass &lhs, playerClass &rhs);

class Aimbot
{
public:
    bool bAimbotStatus = false;
    bool bNoRecoilStatus = false;
    DWORD playerAddr[31];
    bool bSortByAngle = true;

    void sortPlayerVector()
    {
        for (auto&& player : playerVector)
        {

            player.vAimbotAngles = CalcAngle(localPlayer.vLocation, player.vLocation);

            if (bSortByAngle)
            {
                player.fCrosshairToTargetAngle = DifferenceOfAngles(player.vAimbotAngles, localPlayer.vCurrentAngle);
            }
            else
            {
                player.Distance = Get3dDistance(player.vLocation, localPlayer.vLocation);
            }
        }

        sort(playerVector.begin(), playerVector.end(), playerSorter);
    }

    void aim()
    {
        //automatic weapon functionality
        if (localPlayer.bWeaponSemiAuto == false)
        {
            WriteProcessMemory(hProcHandle, (PBYTE*)(localPlayer.PlayerAddress + 0x40), &playerVector[0].vAimbotAngles, 8, NULL);
        }

        //semi auto weapons aim first, then shoot
        else
        {
            WriteProcessMemory(hProcHandle, (PBYTE*)(localPlayer.PlayerAddress + 0x40), &playerVector[0].vAimbotAngles, 8, NULL);
            //sets bFiring true
            WriteProcessMemory(hProcHandle, (PBYTE*)(localPlayer.PlayerAddress + 0x224), "x01", 1, NULL);
        }
    }

    void ReadHotKeys()
    {
        while (GetAsyncKeyState(VK_LBUTTON) && aBot.bAimbotStatus)
        {
            aBot.aim();
            readPlayerData();
            sortPlayerVector();
        }

        if (clock() - Hack.KeyPressTimer > 200)
        {

            if (GetAsyncKeyState(VK_NUMPAD1))
            {
                Hack.KeyPressTimer = clock();
                aBot.bAimbotStatus = !aBot.bAimbotStatus;
                if (aBot.bAimbotStatus)
                {
                    Display.Print(&Display.sAimbotStatus, "ON");
                }
                else
                {
                    Display.Print(&Display.sAimbotStatus, "OFF");
                }
            }

            if (GetAsyncKeyState(VK_NUMPAD4))
            {
                Hack.KeyPressTimer = clock();
                aBot.bSortByAngle = !aBot.bSortByAngle;
                if (aBot.bSortByAngle)
                {
                    Display.Print(&Display.sAimModeStatus, "Angle");
                }
                else
                {
                    Display.Print(&Display.sAimModeStatus, "Distance");
                }
            }

            if (GetAsyncKeyState(VK_NUMPAD9))
            {
                Hack.KeyPressTimer = clock();
                aBot.bNoRecoilStatus = !aBot.bNoRecoilStatus;
                if (aBot.bNoRecoilStatus)
                {
                    WriteProcessMemory(hProcHandle, (LPVOID)(0x463786), "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90", 10, NULL);
                    Display.Print(&Display.sNoRecoilStatus, "ON");
                }

                else
                {
                    WriteProcessMemory(hProcHandle, (LPVOID)(0x463786), "\x50\x8D\x4C\x24\x1C\x51\x8B\xCE\xFF\xD2", 10, NULL);
                    Display.Print(&Display.sNoRecoilStatus, "OFF");
                }
            }
        }
    }

    void readPlayerData()
    {
        localPlayer = playerClass();
        playerVector.clear();
        ReadProcessMemory(hProcHandle, (LPCVOID)Hack.playerArrayAddress, &playerAddr, 124, NULL);
        for each(DWORD player in playerAddr)
        {
            DWORD tmp;
            if (ReadProcessMemory(hProcHandle, (LPCVOID)player, &tmp, 4, NULL) == TRUE)
            {
                if (tmp == Hack.botClassAddr)
                {
                    playerVector.push_back(playerClass(player));
                }
            }
        }
    }
}aBot;

bool playerSorter(playerClass &lhs, playerClass &rhs)
{
    //if not alive, move to end
    if (lhs.State != 0)
        return false;

    else
    {
        if (GameData.bTeamGame)
        {
            //if lhs is not on my team, but rhs is on my team then sort out rhs
            if (lhs.Team != localPlayer.Team && rhs.Team == localPlayer.Team)
            {
                return true;
            }

            //if lhs is on my team, but rhs is not sort out lhs
            if (lhs.Team == localPlayer.Team && rhs.Team != localPlayer.Team)
            {
                return false;
            }

            else
            {
                if (aBot.bSortByAngle)
                {
                    return lhs.fCrosshairToTargetAngle < rhs.fCrosshairToTargetAngle;
                }
                else
                {
                    return lhs.Distance < rhs.Distance;
                }
            }

        }

        else //for death match games
        {
            if (aBot.bSortByAngle)
            {
                return lhs.fCrosshairToTargetAngle < rhs.fCrosshairToTargetAngle;
            }
            else
            {
                return lhs.Distance < rhs.Distance;
            }
        }
    }
}

Clave del ZIP: guidedhacking.com

Creditos
Rake
 

Adjuntos

  • ACAimbotv15.zip
    23,3 KB · Visitas: 5