bRuCeBrUcE

Active member
Joined
Jun 6, 2020
Messages
26
Reaction score
1
Location
Macedonia
Hello! If anyone says that this is outdated, I swear, I took my grenade launcher and I'm going to you !!!
P.S. There is still no source for the external aimbot for SA:MP in the Internet, lol.

Dont forget this :

C++:
#include <math.h>
#include <Windows.h>
#include <iostream>

Lets do it.

Memory.h

C++:
pragma once
#include <Windows.h>
#include <TlHelp32.h>
#include <iostream>
#include "Discord.h"
#pragma comment(lib, "User32.lib")

DWORD GetProcId(const wchar_t* procName)
{
    {
        DWORD procId = 0;
        HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
        if (hSnap != INVALID_HANDLE_VALUE)
        {
            PROCESSENTRY32 procEntry;
            procEntry.dwSize = sizeof(procEntry);

            if (Process32First(hSnap, &procEntry))
            {
                do
                {
                    if (!wcscmp(procEntry.szExeFile, procName))
                    {
                        procId = procEntry.th32ProcessID;
                        break;
                    }
                } while (Process32Next(hSnap, &procEntry));

            }
        }
        CloseHandle(hSnap);
        return procId;
    }
}

uintptr_t GetModuleBaseAddress(DWORD procId, const wchar_t* modName)
{
    {
        uintptr_t modBaseAddr = 0;
        HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId);
        if (hSnap != INVALID_HANDLE_VALUE)
        {
            MODULEENTRY32 modEntry;
            modEntry.dwSize = sizeof(modEntry);
            if (Module32First(hSnap, &modEntry))
            {
                do
                {
                    if (!wcscmp(modEntry.szModule, modName))
                    {
                        modBaseAddr = (uintptr_t)modEntry.modBaseAddr;
                        break;
                    }
                } while (Module32Next(hSnap, &modEntry));
            }
        }
        CloseHandle(hSnap);
        return modBaseAddr;
    }
}

uintptr_t moduleBase = GetModuleBaseAddress(GetProcId(L"gta_sa.exe"), L"samp.dll");
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, NULL, GetProcId(L"gta_sa.exe"));

template<typename T> T RPM(SIZE_T address)
{
    //The buffer for data that is going to be read from memory
    T buffer;

    //The actual RPM
    ReadProcessMemory(hProcess, (LPCVOID)address, &buffer, sizeof(T), NULL);

    //Return our buffer
    return buffer;
}

Simple aimbot

C++:
ReadProcessMemory(hProcess, (LPCVOID)0xB6F5F0, &gpoint, 4, 0);

        if ((gpoint > 0) && (t == 0))
        {
            t = 1;
        }
        if (gpoint > 0)
        {
            pmtrx1 = gpoint + 0x14;
            ReadProcessMemory(hProcess, (LPCVOID)pmtrx1, &pmtrx1, 4, 0);
            xpos1 = pmtrx1 + 0x30;
            ypos1 = pmtrx1 + 0x34;
            ReadProcessMemory(hProcess, (LPCVOID)xpos1, &fxpos1, 4, 0);
            ReadProcessMemory(hProcess, (LPCVOID)ypos1, &fypos1, 4, 0);
            ReadProcessMemory(hProcess, (LPCVOID)0xB6F9CC, &fcxpos, 4, 0);
            ReadProcessMemory(hProcess, (LPCVOID)0xB6F9D0, &fcypos, 4, 0);
            ReadProcessMemory(hProcess, (LPCVOID)0xB6F3B8, &ptarget, 4, 0);
            pped = ptarget + 0x79C;
            ReadProcessMemory(hProcess, (LPCVOID)pped, &pped, 4, 0);

            if (pped > 0)
            {
                pvectorx = pped + 0x44;
                pvectory = pped + 0x48;
                ReadProcessMemory(hProcess, (LPCVOID)pvectorx, &fpvectorx, 4, 0);
                ReadProcessMemory(hProcess, (LPCVOID)pvectory, &fpvectory, 4, 0);
                pmtrx2 = pped + 0x14;
                ReadProcessMemory(hProcess, (LPCVOID)pmtrx2, &pmtrx2, 4, 0);
                xpos2 = pmtrx2 + 0x30;
                ypos2 = pmtrx2 + 0x34;
                ReadProcessMemory(hProcess, (LPCVOID)xpos2, &fxpos2, 4, 0);
                ReadProcessMemory(hProcess, (LPCVOID)ypos2, &fypos2, 4, 0);
                php = pped + 0x540;
                ReadProcessMemory(hProcess, (LPCVOID)php, &fphp, 4, 0);
                if (fphp > 0)
                {
                    fxpos2a = fxpos2;
                    fypos2a = fypos2;
                    aa = fabs(fcxpos - fxpos2);
                    ab = fabs(fcypos - fypos2);
                    ac = sqrt(aa*aa + ab * ab);
                    alpha = asin(aa / ac);
                    beta = acos(aa / ac);
                    if ((fxpos1 > fxpos2) && (fypos1 < fypos2))
                    {
                        beta = -beta;
                    }
                    if ((fxpos1 > fxpos2) && (fypos1 > fypos2))
                    {
                        beta = beta;
                    }
                    if ((fxpos1 < fxpos2) && (fypos1 > fypos2))
                    {
                        beta = (alpha + (3.14 / 2));
                    }
                    if ((fxpos1 < fxpos2) && (fypos1 < fypos2))
                    {
                        beta = (-alpha - (3.14 / 2));
                    }
                    camxpos = beta + 0.0389;
                    ReadProcessMemory(hProcess, (LPCVOID)0xB7347A, &keyt, 4, 0);
                    if (keyt > 0) // AIM KEY - Left mouse button, if you wanna to make it work on the right mouse button, just delete this string
                    {
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL);
                    }
                }
            }
        }

Normal aimbot, how is it different from a simple one? Here, the aimbot is configured for each weapon, making it more accurate.
C++:
        float fcxpos;
        float fcypos;
        float camxpos;
        float camypos;
        float fpvectorx;
        float fpvectory;
        float fxpos1;
        float fypos1;
        float fzpos1;
        float fxpos2;
        float fypos2;
        float fzpos2;
        float fxpos2a;
        float fypos2a;
        float fzpos2a;
        float fphp;
        float aa;
        float ab;
        float ac;
        float beta;
        float alpha;
        int t;
        int wID;
        int keyt;
        t = 0;

        DWORD php;
        DWORD xpos1;
        DWORD ypos1;
        DWORD zpos1;
        DWORD xpos2;
        DWORD ypos2;
        DWORD zpos2;
        DWORD pmtrx1;
        DWORD pmtrx2;
        DWORD pvectorx;
        DWORD pvectory;
        DWORD gpoint;
        DWORD ptarget;
        DWORD pped;
        DWORD pId;
        ReadProcessMemory(hProcess, (LPCVOID)0xBAA410, &wID, sizeof(int), 0);
        ReadProcessMemory(hProcess, (LPCVOID)0xB6F5F0, &gpoint, 4, 0);



        if (gpoint > 0)
        {
            pmtrx1 = gpoint + 0x14; // location pointer of player XYZ
            ReadProcessMemory(hProcess, (LPCVOID)pmtrx1, &pmtrx1, 4, 0);

            xpos1 = pmtrx1 + 0x30; // x position of player
            ypos1 = pmtrx1 + 0x34; // y position of player
            zpos1 = pmtrx1 + 0x38; // z position of player

            ReadProcessMemory(hProcess, (LPCVOID)xpos1, &fxpos1, 4, 0);
            ReadProcessMemory(hProcess, (LPCVOID)ypos1, &fypos1, 4, 0);
            ReadProcessMemory(hProcess, (LPCVOID)zpos1, &fzpos1, 4, 0);

            ReadProcessMemory(hProcess, (LPCVOID)0xB6F9CC, &fcxpos, 4, 0); // not really sure
            ReadProcessMemory(hProcess, (LPCVOID)0xB6F9D0, &fcypos, 4, 0); // not really sure

            ReadProcessMemory(hProcess, (LPCVOID)0xB6F3B8, &ptarget, 4, 0); // pointer to target

            pped = ptarget + 0x79C; // our current target
            ReadProcessMemory(hProcess, (LPCVOID)pped, &pped, 4, 0);

            if (pped > 0)
            {
                pvectorx = pped + 0x44; // border (x) (hitbox)
                pvectory = pped + 0x48; // border (y) (hitbox)

                ReadProcessMemory(hProcess, (LPCVOID)pvectorx, &fpvectorx, 4, 0);
                ReadProcessMemory(hProcess, (LPCVOID)pvectory, &fpvectory, 4, 0);

                pmtrx2 = pped + 0x14; // pointer to XYZ of target
                ReadProcessMemory(hProcess, (LPCVOID)pmtrx2, &pmtrx2, 4, 0);

                xpos2 = pmtrx2 + 0x30; // x position (of target)
                ypos2 = pmtrx2 + 0x34; // y position (of target)
                zpos2 = pmtrx2 + 0x38; //  position (of target)

                ReadProcessMemory(hProcess, (LPCVOID)xpos2, &fxpos2, 4, 0);
                ReadProcessMemory(hProcess, (LPCVOID)ypos2, &fypos2, 4, 0);
                ReadProcessMemory(hProcess, (LPCVOID)zpos2, &fzpos2, 4, 0);

                php = pped + 0x540; // ped health
                ReadProcessMemory(hProcess, (LPCVOID)php, &fphp, 4, 0);

                float theta, dist;
                if (fphp > 0) // if ped health > 0
                {
                    //dist = sqrt((float)(xpos2-xpos1)*(xpos2-xpos1) + (ypos2-ypos1)*(ypos2-ypos1) + (zpos2-zpos1)*(zpos2-zpos1));

                    dist = sqrt((fxpos2 - fxpos1)*(fxpos2 - fxpos1) + (fypos2 - fypos1)*(fypos2 - fypos1) + (fzpos2 - fzpos1)*(fzpos2 - fzpos1));
                    theta = asin((fzpos2 - fzpos1) / dist);
                    theta -= (90 / (3.14 * 180));

                    fxpos2a = fxpos2;
                    fypos2a = fypos2;

                    aa = fabs(fcxpos - fxpos2);
                    ab = fabs(fcypos - fypos2);
                    ac = sqrt(aa*aa + ab * ab);

                    alpha = asin(aa / ac);
                    beta = acos(aa / ac);

                    if ((fxpos1 > fxpos2) && (fypos1 < fypos2))
                    {
                        beta = -beta;
                    }
                    if ((fxpos1 > fxpos2) && (fypos1 > fypos2))
                    {
                        beta = beta;
                    }
                    if ((fxpos1 < fxpos2) && (fypos1 > fypos2))
                    {
                        beta = (alpha + (3.14 / 2));
                    }
                    if ((fxpos1 < fxpos2) && (fypos1 < fypos2))
                    {
                        beta = (-alpha - (3.14 / 2));
                    }

                    if (wID == 24)
                    {
                        camxpos = beta + 0.0410;
                        camypos = theta + 0.0389 + dist / 3000;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                      
                    }
                    if (wID == 31)
                    {
                        camxpos = beta + 0.0300 + (dist / 14000);
                        camypos = theta + 0.0389 + dist / 3000;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                      
                    }
                    if (wID == 27)
                    {
                        camxpos = beta + 0.0300 + (dist / 14000);
                        camypos = theta + 0.0389 + dist / 3000;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                      
                    }
                    if (wID == 32)
                    {
                        camxpos = beta + 0.0300 + (dist / 14000);
                        camypos = theta + 0.0389 + dist / 3000;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                      
                    }
                    if (wID == 33)
                    {
                        camxpos = beta + 0.0300 + (dist / 14000);
                        camypos = theta + 0.0389 + dist / 3000;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                      
                    }
                    if (wID == 25)
                    {
                        camxpos = beta + 0.0300 + (dist / 14000);
                        camypos = theta + 0.0389 + dist / 3000;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                      
                    }
                    if (wID == 23)
                    {
                        camxpos = beta + 0.0300 + (dist / 14000);
                        camypos = theta + 0.0389 + dist / 3000;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                      
                    }
                    if (wID == 38)
                    {
                        camxpos = beta + 0.0300 + (dist / 14000);
                        camypos = theta + 0.0389 + dist / 3000;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                      
                    }
                    if (wID == 34)
                    {
                        camxpos = beta + 0.0300 + (dist / 14000);
                        camypos = theta + 0.0389 + dist / 3000;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                      
                    }
                    if (wID == 30)
                    {
                        camxpos = beta + 0.0300 + (dist / 14000);
                        camypos = theta + 0.0389 + dist / 3000;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                      
                    }
                    if (wID == 29)
                    {
                        camxpos = beta + 0.0300 + (dist / 14000);
                        camypos = theta + 0.0389 + dist / 3000;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, (LPVOID)&camxpos, 4, NULL); // write X-coordinate vector to X-coordinate vector of camera                      
                    }
                }
            }
        }
    }
