Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Гайд Пишем glow для контар стрика 2

А не желаешь объяснить в чём суть настроек с первой пикчи? Вдруг у меня не будет мотивации даже их выставлять, потому что нихуя не понятно зачем оно
я делал через дллку которую надо инжектить в кс а не экзешник
 
попробуй логи добавить
std::cout << "Debug info:" << std::endl;
std::cout << " current: 0x" << std::hex << current << std::endl;
std::cout << " glow_base: 0x" << glow_base << std::endl;
std::cout << " glow_color_override: 0x" << glow_color_override << std::endl;
std::cout << " glow_enable: 0x" << glow_enable << std::dec << std::endl;

по типу такого
и это в начало функции
if (!current) return;
ну и чекни оффсеты мб с ними обделался
я нажимаю инжект и нет нихув
 
братан, ну ты хотя бы пиши, что через оффсет детектится, или ты сам об этом не знаешь?
тип сделал гайд для пастерков, я думаю тут все поймут что это надо инжектить только с -insecure, ты ему че то про детект говоришь.
ты на приколе?
 
uint64_t client_base = (uint64_t)GetModuleHandleA("client.dll"); if (!client_base) { Sleep(100); continue; }
ты хотя бы с цикла вытащил это если вообще молчать что glow детектится с времен csgo и кидает сразу в ред траст
 
Помоги пж я вроде сделал как у тебя написано но это не работает
код:
Expand Collapse Copy
import pymem, pymem.process, requests

offsets = requests.get('https://raw.githubusercontent.com/a2x/cs2-dumper/main/output/offsets.json').json()
client_dll = requests.get('https://raw.githubusercontent.com/a2x/cs2-dumper/refs/heads/main/output/client_dll.json').json()

dwEntityList = offsets['client.dll']['dwEntityList']
dwLocalPlayerPawn = offsets['client.dll']['dwLocalPlayerPawn']
m_hPlayerPawn = client_dll['client.dll']['classes']['CCSPlayerController']['fields']['m_hPlayerPawn']
m_iTeamNum = client_dll['client.dll']['classes']['C_BaseEntity']['fields']['m_iTeamNum']
m_lifeState = client_dll['client.dll']['classes']['C_BaseEntity']['fields']['m_lifeState']

m_Glow = client_dll['client.dll']['classes']['C_BaseModelEntity']['fields']['m_Glow']
m_glowColorOverride = client_dll['client.dll']['classes']['CGlowProperty']['fields']['m_glowColorOverride']
m_bGlowing = client_dll['client.dll']['classes']['CGlowProperty']['fields']['m_bGlowing']

pm = pymem.Pymem("cs2.exe")
client = pymem.process.module_from_name(pm.process_handle, "client.dll").lpBaseOfDll

while True:
    for i in range(64):
        try:
            playerPawn = pm.read_longlong(client + dwLocalPlayerPawn)
            entityList = pm.read_longlong(client + dwEntityList)
            listEntry  = pm.read_longlong(entityList + 0x10)

            currentController = pm.read_longlong(listEntry + i * 0x70)
            if currentController == 0:
                continue
 
            pawnHandle = pm.read_int(currentController + m_hPlayerPawn) & 0xFFFFFFFF
            if pawnHandle == 0:
                continue
 
            listEntry  = pm.read_longlong(entityList + (0x8 * ((pawnHandle & 0x7FFF) >> 9) + 0x10)) 
            if listEntry == 0:
                continue
 
            currentPawn = pm.read_longlong(listEntry + (0x70 * (pawnHandle & 0x1FF)))
            if currentPawn == 0:
                continue

            currentPawnLifeState = pm.read_int(currentPawn + m_lifeState)
            if currentPawnLifeState != 256:
                continue

            currentPawnTeam = pm.read_int(currentPawn + m_iTeamNum)
            currentPlayerTeam = pm.read_int(playerPawn + m_iTeamNum)

            if currentPawnTeam == currentPlayerTeam:
                continue


            glowBase = pm.read_longlong(currentPawn + m_Glow)
            if glowBase == 0:
                continue

            glowColorOverride = pm.read_int(glowBase + m_glowColorOverride)
            if glowColorOverride == 0:
                continue

            Glowing = pm.read_bool(glowBase + m_bGlowing)
            if Glowing == 0:
                continue

            pm.write_int(glowColorOverride, 16711680)
            pm.write_bool(Glowing, True)
            
            print(glowColorOverride, Glowing)

        except Exception as e:
            print(e)
 
