教程 如何更新DLL作弊中的偏移量

YinBuLiao

we're all gonna die
论坛管理员
论坛VIP
2020/10/25
22
160
大家好。在上一篇文章中,我向您展示了如何在外部作弊中更新偏移量。在这一节中,我将告诉您如何更新DLL作弊中的偏移量。基本信息,偏移量等 您可以从本指南中找到:https://hvh.black/threads/31/。通常,该指南将再次包含几个文件。第一个文件被添加到资源文件中。Hack.cpp:
C++:
#include "DllMain.h"
#include <iostream>

using namespace std;

bool cHack::isgetaddress;
DWORD
cHack::gameModule = NULL,
cHack::dwLocalPlayer = NULL,
* cHack::localPlayer = NULL;

BOOL __stdcall cHack::EntryPoint(LPVOID)
{
    Prepare();
     std::cout << dwLocalPlayer << endl;
    return 0;
}

BOOL __stdcall cHack::Prepare(VOID)
{
    gameModule = (DWORD)GetModuleHandleA("client.dll");
     if (!isgetaddress)
      {
        {
        dwLocalPlayer = CSGO::FindPattern(gameModule, 0xFFFFFFF,(PBYTE)"\x8D\x34\x85\x00\x00\x00\x00\x89\x15\x00\x00\x00\x00\x8B\x41\x08\x8B\x48\x04\x83\xF9\xFF", "000????00????000000000").Base;

        {
            dwLocalPlayer = *(DWORD*)(dwLocalPlayer + 0x3);
            dwLocalPlayer -= gameModule;
            dwLocalPlayer += 0x4;
         }
       }
       isgetaddress = true;
      }
    localPlayer = (DWORD*)(gameModule + dwLocalPlayer);

    return 0;
}
同样,如果出现错误,则禁用兼容模式
您可以从以下代码片段中学习一些模式:
C++:
dwLocalPlayer = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x8D\x34\x85\x00\x00\x00\x00\x89\x15\x00\x00\x00\x00\x8B\x41\x00\x8B\x48\x00\x83\xF9\xFF\x74\x17"), "000????00????00?00?00000").Base;
        if (dwLocalPlayer)
        {
            dwLocalPlayer = *(DWORD*)(dwLocalPlayer + 0x3);
            dwLocalPlayer -= gameModule;
            dwLocalPlayer += 0x4;
        }
    } while (!dwLocalPlayer);

    do
    {
        dwClientState = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\xA1\x00\x00\x00\x00\x33\xD2\x6A\x00\x6A\x00\x33\xC9\x89\xB0"), "0????000?0?0000").Base;
        if (dwClientState)
        {
            dwClientState = *(DWORD*)(dwClientState + 0x1);
            dwClientState -= gameEngine;
        }
    } while (!dwClientState);

    do
    {
        dwForceJump = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x8B\x0D\x00\x00\x00\x00\x8B\xD6\x8B\xC1\x83\xCA\x02"), "00????0000000").Base;
        if (dwForceJump)
        {
            dwForceJump = *(DWORD*)(dwForceJump + 0x2);
            dwForceJump -= gameModule;
        }
    } while (!dwForceJump);

    do
    {
        dwEntityList = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x89\x4D\xF8\x3B\xC7\x0F\x8C\x00\x00\x00\x00\xBB\x00\x00\x00\x00"), "0000000????0????").Base;
        if (dwEntityList)
        {
            dwEntityList = *(DWORD*)(dwEntityList + 0xC);
            dwEntityList -= gameModule;
        }
    } while (!dwEntityList);

    do
    {
        dwGlowObjectManager = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x5E\x5D\xC2\x00\x00\x83\xE9\x40\xE9\x00\x00\x00\x00\xA1\x00\x00\x00\x00"), "000??0000????0????").Base;
        if (dwGlowObjectManager)
        {
            dwGlowObjectManager = *(DWORD*)(dwGlowObjectManager + 0xE);
            dwGlowObjectManager -= gameModule;
            dwGlowObjectManager += 0x4;
        }
    } while (!dwGlowObjectManager);

    do
    {
        dwClientState_GetLocalPlayer = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\x8B\x80\x00\x00\x00\x00\x40\xC3"), "00????00").Base;
        if (dwClientState_GetLocalPlayer)
        {
            dwClientState_GetLocalPlayer = *(DWORD*)(dwClientState_GetLocalPlayer + 0x2);
        }
    } while (!dwClientState_GetLocalPlayer);

    do
    {
        dwClientState_IsHLTV = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\x80\xBF\x00\x00\x00\x00\x00\x0F\x84\x00\x00\x00\x00\x32\xDB"), "00?????00????00").Base;
        if (dwClientState_IsHLTV)
        {
            dwClientState_IsHLTV = *(DWORD*)(dwClientState_IsHLTV + 0x2);
        }
    } while (!dwClientState_IsHLTV);


    do
    {
        dwClientState_Map = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\x05\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xA1"), "0????000000000").Base;
        if (dwClientState_Map)
        {
            dwClientState_Map = *(DWORD*)(dwClientState_Map + 0x1);
        }
    } while (!dwClientState_Map);

    do
    {
        dwClientState_MapDirectory = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\xB8\x00\x00\x00\x00\xC3\x05\x00\x00\x00\x00\xC3"), "0????00????0").Base;
        if (dwClientState_MapDirectory)
        {
            dwClientState_MapDirectory = *(DWORD*)(dwClientState_MapDirectory + 0x7);
        }
    } while (!dwClientState_MapDirectory);

    do
    {
        dwClientState_MaxPlayer = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\xA1\x00\x00\x00\x00\x8B\x80\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\x55\x8B\xEC\x8A\x45\x08"), "0????00????00000000000").Base;
        if (dwClientState_MaxPlayer)
        {
            dwClientState_MaxPlayer = *(DWORD*)(dwClientState_MaxPlayer + 0x7);
        }
    } while (!dwClientState_MaxPlayer);

    do
    {
        dwClientState_State = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\x83\xB8\x00\x00\x00\x00\x00\x0F\x94\xC0\xC3"), "00?????0000").Base;
        if (dwClientState_State)
        {
            dwClientState_State = *(DWORD*)(dwClientState_State + 0x2);
        }
    } while (!dwClientState_State);

    do
    {
        dwClientState_ViewAngles = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\xF3\x0F\x11\x80\x00\x00\x00\x00\xD9\x46\x04\xD9\x05"), "0000????00000").Base;
        if (dwClientState_ViewAngles)
        {
            dwClientState_ViewAngles = *(DWORD*)(dwClientState_ViewAngles + 0x4);
        }
    } while (!dwClientState_ViewAngles);

    do
    {
        clientstate_delta_ticks = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\xC7\x87\x00\x00\x00\x00\x00\x00\x00\x00\xFF\x15\x00\x00\x00\x00\x83\xC4\x08"), "00????????00????000").Base;
        if (clientstate_delta_ticks)
        {
            clientstate_delta_ticks = *(DWORD*)(clientstate_delta_ticks + 0x2);
        }
    } while (!clientstate_delta_ticks);


    do
    {
        clientstate_last_outgoing_command = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\x8B\x8F\x00\x00\x00\x00\x8B\x87\x00\x00\x00\x00\x41"), "00????00????0").Base;
        if (clientstate_last_outgoing_command)
        {
            clientstate_last_outgoing_command = *(DWORD*)(clientstate_last_outgoing_command + 0x2);
        }
    } while (!clientstate_last_outgoing_command);

    do
    {
        clientstate_choked_commands = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\x8B\x87\x00\x00\x00\x00\x41"), "00????0").Base;
        if (clientstate_choked_commands)
        {
            clientstate_choked_commands = *(DWORD*)(clientstate_choked_commands + 0x2);
        }
    } while (!clientstate_choked_commands);

    do
    {
        clientstate_net_channel = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\x8B\x8F\x00\x00\x00\x00\x8B\x01\x8B\x40\x18"), "00????00000").Base;
        if (clientstate_net_channel)
        {
            clientstate_net_channel = *(DWORD*)(clientstate_net_channel + 0x2);
        }
    } while (!clientstate_net_channel);

    do
    {
        dwForceAttack = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x89\x0D\x00\x00\x00\x00\x8B\x0D\x00\x00\x00\x00\x8B\xF2\x8B\xC1\x83\xCE\x04"), "00????00????0000000").Base;
        if (dwForceAttack)
        {
            dwForceAttack = *(DWORD*)(dwForceAttack + 0x2);
            dwForceAttack -= gameModule;
            dwForceAttack2 = (DWORD)(dwForceAttack + 0xC);
            dwForceBackward = (DWORD)(dwForceAttack2 + 0x48);
            dwForceForward = (DWORD)(dwForceAttack + 0x30);
            dwForceLeft = (DWORD)(dwForceAttack + 0x48);
            dwForceRight = (DWORD)(dwForceAttack + 0x6C);
        }
    } while (!dwForceAttack);

    do
    {
        dwGameDir = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\x68\x00\x00\x00\x00\x8D\x85\x00\x00\x00\x00\x50\x68\x00\x00\x00\x00\x68"), "0????00????00????0").Base;
        if (dwGameDir)
        {
            dwGameDir = *(DWORD*)(dwGameDir + 0x1);
            dwGameDir -= gameEngine;
        }
    } while (!dwGameDir);

    do
    {
        dwGameRulesProxy = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\xA1\x00\x00\x00\x00\x85\xC0\x0F\x84\x00\x00\x00\x00\x80\xB8\x00\x00\x00\x00\x00\x74\x7A"), "0????0000????00?????00").Base;
        if (dwGameRulesProxy)
        {
            dwGameRulesProxy = *(DWORD*)(dwGameRulesProxy + 0x1);
            dwGameRulesProxy -= gameModule;
        }
    } while (!dwGameRulesProxy);

    do
    {
        dwGetAllClasses = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\xA1\x00\x00\x00\x00\xC3\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xCC\xA1\x00\x00\x00\x00\xB9"), "0????000000000000????0").Base;
        if (dwGetAllClasses)
        {
            dwGetAllClasses = *(DWORD*)(dwGetAllClasses + 0x1);
            dwGetAllClasses -= gameModule;
            dwGetAllClasses = (DWORD)(dwGetAllClasses - 0x4504624);
        }
    } while (!dwGetAllClasses);

    do
    {
        dwGlobalVars = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\x68\x00\x00\x00\x00\x68\x00\x00\x00\x00\xFF\x50\x08\x85\xC0"), "0????0????00000").Base;
        if (dwGlobalVars)
        {
            dwGlobalVars = *(DWORD*)(dwGlobalVars + 0x1);
            dwGlobalVars -= gameEngine;
        }
    } while (!dwGlobalVars);

    do
    {
        dwInput = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\xA1\x00\x00\x00\x00\xA8\x01\x75\x4B"), "0????0000").Base;
        if (dwInput)
        {
            dwInput = *(DWORD*)(dwInput + 0x1);
            dwInput -= gameModule;
            dwInput = (DWORD)(dwInput - 0xF661C);
        }
    } while (!dwInput);

    do
    {
        dwInterfaceLinkList = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x8B\x35\x00\x00\x00\x00\x57\x85\xF6\x74\x00\x8B\x7D\x08\x8B\x4E\x04\x8B\xC7\x8A\x11\x3A\x10"), "00????0000?000000000000").Base;
        if (dwInterfaceLinkList)
        {
            dwInterfaceLinkList -= gameModule;
        }
    } while (!dwInterfaceLinkList);

    do
    {
        dwMouseEnablePtr = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\xB9\x00\x00\x00\x00\xFF\x50\x34\x85\xC0\x75\x10"), "0????0000000").Base;
        if (dwMouseEnablePtr)
        {
            dwMouseEnablePtr = *(DWORD*)(dwMouseEnablePtr + 0x1);
            dwMouseEnablePtr -= gameModule;
            dwMouseEnable = (DWORD)(dwMouseEnablePtr + 0x30);
        }
    } while (!dwMouseEnable);

    do
    {
        dwPlayerResource = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x8B\x3D\x00\x00\x00\x00\x85\xFF\x0F\x84\x00\x00\x00\x00\x81\xC7"), "00????0000????00").Base;
        if (dwPlayerResource)
        {
            dwPlayerResource = *(DWORD*)(dwPlayerResource + 0x2);
            dwPlayerResource -= gameModule;
        }
    } while (!dwPlayerResource);

    do
    {
        dwRadarBase = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\xA1\x00\x00\x00\x00\x8B\x0C\xB0\x8B\x01\xFF\x50\x00\x46\x3B\x35\x00\x00\x00\x00\x7C\xEA\x8B\x0D"), "0????0000000?000????0000").Base;
        if (dwRadarBase)
        {
            dwRadarBase = *(DWORD*)(dwRadarBase + 0x1);
            dwRadarBase -= gameModule;
        }
    } while (!dwRadarBase);

    do
    {
        dwSensitivity = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x81\xF9\x00\x00\x00\x00\x75\x1D\xF3\x0F\x10\x05\x00\x00\x00\x00\xF3\x0F\x11\x44\x24\x00\x8B\x44\x24\x18\x35\x00\x00\x00\x00\x89\x44\x24\x0C\xEB\x0B"), "00????000000????00000?00000????000000").Base;
        if (dwSensitivity)
        {
            dwSensitivity = *(DWORD*)(dwSensitivity + 0xC);
            dwSensitivity -= gameModule;
            dwSensitivityPtr = (DWORD)(dwSensitivity - 0x2C);
        }
    } while (!dwSensitivity);

    do
    {
        dwSetClanTag = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\x53\x56\x57\x8B\xDA\x8B\xF9\xFF\x15"), "000000000").Base;
        if (dwSetClanTag)
        {
            dwSetClanTag -= gameEngine;
        }
    } while (!dwSetClanTag);

    do
    {
        dwViewMatrix = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x0F\x10\x05\x00\x00\x00\x00\x8D\x85\x00\x00\x00\x00\xB9"), "000????00????0").Base;
        if (dwViewMatrix)
        {
            dwViewMatrix = *(DWORD*)(dwViewMatrix + 0x3);
            dwViewMatrix -= gameModule;
            dwViewMatrix = (DWORD)(dwViewMatrix + 0xB0);
        }
    } while (!dwViewMatrix);

    do
    {
        dwWeaponTable = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\xB9\x00\x00\x00\x00\x6A\x00\xFF\x50\x08\xC3"), "0????0?0000").Base;
        if (dwWeaponTable)
        {
            dwWeaponTable = *(DWORD*)(dwWeaponTable + 0x1);
            dwWeaponTable -= gameModule;
        }
    } while (!dwWeaponTable);

    do
    {
        dwWeaponTableIndex = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x39\x86\x00\x00\x00\x00\x74\x06\x89\x86\x00\x00\x00\x00\x8B\x86"), "00????0000????00").Base;
        if (dwWeaponTableIndex)
        {
            dwWeaponTableIndex = *(DWORD*)(dwWeaponTableIndex + 0x2);
        }
    } while (!dwWeaponTableIndex);

    do
    {
        dwYawPtr = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x81\xF9\x00\x00\x00\x00\x75\x1D\xF3\x0F\x10\x05\x00\x00\x00\x00\xF3\x0F\x11\x44\x24\x00\x8B\x44\x24\x1C\x35\x00\x00\x00\x00\x89\x44\x24\x18\xEB\x0B\x8B\x01\x8B\x40\x30\xFF\xD0\xD9\x5C\x24\x18\xF3\x0F\x10\x06"), "00????000000????00000?00000????000000000000000000000").Base;
        if (dwYawPtr)
        {
            dwYawPtr = *(DWORD*)(dwYawPtr + 0x2);
            dwYawPtr -= gameModule;
        }
    } while (!dwYawPtr);

    do
    {
        dwZoomSensitivityRatioPtr = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x81\xF9\x00\x00\x00\x00\x75\x1A\xF3\x0F\x10\x05\x00\x00\x00\x00\xF3\x0F\x11\x45\x00\x8B\x45\xF4\x35\x00\x00\x00\x00\x89\x45\xFC\xEB\x0A\x8B\x01\x8B\x40\x30\xFF\xD0\xD9\x5D\xFC\xA1"), "00????000000????0000?0000????0000000000000000").Base;
        if (dwZoomSensitivityRatioPtr)
        {
            dwZoomSensitivityRatioPtr = *(DWORD*)(dwZoomSensitivityRatioPtr + 0x2);
            dwZoomSensitivityRatioPtr -= gameModule;
        }
    } while (!dwZoomSensitivityRatioPtr);

    do
    {
        dwbSendPackets = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\xB3\x01\x8B\x01\x8B\x40\x10\xFF\xD0\x84\xC0\x74\x0F\x80\xBF\x00\x00\x00\x00\x00\x0F\x84"), "000000000000000?????00").Base;
        if (dwbSendPackets)
        {
            dwbSendPackets -= gameEngine;
            dwbSendPackets = (DWORD)(dwbSendPackets - 0xE);
        }
    } while (!dwbSendPackets);


    do
    {
        dwppDirect3DDevice9 = CSGO::FindPattern(shaderapidx9, 0xFFFFFFF, (PBYTE)("\xA1\x00\x00\x00\x00\x50\x8B\x08\xFF\x51\x0C"), "0????000000").Base;
        if (dwppDirect3DDevice9)
        {
            dwppDirect3DDevice9 = *(DWORD*)(dwppDirect3DDevice9 + 0x1);
            dwppDirect3DDevice9 -= shaderapidx9;
        }
    } while (!dwppDirect3DDevice9);

    do
    {
        m_pStudioHdr = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x8B\xB6\x00\x00\x00\x00\x85\xF6\x74\x05\x83\x3E\x00\x75\x02\x33\xF6\xF3\x0F\x10\x44\x24"), "00????000000?000000000").Base;
        if (m_pStudioHdr)
        {
            m_pStudioHdr = *(DWORD*)(m_pStudioHdr + 0x2);
            m_pStudioHdr -= gameModule;
        }
    } while (!m_pStudioHdr);

    do
    {
        m_yawClassPtr = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x81\xF9\x00\x00\x00\x00\x75\x16\xF3\x0F\x10\x05\x00\x00\x00\x00\xF3\x0F\x11\x45\x00\x81\x75\x00\x00\x00\x00\x00\xEB\x0A\x8B\x01\x8B\x40\x30\xFF\xD0\xD9\x5D\x0C\x8B\x55\x08"), "00????000000????0000?00?????000000000000000").Base;
        if (m_yawClassPtr)
        {
            m_yawClassPtr = *(DWORD*)(m_yawClassPtr + 0x2);
            m_yawClassPtr -= gameModule;
        }
    } while (!m_yawClassPtr);

    do
    {
        m_pitchClassPtr = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\xA1\x00\x00\x00\x00\x89\x74\x24\x28"), "0????0000").Base;
        if (m_pitchClassPtr)
        {
            m_pitchClassPtr = *(DWORD*)(m_pitchClassPtr + 0x1);
            m_pitchClassPtr -= gameModule;
        }
    } while (!m_pitchClassPtr);

    do
    {
        interface_engine_cvar = CSGO::FindPattern(vstdlib, 0xFFFFFFF, (PBYTE)("\x8B\x0D\x00\x00\x00\x00\xC7\x05"), "00????00").Base;
        if (interface_engine_cvar)
        {
            interface_engine_cvar = *(DWORD*)(interface_engine_cvar + 0x2);
            interface_engine_cvar -= vstdlib;
        }
    } while (!interface_engine_cvar);

    do
    {
        m_bDormant = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x8A\x81\x00\x00\x00\x00\xC3\x32\xC0"), "00????000").Base;
        if (m_bDormant)
        {
            m_bDormant = *(DWORD*)(m_bDormant + 0x2);
            m_bDormant -= gameModule;
            m_bDormant = (BYTE)(m_bDormant + 0x8);
        }
    } while (!m_bDormant);

    do
    {
        model_ambient_min = CSGO::FindPattern(gameEngine, 0xFFFFFFF, (PBYTE)("\xF3\x0F\x10\x0D\x00\x00\x00\x00\xF3\x0F\x11\x4C\x24\x00\x8B\x44\x24\x20\x35\x00\x00\x00\x00\x89\x44\x24\x0C"), "0000????00000?00000????0000").Base;
        if (model_ambient_min)
        {
            model_ambient_min = *(DWORD*)(model_ambient_min + 0x4);
            model_ambient_min -= gameEngine;
        }
    } while (!model_ambient_min);

    do
    {
        set_abs_angles = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x55\x8B\xEC\x83\xE4\xF8\x83\xEC\x64\x53\x56\x57\x8B\xF1\xE8"), "000000000000000").Base;
        if (set_abs_angles)
        {
            set_abs_angles -= gameModule;
        }
    } while (!set_abs_angles);

    do
    {
        set_abs_origin = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x55\x8B\xEC\x83\xE4\xF8\x51\x53\x56\x57\x8B\xF1\xE8"), "0000000000000").Base;
        if (set_abs_origin)
        {
            set_abs_origin -= gameModule;
        }
    } while (!set_abs_origin);


    do
    {
        is_c4_owner = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x56\x8B\xF1\x85\xF6\x74\x31"), "0000000").Base;
        if (is_c4_owner)
        {
            is_c4_owner -= gameModule;
        }
    } while (!is_c4_owner);


    do
    {
        force_update_spectator_glow = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x74\x07\x8B\xCB\xE8\x00\x00\x00\x00\x83\xC7\x10"), "00000????000").Base;
        if (force_update_spectator_glow)
        {
            force_update_spectator_glow -= gameModule;
        }
    } while (!force_update_spectator_glow);

    do
    {
        anim_overlays = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x8B\x89\x00\x00\x00\x00\x8D\x0C\xD1"), "00????000").Base;
        if (anim_overlays)
        {
            anim_overlays = *(DWORD*)(anim_overlays + 0x2);
        }
    } while (!anim_overlays);

    do
    {
        m_flSpawnTime = CSGO::FindPattern(gameModule, 0xFFFFFFF, (PBYTE)("\x89\x86\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x80\xBE\x00\x00\x00\x00\x00"), "00????0????00?????").Base;
        if (m_flSpawnTime)
        {
            m_flSpawnTime = *(DWORD*)(m_flSpawnTime + 0x2);
        }
    } while (!m_flSpawnTime);