Finally, Smooth.
C++:
        DWORD m_target, m_actor, m_ped;
        float camXpos;
        ReadProcessMemory(hProcess, (LPVOID)0xB6F258, &camXpos, sizeof(camXpos), 0);
        ReadProcessMemory(hProcess, (LPVOID)0xB6F5F0, &m_target, sizeof(m_target), 0);
        ReadProcessMemory(hProcess, (LPVOID)0xB6F5F0, &m_actor, sizeof(m_actor), 0);
        ReadProcessMemory(hProcess, (LPVOID)(m_target + 0x79C), &m_ped, sizeof(m_ped), 0);

        if (m_actor > 0)
        {
            char pVehicle;
            ReadProcessMemory(hProcess, (LPVOID)(m_actor + 0x46C), &pVehicle, sizeof(pVehicle), 0);

            if (pVehicle != 1)
            {
                DWORD pMtrx1;
                float xPos1, yPos1, CxPos1, CyPos1;

                ReadProcessMemory(hProcess, (LPVOID)(m_actor + 0x14), &pMtrx1, sizeof(pMtrx1), 0);
                ReadProcessMemory(hProcess, (LPVOID)(pMtrx1 + 0x30), &xPos1, sizeof(xPos1), 0);
                ReadProcessMemory(hProcess, (LPVOID)(pMtrx1 + 0x34), &yPos1, sizeof(yPos1), 0);

                ReadProcessMemory(hProcess, (LPVOID)0xB6F9CC, &CxPos1, sizeof(CxPos1), 0);
                ReadProcessMemory(hProcess, (LPVOID)0xB6F9D0, &CyPos1, sizeof(CyPos1), 0);

                float xPoint = CxPos1;
                float yPoint = CyPos1;

                float m_player[3];

                if (m_ped > 0)
                {

                    DWORD p_matrix;
                    float playerHP;

                    ReadProcessMemory(hProcess, (LPVOID)(m_ped + 0x14), &p_matrix, sizeof(p_matrix), 0);
                    ReadProcessMemory(hProcess, (LPVOID)(p_matrix + 0x30), &m_player[0], sizeof(m_player[0]), 0);
                    ReadProcessMemory(hProcess, (LPVOID)(p_matrix + 0x34), &m_player[1], sizeof(m_player[1]), 0);

                    ReadProcessMemory(hProcess, (LPVOID)(m_ped + 0x540), &playerHP, sizeof(playerHP), 0);

                    if (playerHP > 0)
                    {

                        float m_position[3];
                        float m_difference, m_smooth;
                        float m_view_angle;

                        ReadProcessMemory(hProcess, (LPVOID)0xB6F258, &m_view_angle, sizeof(m_view_angle), 0);

                        m_position[0] = fabs(xPoint - m_player[0]);
                        m_position[1] = fabs(yPoint - m_player[1]);

                        float m_distance = sqrt((m_position[0] * m_position[0]) + (m_position[1] * m_position[1]));

                        float m_cos_delta = acosf(m_position[0] / m_distance);

                        float m_sin_delta = asinf(m_position[0] / m_distance);


                        if ((xPos1 > m_player[0]) && (yPos1 < m_player[1]))
                        {
                            m_difference = (-m_cos_delta + 0.0390) - m_view_angle;
                        }

                        if ((xPos1 > m_player[0]) && (yPos1 > m_player[1]))
                        {
                            m_difference = (m_cos_delta + 0.0390) - m_view_angle;
                        }

                        if ((xPos1 < m_player[0]) && (yPos1 > m_player[1]))
                        {
                            m_difference = (m_sin_delta + 1.6107) - m_view_angle;
                        }

                        if ((xPos1 < m_player[0]) && (yPos1 < m_player[1]))
                        {
                            m_difference = (-m_sin_delta - 1.5307) - m_view_angle;
                        }
                        m_smooth = m_difference / 5.0f; // Smooth value

                        if (m_smooth > -1.0 && m_smooth < 0.5 && m_difference > -2.0 && m_difference < 2.0)
                        m_view_angle += m_smooth;
                        WriteProcessMemory(hProcess, (LPVOID)0xB6F258, &m_view_angle, sizeof(m_view_angle), 0);
                    }
                }
            }
        }
Send this hack pls
 

88resu

Active member
Joined
Oct 1, 2019
Messages
110
Reaction score
46
Location
Uganda
this aimbot is bad the crosshair hangs behind the target all the time while moving even smooth pasted from grab´s aimbot . (didnt changed from first version release lel)

make it circle around the target ( decent bezier curves ) i do it like that. looks and feels humanized.
 
Top