всем ку! я начинающий говнокодер и сегодня хочу скинуть вам гайд как писать glow есп
оффсеты брал с ghidra и
Пожалуйста, авторизуйтесь для просмотра ссылки.
(noad)
сначала перейдите в свойства проекта и поставьте такие настройки
Посмотреть вложение 325069Посмотреть вложение 325070
после того как все тут поставили как надо создаете файл dllMain.cpp
и погнали говнокодить
сначала напишем класс чтобы проверять жив ли указатель на который мы будем применять glow


C++:
Expand Collapse Copy
#include <Windows.h>
#include <cstdint>
#include "offsets.hpp"
#include "client_dll.hpp"

#define ENTITY_ENTRY_SIZE 0x70

class PtrValidator {
private:
    static constexpr size_t CACHE_SIZE = 4096;
    struct CacheEntry {
        void* base;
        size_t region_size;
        DWORD state;
        DWORD protect;
        DWORD time;
    };

    static CacheEntry cache[CACHE_SIZE];
    static DWORD last_check;

    static bool CheckAndCache(void* ptr) {
        MEMORY_BASIC_INFORMATION mbi;
        if (VirtualQuery(ptr, &mbi, sizeof(mbi)) == 0)
            return false;

        size_t index = (reinterpret_cast<uintptr_t>(ptr) >> 12) % CACHE_SIZE;
        cache[index] = {
            mbi.BaseAddress,
            mbi.RegionSize,
            mbi.State,
            mbi.Protect,
            GetTickCount()
        };

        return (mbi.State == MEM_COMMIT) &&
            ((mbi.Protect & PAGE_NOACCESS) == 0);
    }

public:
    static bool IsValidPtr(void* ptr) {
        if (!ptr) return false;

        size_t index = (reinterpret_cast<uintptr_t>(ptr) >> 12) % CACHE_SIZE;
        auto& entry = cache[index];

        DWORD current_time = GetTickCount();
        if (entry.base &&
            current_time - entry.time < 1000 &&
            reinterpret_cast<uintptr_t>(ptr) >= reinterpret_cast<uintptr_t>(entry.base) &&
            reinterpret_cast<uintptr_t>(ptr) < reinterpret_cast<uintptr_t>(entry.base) + entry.region_size) {

            return (entry.state == MEM_COMMIT) &&
                ((entry.protect & PAGE_NOACCESS) == 0);
        }

        return CheckAndCache(ptr);
    }
};

PtrValidator::CacheEntry PtrValidator::cache[CACHE_SIZE] = {};
DWORD PtrValidator::last_check = 0;


после этого напишем саму функцию glow
C++:
Expand Collapse Copy
void glow(uint64_t current) {
    if (!PtrValidator::IsValidPtr((void*)current)) return;

    uint64_t glowBase = current + cs2_dumper::schemas::client_dll::C_BaseModelEntity::m_Glow;
    if (!PtrValidator::IsValidPtr((void*)glowBase)) return;

    uint64_t glowColorOverride = glowBase + cs2_dumper::schemas::client_dll::CGlowProperty::m_glowColorOverride;
    uint64_t glowEnable = glowBase + cs2_dumper::schemas::client_dll::CGlowProperty::m_bGlowing;

    if (!PtrValidator::IsValidPtr((void*)glowColorOverride) || !PtrValidator::IsValidPtr((void*)glowEnable)) return;

    *(uint32_t*)(glowColorOverride) = 0x800000FF; //если хотите можете тут свой цвет поставить
    *(bool*)(glowEnable) = true;
}

