ASI [R1] Anti-mask

LuaQ

Участник
Автор темы
84
27
Версия SA-MP
  1. 0.3.7 (R1)
Позволяет видеть невидимых игроков на радаре (обычно это предусматривается для тех, кто в маске, для тех, кто работает в ФБР (на Diamond RP), и тем подобных на других серверах)
Активация/деактивация: /ms (по умолчанию плагин активен)
Исходный код:
C++:
#include "pch.h"
#include <Windows.h>
#include <process.h>

DWORD returnPoint;
bool status = true;
void* chatpool;
DWORD sampAddress;

unsigned char forcompare[9] = { 0xC2, 0x04, 0x00, 0x3D, 0xED, 0x03, 0x00, 0x00 };

void AddChatMessage(const char* text, DWORD color)
{
    ((void(__thiscall*)(void* _this, DWORD type, const char* string, DWORD unknown, DWORD color, DWORD unknown1))(sampAddress + 0x64010))(chatpool, 4, text, 0, color, 0);
}

void __cdecl switcher(const char* param)
{
    status = !status;
    AddChatMessage(status ? "antimask has been enabled" : "antimask has been disabled", -1);
}

DWORD __cdecl SetPlayerColor(DWORD color)
{
    if (status) {
        unsigned char* AColor = (unsigned char*)(&color);
        if (!(*AColor)) {
            *AColor = 0xAA;
        }
    }
    return color;
}

_declspec(naked) void caller()
{
    _asm
    {
        push eax
        call SetPlayerColor
        pop eax
        jmp returnPoint
    }
}

void __stdcall mainloop(void*)
{
    sampAddress = (DWORD)GetModuleHandle(L"samp.dll");
    while (!sampAddress) {
        sampAddress = (DWORD)GetModuleHandle(L"samp.dll");
        Sleep(300);
    }
    if (memcmp((void*)(sampAddress + 0xAD580), (void*)forcompare, sizeof(forcompare) - 1)) return;
    DWORD address = sampAddress + 0xAD554;
    chatpool = *(void**)(sampAddress + 0x21A0E4);
    while (chatpool == nullptr) {
        chatpool = *(void**)(sampAddress + 0x21A0E4);
        Sleep(300);
    }
    void* commandpool = *(void**)(sampAddress + 0x21A0E8);
    while (commandpool == nullptr) {
        commandpool = *(void**)(sampAddress + 0x21A0E8);
        Sleep(300);
    }
    returnPoint = sampAddress + 0xAD5AF + 5;
    DWORD protection;
    VirtualProtect((void*)(sampAddress + 0xAD5A6), 14, PAGE_EXECUTE_READWRITE, &protection);
    memcpy((void*)(sampAddress + 0xAD5AF + 5), (void*)(sampAddress + 0xAD5AF), 3);
    *(char*)(sampAddress + 0xAD5AF) = 0xE9;
    *(DWORD*)(sampAddress + 0xAD5AF + 1) = (DWORD)caller - (sampAddress + 0xAD5AF + 5);
    *(char*)(sampAddress + 0xAD5A7) = *(char*)(sampAddress + 0xAD5A7) + 5;
    VirtualProtect((void*)(sampAddress + 0xAD5A6), 14, protection, NULL);
    ((void(__thiscall*)(void* _this, const char* command, void(__cdecl*)(const char*)))(sampAddress + 0x65AD0))(commandpool, "ms", switcher);
}

BOOL APIENTRY DllMain(HMODULE hModule,
    DWORD  ul_reason_for_call,
    LPVOID lpReserved
)
{
    switch (ul_reason_for_call)
    {
    case DLL_PROCESS_ATTACH:
        _beginthread((_beginthread_proc_type)mainloop, 0, nullptr);
    case DLL_THREAD_ATTACH:
    case DLL_THREAD_DETACH:
    case DLL_PROCESS_DETACH:
        break;
    }
    return TRUE;
}
 

Вложения

  • antimask.asi
    9 KB · Просмотры: 537
Последнее редактирование:
D

deleted-user-399997

Гость
а клист будет белый? или тот который должен быть у игрока?
 
  • Нравится
Реакции: _DarkRage