[C++/CLEO] Name Tag Hack

dphome

Well-known member
Joined
Mar 21, 2020
Messages
456
Solutions
9
Reaction score
165
Location
Poland
C++
Code:
#include <windows.h>

#define SAMP_INFO  0x2ACA24
#define SAMP_SETTINGS  0x3D5

//DWORD* pChat = NULL;
DWORD* pInfo = NULL;
BYTE* ThroughWalls = NULL;
BYTE* ShowNameTags = NULL;
float* fDistance = NULL;

//---------------------------------------------------------------------------
bool KeyPressed(BYTE key)
{
    return ((GetAsyncKeyState(key)&(1<<16))!=0);
}

typedef unsigned int       uint32_t;
void ShowText(const char *text, int time, int style)
{
    ((void(__cdecl *) (uint32_t something)) (0x0069DCD0)) (0);
    ((void(__cdecl *) (const char *text, int time, int style)) (0x0069F2B0)) (text, time, style);
}
//---------------------------------------------------------------------------

void Thread()
{
    DWORD SampDLL = (DWORD)GetModuleHandleA("samp.dll");
    if (SampDLL)
    {
        pInfo = (DWORD*)(SampDLL + SAMP_INFO);
        while (*pInfo == 0)
            Sleep(1000);
        while (*(DWORD*)(*pInfo + SAMP_SETTINGS) == 0)
            Sleep(1000);
        ShowNameTags = (BYTE*)(*(DWORD*)(*pInfo + SAMP_SETTINGS) + 0x38);
        ThroughWalls = (BYTE*)(*(DWORD*)(*pInfo + SAMP_SETTINGS) + 0x2F);
        fDistance = (float*)((DWORD*)(*(DWORD*)(*pInfo + SAMP_SETTINGS) + 0x27));
        Sleep(10000);
        DWORD OldProt;
        VirtualProtect((LPVOID)ShowNameTags, 0x100, PAGE_EXECUTE_READWRITE, &OldProt);
        VirtualProtect((LPVOID)ThroughWalls, 0x100, PAGE_EXECUTE_READWRITE, &OldProt);
        VirtualProtect((LPVOID)fDistance, 0x100, PAGE_EXECUTE_READWRITE, &OldProt);
        VirtualProtect((LPVOID)SampDLL, 0x3071B0, PAGE_EXECUTE_READWRITE, &OldProt);
        for (;;)
        {
            do
            {
                Sleep(100);
//            } while (!KeyPressed(VK_MENU) || !KeyPressed(VK_F3));
            } while (!KeyPressed(0x32));
            do
            {
                Sleep(50);
            } while (KeyPressed(0x32));
            ShowText("~w~Okoboga ~g~Activated", 500, 5);
            *ShowNameTags = 1;
            *ThroughWalls = 0;
            *fDistance = 999.0;
            do
            {
                Sleep(100);
//            } while (!KeyPressed(VK_MENU) || !KeyPressed(VK_F3));
            } while (!KeyPressed(0x32));
            do
            {
                Sleep(50);
            } while (KeyPressed(0x32));
            ShowText("~w~Okoboga ~r~Deactivated", 1000, 5);
            *ShowNameTags = 1;
            *ThroughWalls = 1;
            *fDistance = 0.0;
        }
    }
}

//-------------------------------------------------------------------------------
int WINAPI DllMain(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
    if(reason==DLL_PROCESS_ATTACH)
    {
         DWORD OldProt;
         VirtualProtect((LPVOID)0x401000, 0x4A3000, PAGE_EXECUTE_READWRITE, &OldProt);
         CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Thread, 0, 0, 0);
    }
    return 1;
}
CLEO
Code:
{$CLEO}
 
CONST
    SAMP_INFO_OFFSET = 0x2ACA24
    pSettings = 0x3D5
    fNameTagsDistance = 0x27
    byteNoNametagsBehindWalls = 0x2F
    byteShowNameTags = 0x38
END
 
IF 8AA2: NOT 0@ = load_library "samp.dll"
THEN 0A93:
END
0AA3: free_library 0@
0001: WAIT 8500 MS
0AB1: call_scm_func @SAMP_Get__stSAMPStruct params 1 0@ 1@
0AB1: call_scm_func @SAMP_Get__stServerPresetsStruct params 1 1@ 2@

WHILE TRUE
    
    REPEAT
    0001: WAIT 0 MS
    UNTIL 0ADC:   test_cheat "1"
    0AB1: call_scm_func @SAMP_GetNameTagSettings params 1 2@ 3@ 4@ 5@
    0AB1: call_scm_func @SAMP_SetNameTagSettings params 4 2@ 999.0 FALSE TRUE
    0ACD: show_text_highpriority "~w~Okoboga ~g~Activated" time 500
    
    REPEAT
    0001: WAIT 0 MS
    UNTIL 0ADC:   test_cheat "1" 
    0AB1: call_scm_func @SAMP_SetNameTagSettings params 4 2@ 3@ 4@ 5@
    0ACD: show_text_highpriority "~w~Okoboga ~r~Deactivated" time 1000

END

:SAMP_Get__stSAMPStruct
000A: 0@ += SAMP_INFO_OFFSET
0A8D: 0@ = read_memory 0@ size 4 virtual_protect TRUE
0AB2: RET 1 0@

:SAMP_Get__stServerPresetsStruct
000A: 0@ += pSettings
0A8D: 0@ = read_memory 0@ size 4 virtual_protect TRUE
0AB2: RET 1 0@

:SAMP_GetNameTagSettings
0A8E: 25@ = 0@ + fNameTagsDistance
0A8E: 26@ = 0@ + byteNoNametagsBehindWalls
0A8E: 27@ = 0@ + byteShowNameTags
0A8D: 25@ = read_memory 25@ size 4 virtual_protect TRUE
0A8D: 26@ = read_memory 26@ size 1 virtual_protect TRUE
0A8D: 27@ = read_memory 27@ size 1 virtual_protect TRUE
0AB2: RET 3 25@ 26@ 27@

:SAMP_SetNameTagSettings
0A8E: 25@ = 0@ + fNameTagsDistance
0A8E: 26@ = 0@ + byteNoNametagsBehindWalls
0A8E: 27@ = 0@ + byteShowNameTags
0A8C: write_memory 25@ size 4 value 1@ virtual_protect TRUE
0A8C: write_memory 26@ size 1 value 2@ virtual_protect TRUE
0A8C: write_memory 27@ size 1 value 3@ virtual_protect TRUE
0AB2: RET 0
 
Last edited:

bRuCeBrUcE

Active member
Joined
Jun 6, 2020
Messages
26
Reaction score
1
Location
Macedonia
Can you give this external wallhack to download i not understand how to made external hack give link this wallhack to dowload
 
Top