теперь давайте реализуем главную функцию где мы будем получать список игроков, жив игрок или мертв и после этого применять на него glow
C++:
Expand Collapse Copy
DWORD WINAPI Main(LPVOID) {
    while (true) {
        uint64_t client_base = (uint64_t)GetModuleHandleA("client.dll");
        if (!client_base) { Sleep(100); continue; }

        uint64_t entity_list = *(uint64_t*)(client_base + cs2_dumper::offsets::client_dll::dwEntityList);
        if (!entity_list) { Sleep(100); continue; }

        uint64_t local = *(uint64_t*)(client_base + cs2_dumper::offsets::client_dll::dwLocalPlayerPawn);
        if (!local) { Sleep(10); continue; }

        uint8_t teamNum = *(uint8_t*)(local + cs2_dumper::schemas::client_dll::C_BaseEntity::m_iTeamNum);

        for (int i = 0; i < 64; i++) {
            uint64_t list_entry = *(uint64_t*)(entity_list + 0x10);
            if (!list_entry) continue;

            uint64_t controller = *(uint64_t*)(list_entry + 0x70 * (i & 0x1FF));
            if (!controller) continue;

            uint32_t pawnHandle = *(uint32_t*)(controller + cs2_dumper::schemas::client_dll::CCSPlayerController::m_hPlayerPawn);
            if (!pawnHandle) continue;

            uint64_t p_chunk = *(uint64_t*)(entity_list + 8 * ((pawnHandle & 0x7FFF) >> 9) + 0x10);
            if (!p_chunk) continue;

            uint64_t current_pawn = *(uint64_t*)(p_chunk + 0x70 * (pawnHandle & 0x1FF));
            if (!current_pawn || current_pawn == local) continue;

            int alive = *(int*)(current_pawn + cs2_dumper::schemas::client_dll::C_BaseEntity::m_lifeState);
            if (alive != 256) continue;


            uint8_t currentTeamNum = *(uint8_t*)(current_pawn + cs2_dumper::schemas::client_dll::C_BaseEntity::m_iTeamNum);

            if (currentTeamNum != teamNum) {
                glow(current_pawn);
            }
        }

        Sleep(0);
    }
    return 0;
}

и не забудем про точку входа
C++:
Expand Collapse Copy
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
    if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
        DisableThreadLibraryCalls(hModule);
        CreateThread(nullptr, 0, Main, nullptr, 0, nullptr);
    }
    return TRUE;
}

вуаля! мы написали простое glow esp на cs2 если юзаете extreme injector и подобное то инжектить мануал мапом
это мой первый пост не пиздите палками
вот полный код кому влом читать

C++:
Expand Collapse Copy
#include <Windows.h>
#include <cstdint>
#include "offsets.hpp"
#include "client_dll.hpp"

#define ENTITY_ENTRY_SIZE 0x70

class PtrValidator {
private:
    static constexpr size_t CACHE_SIZE = 4096;
    struct CacheEntry {
        void* base;
        size_t region_size;
        DWORD state;
        DWORD protect;
        DWORD time;
    };

    static CacheEntry cache[CACHE_SIZE];
    static DWORD last_check;

    static bool CheckAndCache(void* ptr) {
        MEMORY_BASIC_INFORMATION mbi;
        if (VirtualQuery(ptr, &mbi, sizeof(mbi)) == 0)
            return false;

        size_t index = (reinterpret_cast<uintptr_t>(ptr) >> 12) % CACHE_SIZE;
        cache[index] = {
            mbi.BaseAddress,
            mbi.RegionSize,
            mbi.State,
            mbi.Protect,
            GetTickCount()
        };

        return (mbi.State == MEM_COMMIT) &&
            ((mbi.Protect & PAGE_NOACCESS) == 0);
    }

public:
    static bool IsValidPtr(void* ptr) {
        if (!ptr) return false;

        size_t index = (reinterpret_cast<uintptr_t>(ptr) >> 12) % CACHE_SIZE;
        auto& entry = cache[index];

        DWORD current_time = GetTickCount();
        if (entry.base &&
            current_time - entry.time < 1000 &&
            reinterpret_cast<uintptr_t>(ptr) >= reinterpret_cast<uintptr_t>(entry.base) &&
            reinterpret_cast<uintptr_t>(ptr) < reinterpret_cast<uintptr_t>(entry.base) + entry.region_size) {

            return (entry.state == MEM_COMMIT) &&
                ((entry.protect & PAGE_NOACCESS) == 0);
        }

        return CheckAndCache(ptr);
    }
};