进一步的头文件FindPattern.h:
C++:
#pragma once
#ifndef __FIND_PATTERN_H__
#define __FIND_PATTERN_H__

using namespace std;

#include <Windows.h>

namespace CSGO
{
    class FindPattern
    {
    public:
        FindPattern(DWORD dwAddress, DWORD len, BYTE* bMask, char* szMask) : Base(0), Offset(0)
        {
            BYTE* data = new BYTE[len];
            for (DWORD i = 0; i < len; i++)
            {
                if (bCompare((BYTE*)(dwAddress + i), bMask, szMask))
                {
                    Base = (DWORD)(dwAddress + i);
                    Offset = i;
                    break;
                }
            }
            delete[] data;
        }
        static HANDLE pHandle;
        DWORD Base, Offset;
    private:
        bool bCompare(const BYTE* pData, const BYTE* pMask, const char* pszMask)
        {
            for (; *pszMask; ++pData, ++pMask, ++pszMask)
            {
                if (*pszMask == '0' && *pData != *pMask)
                    return false;
            }
            return (*pszMask == NULL);
        }
    };
}
#endif
hack.h
C++:
#ifndef _HACK_H_
#define _HACK_H_

#pragma once
#include "stdafx.h"

class cHack
{
public:
    // Methods
    static BOOL WINAPI EntryPoint(LPVOID);
    static BOOL WINAPI Prepare(VOID);
    static bool isgetaddress;

