Вопрос Spec list dont work

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
2 Ноя 2024
Сообщения
42
Реакции
4
Код:
Expand Collapse Copy
static std::vector<std::string> get_spectators_raw() {
    std::vector<std::string> specs;
    const g_entity* local = cache.get_local();
    if (!local || !local->valid) return specs;

    uintptr_t local_target_pawn = local->pawn;

    if (!local->alive) {
        uintptr_t local_controller = local->controller;
        uintptr_t obs_services = _m::r<uintptr_t>(local_controller + 0x1148);
        if (obs_services) {
            int target_handle = _m::r<int>(obs_services + 0x44);
            if (target_handle > 0) {
                uintptr_t entity_list = _m::r<uintptr_t>(_m::baseAddress + c_strgame::c_offsets::client_dll::dwEntityList);
                if (entity_list) {
                    uintptr_t list_entry = _m::r<uintptr_t>(entity_list + (8 * ((target_handle & 0x7FFF) >> 9)) + 16);
                    if (list_entry) {
                        local_target_pawn = _m::r<uintptr_t>(list_entry + 120 * (target_handle & 0x1FF));
                    }
                }
            }
        }
    }

    if (!local_target_pawn) return specs;

    uintptr_t entity_list = _m::r<uintptr_t>(_m::baseAddress + c_strgame::c_offsets::client_dll::dwEntityList);
    if (!entity_list) return specs;

    for (int i = 1; i < 65; ++i) {
        uintptr_t list_entry = _m::r<uintptr_t>(entity_list + (8 * ((i & 0x7FFF) >> 9)) + 16);
        if (!list_entry) continue;

        uintptr_t controller = _m::r<uintptr_t>(list_entry + 112 * (i & 0x1FF));
        if (!controller || controller == local->controller) continue;

        int pawn_handle = _m::r<int>(controller + c_strgame::c_field::CCSPlayerController::m_hPlayerPawn);
        if (pawn_handle <= 0) continue;

        uintptr_t pawn_list_entry = _m::r<uintptr_t>(entity_list + (8 * ((pawn_handle & 0x7FFF) >> 9)) + 16);
        if (!pawn_list_entry) continue;

        uintptr_t pawn = _m::r<uintptr_t>(pawn_list_entry + 120 * (pawn_handle & 0x1FF));
        if (!pawn) continue;

        uintptr_t obs_services = _m::r<uintptr_t>(pawn + c_strgame::c_field::C_BasePlayerPawn::m_pObserverServices);
        if (!obs_services) continue;

        int target_handle = _m::r<int>(obs_services + c_strgame::c_field::CPlayer_ObserverServices::m_hObserverTarget) & 0x7FFF;
        if (target_handle <= 0) continue;

        uintptr_t target_list_entry = _m::r<uintptr_t>(entity_list + (8 * ((target_handle & 0x7FFF) >> 9)) + 16);
        if (!target_list_entry) continue;

        uintptr_t target_pawn = _m::r<uintptr_t>(target_list_entry + 120 * (target_handle & 0x1FF));
        if (target_pawn != local_target_pawn) continue;

        char name[128] = { 0 };
        NtReadVirtualMemory(_m::processHandle, (LPVOID)(controller + c_strgame::c_field::CBasePlayerController::m_iszPlayerName), name, 127, nullptr);

        int obs_mode = _m::r<int>(obs_services + c_strgame::c_field::CPlayer_ObserverServices::m_iObserverMode);
        std::string mode = (obs_mode == 4) ? "first-person" : "third-person";

        specs.push_back(std::string(name) + " [" + mode + "]");
    }

    return specs;
}
спектаторов не показывает кто знает в чем дело?
 
Код:
Expand Collapse Copy
static std::vector<std::string> get_spectators_raw() {
    std::vector<std::string> specs;
    const g_entity* local = cache.get_local();
    if (!local || !local->valid) return specs;

    uintptr_t local_target_pawn = local->pawn;

    if (!local->alive) {
        uintptr_t local_controller = local->controller;
        uintptr_t obs_services = _m::r<uintptr_t>(local_controller + 0x1148);
        if (obs_services) {
            int target_handle = _m::r<int>(obs_services + 0x44);
            if (target_handle > 0) {
                uintptr_t entity_list = _m::r<uintptr_t>(_m::baseAddress + c_strgame::c_offsets::client_dll::dwEntityList);
                if (entity_list) {
                    uintptr_t list_entry = _m::r<uintptr_t>(entity_list + (8 * ((target_handle & 0x7FFF) >> 9)) + 16);
                    if (list_entry) {
                        local_target_pawn = _m::r<uintptr_t>(list_entry + 120 * (target_handle & 0x1FF));
                    }
                }
            }
        }
    }

    if (!local_target_pawn) return specs;

    uintptr_t entity_list = _m::r<uintptr_t>(_m::baseAddress + c_strgame::c_offsets::client_dll::dwEntityList);
    if (!entity_list) return specs;

    for (int i = 1; i < 65; ++i) {
        uintptr_t list_entry = _m::r<uintptr_t>(entity_list + (8 * ((i & 0x7FFF) >> 9)) + 16);
        if (!list_entry) continue;

        uintptr_t controller = _m::r<uintptr_t>(list_entry + 112 * (i & 0x1FF));
        if (!controller || controller == local->controller) continue;

        int pawn_handle = _m::r<int>(controller + c_strgame::c_field::CCSPlayerController::m_hPlayerPawn);
        if (pawn_handle <= 0) continue;

        uintptr_t pawn_list_entry = _m::r<uintptr_t>(entity_list + (8 * ((pawn_handle & 0x7FFF) >> 9)) + 16);
        if (!pawn_list_entry) continue;

        uintptr_t pawn = _m::r<uintptr_t>(pawn_list_entry + 120 * (pawn_handle & 0x1FF));
        if (!pawn) continue;

        uintptr_t obs_services = _m::r<uintptr_t>(pawn + c_strgame::c_field::C_BasePlayerPawn::m_pObserverServices);
        if (!obs_services) continue;

        int target_handle = _m::r<int>(obs_services + c_strgame::c_field::CPlayer_ObserverServices::m_hObserverTarget) & 0x7FFF;
        if (target_handle <= 0) continue;

        uintptr_t target_list_entry = _m::r<uintptr_t>(entity_list + (8 * ((target_handle & 0x7FFF) >> 9)) + 16);
        if (!target_list_entry) continue;

        uintptr_t target_pawn = _m::r<uintptr_t>(target_list_entry + 120 * (target_handle & 0x1FF));
        if (target_pawn!= local_target_pawn) continue;

        char name[128] = {0 };
        NtReadVirtualMemory(_m::processHandle, (LPVOID)(controller + c_strgame::c_field::CBasePlayerController::m_iszPlayerName), name, 127, nullptr);

        int obs_mode = _m::r<int>(obs_services + c_strgame::c_field::CPlayer_ObserverServices::m_iObserverMode);
        std::string mode = (obs_mode == 4) ? "first-person": "third-person";

        specs.push_back(std::string(name) + " [" + mode + "]");
    }

    return specs;
}
it doesn’t show the performers who knows what’s going on?
may be stupid question, but are you sure your offsets are up to date?
 
Назад
Сверху Снизу