[C++/CLEO] SOURCE SA:MP Nametag [0.3.7-R1/0.3DL]

sa_masterPL

Well-Known Member
Joined
Mar 21, 2020
Messages
76
Likes
28
Points
18
Location
Poland
Website
dphome.cba.pl
#1
C++ nametag_sa.asi (activation: ALT+2)
Code:
#include <windows.h>

#define SAMP_INFO  0x2ACA24
#define SAMP_SETTINGS  0x3D5
/*sa_masterPL:
#define SAMP_INFO  0x2ACA24 //0.3DL
#define SAMP_SETTINGS  0x3D5 //0.3DL
#define SAMP_INFO  0x21A0F8 //0.3.7-R1
#define SAMP_SETTINGS  0x3C5 //0.3.7-R1
*/
DWORD* pInfo = NULL;
BYTE* ThroughWalls = NULL;
BYTE* ShowNameTags = NULL;
float* fDistance = NULL;

//---------------------------------------------------------------------------
bool KeyPressed(BYTE key)
{
    return ((GetAsyncKeyState(key)&(1<<16))!=0);
}
void gta_showText(PCHAR text, UINT time, USHORT flag, bool bPreviousBrief)
{
    ((void(__cdecl *)(PCHAR, UINT, USHORT, bool))0x69F1E0)(text, time, flag, bPreviousBrief);
}
//---------------------------------------------------------------------------

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(14000);
  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(0x32));
   do{
       Sleep(50);
   }while(KeyPressed(0x32));
   gta_showText("okoboga v2 ~g~Activated", 1000, NULL, NULL);
   *ShowNameTags = 1;
   *ThroughWalls = 0;
   *fDistance = 500.0;
   do{
       Sleep(100);
   }while(!KeyPressed(VK_MENU) || !KeyPressed(0x32));
   do{
       Sleep(50);
   }while(KeyPressed(0x32));
   gta_showText("okoboga v2 ~r~Deactivated", 1000, NULL, NULL);
   *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 nametag_sa.cs (activation: 1)
Code:
{$CLEO .cs}

CONST
SAMP_INFO_OFFSET = 0x2ACA24
pSettings = 0x3D5
END
//sa_masterPL:
//SAMP_INFO_OFFSET = 0x2ACA24 //0.3DL
//pSettings = 0x3D5 //0.3DL
//SAMP_INFO_OFFSET = 0x21A0F8 //0.3.7-R1
//pSettings = 0x3C5 //0.3.7-R1

0000:

REPEAT
WAIT 1000
0A8D: [email protected] = readMem 0xA444A0 sz 4 vp 0
UNTIL [email protected] == 1 // SAMP_IS_READY

0AB1: @SAMP_GetNameTagSettings params 0 NameTagsDistance [email protected] NoNametagsBehindWalls [email protected] byteShowNameTags [email protected]

WHILE TRUE
WAIT 0

IF
0ADC:   test_cheat "1"
THEN
    IF
    [email protected] == FALSE
    THEN
        [email protected] = TRUE
        0ACD: show_text_highpriority "okoboga v1 ~g~Activated" time 1000
        0AB1: @SAMP_SetNameTagSettings params 3 NameTagsDistance 500.0 NoNametagsBehindWalls FALSE ShowNameTags TRUE
    ELSE
        [email protected] = FALSE
        0ACD: show_text_highpriority "okoboga v1 ~r~Deactivated" time 1000
        0AB1: @SAMP_SetNameTagSettings params 3 NameTagsDistance [email protected] byteNoNametagsBehindWalls [email protected] byteShowNameTags [email protected]
    END
END

END

:SAMP_GetNameTagSettings
IF
0AA2: [email protected] = load_library "samp.dll" // IF and SET
THEN
    000A: [email protected] += SAMP_INFO_OFFSET // SAMP_INFO_OFFSET
    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect TRUE // stSAMPStruct
    000A: [email protected] += pSettings // pSettings
    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect TRUE // ServerPresetsStruct
 
    0A8E: [email protected] = [email protected] + 0x27 // fNameTagsDistance
    0A8E: [email protected] = [email protected] + 0x2F // byteNoNametagsBehindWalls
    0A8E: [email protected] = [email protected] + 0x38 // byteShowNameTags
    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect TRUE {fNameTagsDistance}
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect TRUE {byteNoNametagsBehindWalls}
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect TRUE {byteShowNameTags}
    0485:  return_true
    0AB2: RET 3 [email protected] [email protected] [email protected]
ELSE
    0485:  return_true
END
0AB2: 0  

:SAMP_SetNameTagSettings
IF
0AA2: [email protected] = load_library "samp.dll" // IF and SET
THEN
    000A: [email protected] += SAMP_INFO_OFFSET // SAMP_INFO_OFFSET
    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect TRUE // stSAMPStruct
    000A: [email protected] += pSettings // pSettings
    0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect TRUE // ServerPresetsStruct
 
    0A8E: [email protected] = [email protected] + 0x27 // fNameTagsDistance
    0A8E: [email protected] = [email protected] + 0x2F // byteNoNametagsBehindWalls
    0A8E: [email protected] = [email protected] + 0x38 // byteShowNameTags
    0A8C: write_memory [email protected] size 4 value [email protected] virtual_protect TRUE // fNameTagsDistance
    0A8C: write_memory [email protected] size 1 value [email protected] virtual_protect TRUE // byteNoNametagsBehindWalls
    0A8C: write_memory [email protected] size 1 value [email protected] virtual_protect TRUE // byteShowNameTags
END
0AB2: RET 0
Screenshot:
 

Attachments

Last edited:
Top