    // Properties
    static DWORD gameModule, gameEngine, * localPlayer;
    static DWORD dwLocalPlayer;
};
#endif
本指南中对此文件或文件的工作原理进行了大致解释:https://hvh.black/threads/31/。
此外,stdafx.h是一个单独的文件,建议在项目属性中禁用头文件。
C++:
#include <Windows.h>
#include "FindPattern.h"
DllMain.h:
C++:
#include "stdafx.h"
#include "Hack.h"
实际上,在这里,cHack::EntryPoint在Hack.cpp中指定的class方法的线程中有一个调用。并同时输出偏移量以检查模板是否正常工作。dllmain.cpp:
C++:
#include "DllMain.h"
#include <iostream>

BOOL WINAPI DllMain(HMODULE hDLL, DWORD dwReason, LPVOID lpvRe)
{

    switch (dwReason)
    {
    case DLL_PROCESS_ATTACH:
        DisableThreadLibraryCalls(hDLL);
        AllocConsole();
        freopen("CONOUT$", "w", stdout);
        freopen("CONIN$", "r", stdin);
        CreateThread(0, 0, (LPTHREAD_START_ROUTINE)cHack::EntryPoint, 0, 0, 0);
        break;
    case DLL_PROCESS_DETACH:
        break;
    }
    return true;
}
指南到此结束!
您可以在此处检查编译的dll:
 

附件