#include <windows.h>
#define SAMP_0_3_7 1
#define SAMP_0_3_DL 2
#define SAMP_VERSION SAMP_0_3_7
/* 0.3.7-R1 */
#if SAMP_VERSION == SAMP_0_3_7
#define SAMP_INFO_OFFSET 0x21A0F8
#define SAMP_pSettings 0x3CD
#define SAMP_fNameTagsDistance 0x27
#define SAMP_byteNoNametagsBehindWalls 0x2F
#define SAMP_byteShowNameTags 0x38
#endif
/* 0.3.DL-R1 */
#if SAMP_VERSION == SAMP_0_3_DL
#define SAMP_INFO_OFFSET 0x2ACA24
#define SAMP_pSettings 0x3D5
#define SAMP_fNameTagsDistance 0x27
#define SAMP_byteNoNametagsBehindWalls 0x2F
#define SAMP_byteShowNameTags 0x38
#endif
DWORD *pInfo = NULL;
BYTE *ThroughWalls = NULL;
BYTE *ShowNameTags = NULL;
float *fDistance = NULL;
bool KeyPressed(BYTE key)
{
return ((GetAsyncKeyState(key)&(1<<16))!=0);
}
void WallHack()
{
DWORD SampDLL = (DWORD)GetModuleHandleA("samp.dll");
if (SampDLL)
{
pInfo = (DWORD*)(SampDLL + SAMP_INFO_OFFSET);
while (*pInfo == 0) Sleep(1000);
while (*(DWORD*)(*pInfo + SAMP_pSettings) == 0) Sleep(1000);
fDistance = (float*)((DWORD*)(*(DWORD*)(*pInfo + SAMP_pSettings) + SAMP_fNameTagsDistance));
ThroughWalls = (BYTE*)(*(DWORD*)(*pInfo + SAMP_pSettings) + SAMP_byteNoNametagsBehindWalls);
ShowNameTags = (BYTE*)(*(DWORD*)(*pInfo + SAMP_pSettings) + SAMP_byteShowNameTags);
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(VK_F3));
do Sleep(50);
while (KeyPressed(VK_F3));
*ShowNameTags = 1;
*ThroughWalls = 0;
*fDistance = 1500.0;
do Sleep(100);
while (!KeyPressed(VK_MENU) || !KeyPressed(VK_F3));
do Sleep(50);
while (KeyPressed(VK_F3));
*ShowNameTags = 1;
*ThroughWalls = 1;
*fDistance = 50.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)WallHack, 0, 0, 0);
}
return true;
}