PtrValidator::CacheEntry PtrValidator::cache[CACHE_SIZE] = {};
DWORD PtrValidator::last_check = 0;
void glow(uint64_t current) {
    if (!PtrValidator::IsValidPtr((void*)current)) return;

    uint64_t glowBase = current + cs2_dumper::schemas::client_dll::C_BaseModelEntity::m_Glow;
    if (!PtrValidator::IsValidPtr((void*)glowBase)) return;

    uint64_t glowColorOverride = glowBase + cs2_dumper::schemas::client_dll::CGlowProperty::m_glowColorOverride;
    uint64_t glowEnable = glowBase + cs2_dumper::schemas::client_dll::CGlowProperty::m_bGlowing;

    if (!PtrValidator::IsValidPtr((void*)glowColorOverride) || !PtrValidator::IsValidPtr((void*)glowEnable)) return;

    *(uint32_t*)(glowColorOverride) = 0x800000FF;
    *(bool*)(glowEnable) = true;
}

DWORD WINAPI Main(LPVOID) {
    while (true) {
        uint64_t client_base = (uint64_t)GetModuleHandleA("client.dll");
        if (!client_base) { Sleep(100); continue; }

        uint64_t entity_list = *(uint64_t*)(client_base + cs2_dumper::offsets::client_dll::dwEntityList);
        if (!entity_list) { Sleep(100); continue; }

        uint64_t local = *(uint64_t*)(client_base + cs2_dumper::offsets::client_dll::dwLocalPlayerPawn);
        if (!local) { Sleep(10); continue; }

        uint8_t teamNum = *(uint8_t*)(local + cs2_dumper::schemas::client_dll::C_BaseEntity::m_iTeamNum);

        for (int i = 0; i < 64; i++) {
            uint64_t list_entry = *(uint64_t*)(entity_list + 0x10);
            if (!list_entry) continue;

            uint64_t controller = *(uint64_t*)(list_entry + 0x70 * (i & 0x1FF));
            if (!controller) continue;

            uint32_t pawnHandle = *(uint32_t*)(controller + cs2_dumper::schemas::client_dll::CCSPlayerController::m_hPlayerPawn);
            if (!pawnHandle) continue;

            uint64_t p_chunk = *(uint64_t*)(entity_list + 8 * ((pawnHandle & 0x7FFF) >> 9) + 0x10);
            if (!p_chunk) continue;

            uint64_t current_pawn = *(uint64_t*)(p_chunk + 0x70 * (pawnHandle & 0x1FF));
            if (!current_pawn || current_pawn == local) continue;

            int alive = *(int*)(current_pawn + cs2_dumper::schemas::client_dll::C_BaseEntity::m_lifeState);
            if (alive != 256) continue;


            uint8_t currentTeamNum = *(uint8_t*)(current_pawn + cs2_dumper::schemas::client_dll::C_BaseEntity::m_iTeamNum);

            if (currentTeamNum != teamNum) {
                glow(current_pawn);
            }
        }

        Sleep(0);
    }
    return 0;
}

BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
    if (ul_reason_for_call == DLL_PROCESS_ATTACH) {
        DisableThreadLibraryCalls(hModule);
        CreateThread(nullptr, 0, Main, nullptr, 0, nullptr);
    }
    return TRUE;
}
всем удачи
попрошу чамсы
 
Назад
Сверху Снизу