NoKalckorOwnsYou

Savchik Blazer

Но я, мечту свою лелея...
Автор темы
Проверенный
671
293
теперь Калкор больше не владеет вами

C++:
#include "library.hpp"

void MainFunction()
{
    while (!SAMP::IsSampInitialized()) std::this_thread::sleep_for(std::chrono::milliseconds(1u));
    switch (SAMP::GetSAMPVersion())
    {
    case SAMP::sampVersion::R1:
        DWORD protect;
        VirtualProtect(reinterpret_cast<LPVOID>(reinterpret_cast<DWORD>(GetModuleHandleA("SAMPFUNCS.asi")) + 0xD0DF4), 1, PAGE_EXECUTE_READWRITE, &protect);
        std::strcpy(reinterpret_cast<char*>(reinterpret_cast<DWORD>(GetModuleHandleA("SAMPFUNCS.asi")) + 0xD0DF4), "\0");
        VirtualProtect(reinterpret_cast<LPVOID>(reinterpret_cast<DWORD>(GetModuleHandleA("SAMPFUNCS.asi")) + 0xD0DF4), 1, protect, &protect);
        break;
    case SAMP::sampVersion::R3:
        DWORD protect2;
        VirtualProtect(reinterpret_cast<LPVOID>(reinterpret_cast<DWORD>(GetModuleHandleA("SAMPFUNCS.asi")) + 0xD1AB0), 1, PAGE_EXECUTE_READWRITE, &protect2);
        std::strcpy(reinterpret_cast<char*>(reinterpret_cast<DWORD>(GetModuleHandleA("SAMPFUNCS.asi")) + 0xD1AB0), "\0");
        VirtualProtect(reinterpret_cast<LPVOID>(reinterpret_cast<DWORD>(GetModuleHandleA("SAMPFUNCS.asi")) + 0xD1AB0), 1, protect2, &protect2);
        break;
    case SAMP::sampVersion::DL:
        DWORD protect3;
        VirtualProtect(reinterpret_cast<LPVOID>(reinterpret_cast<DWORD>(GetModuleHandleA("SAMPFUNCS.asi")) + 0xD1ACC), 1, PAGE_EXECUTE_READWRITE, &protect3);
        std::strcpy(reinterpret_cast<char*>(reinterpret_cast<DWORD>(GetModuleHandleA("SAMPFUNCS.asi")) + 0xD1ACC), "\0");
        VirtualProtect(reinterpret_cast<LPVOID>(reinterpret_cast<DWORD>(GetModuleHandleA("SAMPFUNCS.asi")) + 0xD1ACC), 1, protect3, &protect3);
        break;
    }
}

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
                     )
{
    if (ul_reason_for_call == DLL_PROCESS_ATTACH)
    {
        DisableThreadLibraryCalls(hModule);
        std::thread(MainFunction).detach();
    }
    return TRUE;
}
 
Последнее редактирование: