codesafety_x11repo

Untitled

Apr 26th, 2020
1,501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.64 KB | None | 0 0
  1. void wallhack()
  2. {
  3.    while (true) // создаем бесконечный цикл
  4.    {
  5.        Sleep(10); // таймаут 10 мс, чтобы не грузить процессор под 100
  6.        if (!wallhack && !readMem<DWORD>(readMem<DWORD>(clientBase + dwLocalPlayer) + 0xED)) // если вх выключено или не удается прочитать память - выходим из цикла
  7.            continue;
  8.  
  9.        DWORD glowObj = readMem<DWORD>(clientBase + dwGlowObjectManager); // создаем объект glowObj из модельки игрока
  10.        DWORD myTeam = readMem<DWORD>(readMem<DWORD>(clientBase + dwLocalPlayer) + m_iTeamNum); // создаем объект тиммейтов
  11.  
  12.        for (int x = 0; x < 32; x++) // сам вх
  13.        {
  14.            DWORD player = readMem<DWORD>(clientBase + dwEntityList + x * 0x10); // обычный игрок
  15.            if (player == 0)
  16.                continue;
  17.  
  18.            bool dormant = readMem<bool>(player + 0xED); // спектатор
  19.            if (dormant)
  20.                continue;
  21.  
  22.            DWORD team = readMem<DWORD>(player + m_iTeamNum); // тиммейт
  23.            if (team != 2 && team != 3)
  24.                continue;
  25.  
  26.            DWORD currentGlowIndex = readMem<DWORD>(player + m_iGlowIndex); // текущий индекс игрока
  27.  
  28.            if (team != myTeam) // если игрок не тиммейт
  29.            {
  30.                // делаем его обводку красным
  31.                writeMem<float>(glowObj + currentGlowIndex * 0x38 + 0x4, 255); // red
  32.                writeMem<float>(glowObj + currentGlowIndex * 0x38 + 0x8, 0); // green
  33.                writeMem<float>(glowObj + currentGlowIndex * 0x38 + 0xC, 0); // blue
  34.                writeMem<float>(glowObj + currentGlowIndex * 0x38 + 0x10, 255);
  35.                writeMem<bool>(glowObj + currentGlowIndex * 0x38 + 0x24, true);
  36.                writeMem<bool>(glowObj + currentGlowIndex * 0x38 + 0x25, false);
  37.            }
  38.            else // если игрок тиммейт
  39.            {
  40.                // делаем его обводку синим
  41.                writeMem<float>(glowObj + currentGlowIndex * 0x38 + 0x4, 0); // red
  42.                writeMem<float>(glowObj + currentGlowIndex * 0x38 + 0x8, 0); // green
  43.                writeMem<float>(glowObj + currentGlowIndex * 0x38 + 0xC, 255); // blue
  44.                writeMem<float>(glowObj + currentGlowIndex * 0x38 + 0x10, 255);
  45.                writeMem<bool>(glowObj + currentGlowIndex * 0x38 + 0x24, true);
  46.                writeMem<bool>(glowObj + currentGlowIndex * 0x38 + 0x25, false);
  47.            }
  48.        }
  49.    }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment