[C++] External Nametag

amoreamoreamore

Active member
Joined
May 3, 2019
Messages
38
Reaction score
10
Location
Saint-Petersburg
This offsets works for 0.3.7 R1, R2, R3:
C++:
#define SAMP_INFO  0x21A0F8
#define SAMP_SETTINGS  0x3C5
This offsets for 0.3.DL:
C++:
#define SAMP_INFO  0x2ACA24
#define SAMP_SETTINGS  0x3D5
Enable:
C++:
        DWORD pInfo;
        uint32_t pSettings;

        unsigned char ShowNameTags = 1;
        unsigned char ThroughWalls = 0;
        float fDistance = 999.0f;  //Distance
        ReadProcessMemory(hProcess, (LPVOID)(moduleBase + SAMP_INFO), &pInfo, sizeof(pInfo), nullptr);
        ReadProcessMemory(hProcess, (LPVOID)(pInfo + SAMP_SETTINGS), &pSettings, sizeof(pSettings), NULL);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x38), &ShowNameTags, sizeof(ShowNameTags), nullptr);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x2F), &ThroughWalls, sizeof(ThroughWalls), nullptr);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x27), &fDistance, sizeof(fDistance), nullptr);
Disable:
C++:
        DWORD pInfo;
        uint32_t pSettings;

        unsigned char ShowNameTags = 1;
        unsigned char ThroughWalls = 1;
        float fDistance = 100.0f; //Distance
        ReadProcessMemory(hProcess, (LPVOID)(moduleBase + SAMP_INFO), &pInfo, sizeof(pInfo), nullptr);
        ReadProcessMemory(hProcess, (LPVOID)(pInfo + SAMP_SETTINGS), &pSettings, sizeof(pSettings), NULL);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x38), &ShowNameTags, sizeof(ShowNameTags), nullptr);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x2F), &ThroughWalls, sizeof(ThroughWalls), nullptr);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x27), &fDistance, sizeof(fDistance), nullptr);

Get samp.dll address:
C++:
#pragma once
#include <Windows.h>
#include <TlHelp32.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;
}
 
Last edited:

bRuCeBrUcE

Active member
Joined
Jun 6, 2020
Messages
26
Reaction score
1
Location
Macedonia
This offsets works for 0.3.7 R1, R2, R3:
C++:
#define SAMP_INFO  0x21A0F8
#define SAMP_SETTINGS  0x3C5
This offsets for 0.3.DL:
C++:
#define SAMP_INFO  0x2ACA24
#define SAMP_SETTINGS  0x3D5
Enable:
C++:
        DWORD pInfo;
        uint32_t pSettings;

        unsigned char ShowNameTags = 1;
        unsigned char ThroughWalls = 0;
        float fDistance = 999.0f;  //Distance
        ReadProcessMemory(hProcess, (LPVOID)(moduleBase + SAMP_INFO), &pInfo, sizeof(pInfo), nullptr);
        ReadProcessMemory(hProcess, (LPVOID)(pInfo + SAMP_SETTINGS), &pSettings, sizeof(pSettings), NULL);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x38), &ShowNameTags, sizeof(ShowNameTags), nullptr);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x2F), &ThroughWalls, sizeof(ThroughWalls), nullptr);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x27), &fDistance, sizeof(fDistance), nullptr);
Disable:
C++:
        DWORD pInfo;
        uint32_t pSettings;

        unsigned char ShowNameTags = 1;
        unsigned char ThroughWalls = 1;
        float fDistance = 0.0f; //Distance
        ReadProcessMemory(hProcess, (LPVOID)(moduleBase + SAMP_INFO), &pInfo, sizeof(pInfo), nullptr);
        ReadProcessMemory(hProcess, (LPVOID)(pInfo + SAMP_SETTINGS), &pSettings, sizeof(pSettings), NULL);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x38), &ShowNameTags, sizeof(ShowNameTags), nullptr);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x2F), &ThroughWalls, sizeof(ThroughWalls), nullptr);
        WriteProcessMemory(hProcess, (LPVOID)(pSettings + 0x27), &fDistance, sizeof(fDistance), nullptr);

Get samp.dll address:
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;
}
Can you give this Wallhack no source code
 

Valiuks

Active member
Joined
Sep 9, 2018
Messages
25
Reaction score
4
cant get getmodulebaseaddress to work, does anyone have vs studio settings, i think its the issue?

edit: project>properties>linker>manifest file UAC Execution level administrator if any1 is stuck
 
Last edited:
Top