Вопрос Autowall not working

  • Автор темы Автор темы Tareshi
  • Дата начала Дата начала
Начинающий
Начинающий
Статус
Оффлайн
Регистрация
10 Июн 2021
Сообщения
4
Реакции
0
okay so my autowall is not working i tried searching and using others but they aren't still working so anyone knows how to fix it? :D
 
Superior pasted autowall from csgosimple. Works fine for me

Сигнатуры вроде правильные, ошибок нет = проблем нет
C++:
Expand Collapse Copy
#include "autowall.hpp"
#define HITGROUP_GENERIC 0
#define HITGROUP_HEAD 1
#define HITGROUP_CHEST 2
#define HITGROUP_STOMACH 3
#define HITGROUP_LEFTARM 4 
#define HITGROUP_RIGHTARM 5
#define HITGROUP_LEFTLEG 6
#define HITGROUP_RIGHTLEG 7
#define HITGROUP_GEAR 10
float Autowall::GetHitgroupDamageMultiplier(int iHitGroup)
{
    switch (iHitGroup)
    {
    case HITGROUP_GENERIC:
        return 0.5f;
    case HITGROUP_HEAD:
        return 2.0f;
    case HITGROUP_CHEST:
        return 0.5f;
    case HITGROUP_STOMACH:
        return 0.75f;
    case HITGROUP_LEFTARM:
        return 0.5f;
    case HITGROUP_RIGHTARM:
        return 0.5f;
    case HITGROUP_LEFTLEG:
        return 0.375f;
    case HITGROUP_RIGHTLEG:
        return 0.375f;
    case HITGROUP_GEAR:
        return 0.5f;
    default:
        return 1.0f;
    }
    return 1.0f;
}
void Autowall::ScaleDamage(int hitbox, C_BasePlayer* enemy, float weapon_armor_ratio, float& current_damage)
{
    current_damage *= Autowall::GetHitgroupDamageMultiplier(hitbox);
    if (enemy->m_ArmorValue() > 0)
    {
        if (hitbox == 8)
        {
            if (enemy->m_bHasHelmet())
                current_damage *= weapon_armor_ratio * 0.5f;
        }
        else
            current_damage *= weapon_armor_ratio * 0.5f;
    }
}
bool Autowall::TraceToExit(Vector& end, trace_t* enter_trace, Vector start, Vector dir, trace_t* exit_trace)
{
    float distance = 0.0f;
    while (distance <= 90.0f)
    {
        distance += 4.0f;
        end = start + dir * distance;
        auto point_contents = g_EngineTrace->GetPointContents(end, MASK_SHOT_HULL | CONTENTS_HITBOX, NULL);
        if (point_contents & MASK_SHOT_HULL && !(point_contents & CONTENTS_HITBOX))
            continue;
        auto new_end = end - (dir * 4.0f);
        Ray_t ray;
        ray.Init(end, new_end);
        g_EngineTrace->TraceRay(ray, MASK_SHOT, 0, exit_trace);
        if (exit_trace->startsolid && exit_trace->surface.flags & SURF_HITBOX)
        {
            ray.Init(end, start);
            CTraceFilter filter;
            filter.pSkip = exit_trace->hit_entity;
            g_EngineTrace->TraceRay(ray, 0x600400B, &filter, exit_trace);
            if ((exit_trace->fraction < 1.0f || exit_trace->allsolid) && !exit_trace->startsolid)
            {
                end = exit_trace->endpos;
                return true;
            }
            continue;
        }
        if (!(exit_trace->fraction < 1.0 || exit_trace->allsolid || exit_trace->startsolid) || exit_trace->startsolid)
        {
            if (exit_trace->hit_entity)
            {
                if (enter_trace->hit_entity && enter_trace->hit_entity == g_EntityList->GetClientEntity(0))
                    return true;
            }
            continue;
        }
        if (exit_trace->surface.flags >> 7 & 1 && !(enter_trace->surface.flags >> 7 & 1))
            continue;
        if (exit_trace->plane.normal.Dot(dir) <= 1.0f)
        {
            auto fraction = exit_trace->fraction * 4.0f;
            end = end - (dir * fraction);
            return true;
        }
    }
    return false;
}
bool Autowall::HandleBulletPenetration(CCSWeaponInfo* weaponInfo, FireBulletData& data)
{
    surfacedata_t* enter_surface_data = g_PhysSurface->GetSurfaceData(data.enter_trace.surface.surfaceProps);
    int enter_material = enter_surface_data->game.material;
    float enter_surf_penetration_mod = enter_surface_data->game.flPenetrationModifier;
    data.trace_length += data.enter_trace.fraction * data.trace_length_remaining;
    data.current_damage *= powf(weaponInfo->flRangeModifier, data.trace_length * 0.002f);
    if (data.trace_length > 3000.f || enter_surf_penetration_mod < 0.1f)
        data.penetrate_count = 0;
    if (data.penetrate_count <= 0)
        return false;
    Vector dummy;
    trace_t trace_exit;
    if (!TraceToExit(dummy, &data.enter_trace, data.enter_trace.endpos, data.direction, &trace_exit))
        return false;
    surfacedata_t* exit_surface_data = g_PhysSurface->GetSurfaceData(trace_exit.surface.surfaceProps);
    int exit_material = exit_surface_data->game.material;
    float exit_surf_penetration_mod = *(float*)((uint8_t*)exit_surface_data + 76);
    float final_damage_modifier = 0.16f;
    float combined_penetration_modifier = 0.0f;
    if ((data.enter_trace.contents & CONTENTS_GRATE) != 0 || enter_material == 89 || enter_material == 71)
    {
        combined_penetration_modifier = 3.0f;
        final_damage_modifier = 0.05f;
    }
    else
        combined_penetration_modifier = (enter_surf_penetration_mod + exit_surf_penetration_mod) * 0.5f;
    if (enter_material == exit_material)
    {
        if (exit_material == 87 || exit_material == 85)
            combined_penetration_modifier = 3.0f;
        else if (exit_material == 76)
            combined_penetration_modifier = 2.0f;
    }
    float v34 = fmaxf(0.f, 1.0f / combined_penetration_modifier);
    float v35 = (data.current_damage * final_damage_modifier) + v34 * 3.0f * fmaxf(0.0f, (3.0f / weaponInfo->flPenetration) * 1.25f);
    float thickness = (trace_exit.endpos - data.enter_trace.endpos).Length();
    thickness *= thickness;
    thickness *= v34;
    thickness /= 24.0f;
    float lost_damage = fmaxf(0.0f, v35 + thickness);
    if (lost_damage > data.current_damage)
        return false;
    if (lost_damage >= 0.0f)
        data.current_damage -= lost_damage;
    if (data.current_damage < 1.0f)
        return false;
    data.src = trace_exit.endpos;
    data.penetrate_count--;
    return true;
}
void TraceLine(Vector vecAbsStart, Vector vecAbsEnd, unsigned int mask, C_BasePlayer* ignore, trace_t* ptr)
{
    Ray_t ray;
    ray.Init(vecAbsStart, vecAbsEnd);
    CTraceFilter filter;
    filter.pSkip = ignore;
    g_EngineTrace->TraceRay(ray, mask, &filter, ptr);
}
bool Autowall::SimulateFireBullet(C_BaseCombatWeapon* pWeapon, FireBulletData& data)
{
    CCSWeaponInfo* weaponInfo = pWeapon->GetCSWeaponData();
    data.penetrate_count = 4;
    data.trace_length = 0.0f;
    data.current_damage = (float)weaponInfo->iDamage;
    while (data.penetrate_count > 0 && data.current_damage >= 1.0f)
    {
        data.trace_length_remaining = weaponInfo->flRange - data.trace_length;
        Vector end = data.src + data.direction * data.trace_length_remaining;
        // data.enter_trace
        TraceLine(data.src, end, MASK_SHOT, g_LocalPlayer, &data.enter_trace);
        Ray_t ray;
        ray.Init(data.src, end + data.direction * 40.f);
        g_EngineTrace->TraceRay(ray, MASK_SHOT, &data.filter, &data.enter_trace);
        TraceLine(data.src, end + data.direction * 40.f, MASK_SHOT, g_LocalPlayer, &data.enter_trace);
        if (data.enter_trace.fraction == 1.0f)
            break;
        if (data.enter_trace.hitgroup <= HITGROUP_RIGHTLEG && data.enter_trace.hitgroup > HITGROUP_GENERIC)
        {
            data.trace_length += data.enter_trace.fraction * data.trace_length_remaining;
            data.current_damage *= powf(weaponInfo->flRangeModifier, data.trace_length * 0.002f);
            C_BasePlayer* player = (C_BasePlayer*)data.enter_trace.hit_entity;
            Autowall::ScaleDamage(data.enter_trace.hitgroup, player, weaponInfo->flArmorRatio, data.current_damage);
            return true;
        }
        if (!HandleBulletPenetration(weaponInfo, data))
            break;
    }
    return false;
}
float Autowall::GetDamage(const Vector& point)
{
    float damage = 0.f;
    FireBulletData data;
    data.src = g_LocalPlayer->GetEyePos();
    data.filter.pSkip = g_LocalPlayer;
    data.direction = point - data.src;
    data.direction.NormalizeInPlace();
    C_BaseCombatWeapon* activeWeapon = (C_BaseCombatWeapon*)g_EntityList->GetClientEntityFromHandle(g_LocalPlayer->m_hActiveWeapon());
    if (!activeWeapon)
        return -1.0f;
    if (SimulateFireBullet(activeWeapon, data))
        damage = data.current_damage;
    return damage;
}

bool Autowall::IsBreakableEntity(IClientEntity* e){
    if (!e || !e->EntIndex())
        return false;

    static auto is_breakable = Utils::FindSignature("client.dll", "55 8B EC 51 56 8B F1 85 F6 74 68");

    auto take_damage = *(uintptr_t*)((uintptr_t)is_breakable + 0x26);
    auto backup = *(uint8_t*)((uintptr_t)e + take_damage);

    auto client_class = e->GetClientClass();
    auto network_name = client_class->m_pNetworkName;

    if (!strcmp(network_name, "CBreakableSurface"))
        *(uint8_t*)((uintptr_t)e + take_damage) = DAMAGE_YES;
    else if (!strcmp(network_name, "CBaseDoor") || !strcmp(network_name, "CDynamicProp"))
        *(uint8_t*)((uintptr_t)e + take_damage) = DAMAGE_NO;

    using Fn = bool(__thiscall*)(IClientEntity*);
    auto result = ((Fn)is_breakable)(e);

    *(uint8_t*)((uintptr_t)e + take_damage) = backup;
    return result;
}
 
Superior pasted autowall from csgosimple. Works fine for me

Сигнатуры вроде правильные, ошибок нет = проблем нет
C++:
Expand Collapse Copy
#include "autowall.hpp"
#define HITGROUP_GENERIC 0
#define HITGROUP_HEAD 1
#define HITGROUP_CHEST 2
#define HITGROUP_STOMACH 3
#define HITGROUP_LEFTARM 4
#define HITGROUP_RIGHTARM 5
#define HITGROUP_LEFTLEG 6
#define HITGROUP_RIGHTLEG 7
#define HITGROUP_GEAR 10
float Autowall::GetHitgroupDamageMultiplier(int iHitGroup)
{
    switch (iHitGroup)
    {
    case HITGROUP_GENERIC:
        return 0.5f;
    case HITGROUP_HEAD:
        return 2.0f;
    case HITGROUP_CHEST:
        return 0.5f;
    case HITGROUP_STOMACH:
        return 0.75f;
    case HITGROUP_LEFTARM:
        return 0.5f;
    case HITGROUP_RIGHTARM:
        return 0.5f;
    case HITGROUP_LEFTLEG:
        return 0.375f;
    case HITGROUP_RIGHTLEG:
        return 0.375f;
    case HITGROUP_GEAR:
        return 0.5f;
    default:
        return 1.0f;
    }
    return 1.0f;
}
void Autowall::ScaleDamage(int hitbox, C_BasePlayer* enemy, float weapon_armor_ratio, float& current_damage)
{
    current_damage *= Autowall::GetHitgroupDamageMultiplier(hitbox);
    if (enemy->m_ArmorValue() > 0)
    {
        if (hitbox == 8)
        {
            if (enemy->m_bHasHelmet())
                current_damage *= weapon_armor_ratio * 0.5f;
        }
        else
            current_damage *= weapon_armor_ratio * 0.5f;
    }
}
bool Autowall::TraceToExit(Vector& end, trace_t* enter_trace, Vector start, Vector dir, trace_t* exit_trace)
{
    float distance = 0.0f;
    while (distance <= 90.0f)
    {
        distance += 4.0f;
        end = start + dir * distance;
        auto point_contents = g_EngineTrace->GetPointContents(end, MASK_SHOT_HULL | CONTENTS_HITBOX, NULL);
        if (point_contents & MASK_SHOT_HULL && !(point_contents & CONTENTS_HITBOX))
            continue;
        auto new_end = end - (dir * 4.0f);
        Ray_t ray;
        ray.Init(end, new_end);
        g_EngineTrace->TraceRay(ray, MASK_SHOT, 0, exit_trace);
        if (exit_trace->startsolid && exit_trace->surface.flags & SURF_HITBOX)
        {
            ray.Init(end, start);
            CTraceFilter filter;
            filter.pSkip = exit_trace->hit_entity;
            g_EngineTrace->TraceRay(ray, 0x600400B, &filter, exit_trace);
            if ((exit_trace->fraction < 1.0f || exit_trace->allsolid) && !exit_trace->startsolid)
            {
                end = exit_trace->endpos;
                return true;
            }
            continue;
        }
        if (!(exit_trace->fraction < 1.0 || exit_trace->allsolid || exit_trace->startsolid) || exit_trace->startsolid)
        {
            if (exit_trace->hit_entity)
            {
                if (enter_trace->hit_entity && enter_trace->hit_entity == g_EntityList->GetClientEntity(0))
                    return true;
            }
            continue;
        }
        if (exit_trace->surface.flags >> 7 & 1 && !(enter_trace->surface.flags >> 7 & 1))
            continue;
        if (exit_trace->plane.normal.Dot(dir) <= 1.0f)
        {
            auto fraction = exit_trace->fraction * 4.0f;
            end = end - (dir * fraction);
            return true;
        }
    }
    return false;
}
bool Autowall::HandleBulletPenetration(CCSWeaponInfo* weaponInfo, FireBulletData& data)
{
    surfacedata_t* enter_surface_data = g_PhysSurface->GetSurfaceData(data.enter_trace.surface.surfaceProps);
    int enter_material = enter_surface_data->game.material;
    float enter_surf_penetration_mod = enter_surface_data->game.flPenetrationModifier;
    data.trace_length += data.enter_trace.fraction * data.trace_length_remaining;
    data.current_damage *= powf(weaponInfo->flRangeModifier, data.trace_length * 0.002f);
    if (data.trace_length > 3000.f || enter_surf_penetration_mod < 0.1f)
        data.penetrate_count = 0;
    if (data.penetrate_count <= 0)
        return false;
    Vector dummy;
    trace_t trace_exit;
    if (!TraceToExit(dummy, &data.enter_trace, data.enter_trace.endpos, data.direction, &trace_exit))
        return false;
    surfacedata_t* exit_surface_data = g_PhysSurface->GetSurfaceData(trace_exit.surface.surfaceProps);
    int exit_material = exit_surface_data->game.material;
    float exit_surf_penetration_mod = *(float*)((uint8_t*)exit_surface_data + 76);
    float final_damage_modifier = 0.16f;
    float combined_penetration_modifier = 0.0f;
    if ((data.enter_trace.contents & CONTENTS_GRATE) != 0 || enter_material == 89 || enter_material == 71)
    {
        combined_penetration_modifier = 3.0f;
        final_damage_modifier = 0.05f;
    }
    else
        combined_penetration_modifier = (enter_surf_penetration_mod + exit_surf_penetration_mod) * 0.5f;
    if (enter_material == exit_material)
    {
        if (exit_material == 87 || exit_material == 85)
            combined_penetration_modifier = 3.0f;
        else if (exit_material == 76)
            combined_penetration_modifier = 2.0f;
    }
    float v34 = fmaxf(0.f, 1.0f / combined_penetration_modifier);
    float v35 = (data.current_damage * final_damage_modifier) + v34 * 3.0f * fmaxf(0.0f, (3.0f / weaponInfo->flPenetration) * 1.25f);
    float thickness = (trace_exit.endpos - data.enter_trace.endpos).Length();
    thickness *= thickness;
    thickness *= v34;
    thickness /= 24.0f;
    float lost_damage = fmaxf(0.0f, v35 + thickness);
    if (lost_damage > data.current_damage)
        return false;
    if (lost_damage >= 0.0f)
        data.current_damage -= lost_damage;
    if (data.current_damage < 1.0f)
        return false;
    data.src = trace_exit.endpos;
    data.penetrate_count--;
    return true;
}
void TraceLine(Vector vecAbsStart, Vector vecAbsEnd, unsigned int mask, C_BasePlayer* ignore, trace_t* ptr)
{
    Ray_t ray;
    ray.Init(vecAbsStart, vecAbsEnd);
    CTraceFilter filter;
    filter.pSkip = ignore;
    g_EngineTrace->TraceRay(ray, mask, &filter, ptr);
}
bool Autowall::SimulateFireBullet(C_BaseCombatWeapon* pWeapon, FireBulletData& data)
{
    CCSWeaponInfo* weaponInfo = pWeapon->GetCSWeaponData();
    data.penetrate_count = 4;
    data.trace_length = 0.0f;
    data.current_damage = (float)weaponInfo->iDamage;
    while (data.penetrate_count > 0 && data.current_damage >= 1.0f)
    {
        data.trace_length_remaining = weaponInfo->flRange - data.trace_length;
        Vector end = data.src + data.direction * data.trace_length_remaining;
        // data.enter_trace
        TraceLine(data.src, end, MASK_SHOT, g_LocalPlayer, &data.enter_trace);
        Ray_t ray;
        ray.Init(data.src, end + data.direction * 40.f);
        g_EngineTrace->TraceRay(ray, MASK_SHOT, &data.filter, &data.enter_trace);
        TraceLine(data.src, end + data.direction * 40.f, MASK_SHOT, g_LocalPlayer, &data.enter_trace);
        if (data.enter_trace.fraction == 1.0f)
            break;
        if (data.enter_trace.hitgroup <= HITGROUP_RIGHTLEG && data.enter_trace.hitgroup > HITGROUP_GENERIC)
        {
            data.trace_length += data.enter_trace.fraction * data.trace_length_remaining;
            data.current_damage *= powf(weaponInfo->flRangeModifier, data.trace_length * 0.002f);
            C_BasePlayer* player = (C_BasePlayer*)data.enter_trace.hit_entity;
            Autowall::ScaleDamage(data.enter_trace.hitgroup, player, weaponInfo->flArmorRatio, data.current_damage);
            return true;
        }
        if (!HandleBulletPenetration(weaponInfo, data))
            break;
    }
    return false;
}
float Autowall::GetDamage(const Vector& point)
{
    float damage = 0.f;
    FireBulletData data;
    data.src = g_LocalPlayer->GetEyePos();
    data.filter.pSkip = g_LocalPlayer;
    data.direction = point - data.src;
    data.direction.NormalizeInPlace();
    C_BaseCombatWeapon* activeWeapon = (C_BaseCombatWeapon*)g_EntityList->GetClientEntityFromHandle(g_LocalPlayer->m_hActiveWeapon());
    if (!activeWeapon)
        return -1.0f;
    if (SimulateFireBullet(activeWeapon, data))
        damage = data.current_damage;
    return damage;
}

bool Autowall::IsBreakableEntity(IClientEntity* e){
    if (!e || !e->EntIndex())
        return false;

    static auto is_breakable = Utils::FindSignature("client.dll", "55 8B EC 51 56 8B F1 85 F6 74 68");

    auto take_damage = *(uintptr_t*)((uintptr_t)is_breakable + 0x26);
    auto backup = *(uint8_t*)((uintptr_t)e + take_damage);

    auto client_class = e->GetClientClass();
    auto network_name = client_class->m_pNetworkName;

    if (!strcmp(network_name, "CBreakableSurface"))
        *(uint8_t*)((uintptr_t)e + take_damage) = DAMAGE_YES;
    else if (!strcmp(network_name, "CBaseDoor") || !strcmp(network_name, "CDynamicProp"))
        *(uint8_t*)((uintptr_t)e + take_damage) = DAMAGE_NO;

    using Fn = bool(__thiscall*)(IClientEntity*);
    auto result = ((Fn)is_breakable)(e);

    *(uint8_t*)((uintptr_t)e + take_damage) = backup;
    return result;
}
это что еще бля за кринжа кусок
 
это что еще бля за кринжа кусок
Братан, если говоришь, что это кусок кринжа, то обоснуй хотя бы. Иначе, как мне кажется, возможность ставить клоуна у тебя заберут..
 
Братан, если говоришь, что это кусок кринжа, то обоснуй хотя бы. Иначе, как мне кажется, возможность ставить клоуна у тебя заберут..
бля чел тут даже пастер который неделю пастит поймет...
 
Братан, если говоришь, что это кусок кринжа, то обоснуй хотя бы. Иначе, как мне кажется, возможность ставить клоуна у тебя заберут..
у меня недопонимание того факта, что такое еще обосновывать надо и это не является очевидным
 
у меня недопонимание того факта, что такое еще обосновывать надо и это не является очевидным
бля чел тут даже пастер который неделю пастит поймет...
Ну, если к примеру вы оба понимаете, то сам чел - вряд ли, я не про объяснение конкретно мне.. Да это и не оч красиво, это тоже самое, что подойти к человеку, назвать его ебланом, а на его вопрос "Почему?" послать его нахер. Ладно, не буду оффтопить, просто забейте
 
это что еще бля за кринжа кусок
Написал же что спастил с какого-то сурса на симпле. И просто похуй, как оно работает, если фпс не дропается до 5, значит похуй:roflanBuldiga:

ОП попробовал множество других сурсов, я кинул ему ещё один, потому что он прям точно работает и не очень сложный. А если хочешь чтобы тут на ЮГ не было столько кринге, то придётся каждому 1 пастеру объяснять, что и как надо делать, но никто этим заниматься не будет :)
 
Последнее редактирование:
"55 8B EC 81 EC BC 00 00 00 56 8B F1 8B 86" + 0x226 that signature TraceFilterSkipTwoEntities
where ? xd
1642535539878.png
 
CTraceFilterSkipTwoEntities

search sig in setup hooks
Код:
Expand Collapse Copy
__forceinline void setup_hooks()
{

    // // // // // // // // // // // // // // // // // // // // // // //

    static auto getforeignfallbackfontname = (DWORD)(util::FindSignature(crypt_str("vguimatsurface.dll"), g_ctx.signatures.at(9).c_str()));
    hooks::original_getforeignfallbackfontname = (DWORD)DetourFunction((PBYTE)getforeignfallbackfontname, (PBYTE)hooks::hooked_getforeignfallbackfontname); //-V206

    // // // // // // // // // // // // // // // // // // // // // // //

    static auto setupbones = (DWORD)(util::FindSignature(crypt_str("client.dll"), g_ctx.signatures.at(10).c_str()));
    hooks::original_setupbones = (DWORD)DetourFunction((PBYTE)setupbones, (PBYTE)hooks::hooked_setupbones); //-V206

    // // // // // // // // // // // // // // // // // // // // // // //

    static auto doextrabonesprocessing = (DWORD)(util::FindSignature(crypt_str("client.dll"), g_ctx.signatures.at(11).c_str()));
    hooks::original_doextrabonesprocessing = (DWORD)DetourFunction((PBYTE)doextrabonesprocessing, (PBYTE)hooks::hooked_doextrabonesprocessing); //-V206

    // // // // // // // // // // // // // // // // // // // // // // //

    static auto standardblendingrules = (DWORD)(util::FindSignature(crypt_str("client.dll"), g_ctx.signatures.at(12).c_str()));
    hooks::original_standardblendingrules = (DWORD)DetourFunction((PBYTE)standardblendingrules, (PBYTE)hooks::hooked_standardblendingrules); //-V206

    // // // // // // // // // // // // // // // // // // // // // // //

    static auto updateclientsideanimation = (DWORD)(util::FindSignature(crypt_str("client.dll"), g_ctx.signatures.at(13).c_str()));
    hooks::original_updateclientsideanimation = (DWORD)DetourFunction((PBYTE)updateclientsideanimation, (PBYTE)hooks::hooked_updateclientsideanimation); //-V206

    // // // // // // // // // // // // // // // // // // // // // // //

    static auto physicssimulate = (DWORD)(util::FindSignature(crypt_str("client.dll"), g_ctx.signatures.at(14).c_str()));
    hooks::original_physicssimulate = (DWORD)DetourFunction((PBYTE)physicssimulate, (PBYTE)hooks::hooked_physicssimulate);

    // // // // // // // // // // // // // // // // // // // // // // //

    static auto modifyeyeposition = (DWORD)(util::FindSignature(crypt_str("client.dll"), g_ctx.signatures.at(15).c_str()));
    hooks::original_modifyeyeposition = (DWORD)DetourFunction((PBYTE)modifyeyeposition, (PBYTE)hooks::hooked_modifyeyeposition);

    // // // // // // // // // // // // // // // // // // // // // // //

    //auto pointer = util::FindSignature(crypt_str("engine.dll"), crypt_str(("55 8B EC 81 EC 64 01 00 00 53 56 57 8B 3D")));
    //hooks::original_clmove = (DWORD)DetourFunction((byte*)pointer, (byte*)hooks::hooked_clmove);

    // // // // // // // // // // // // // // // // // // // // // // //

    static auto calcviewmodelbob = (DWORD)(util::FindSignature(crypt_str("client.dll"), g_ctx.signatures.at(16).c_str()));
    hooks::original_calcviewmodelbob = (DWORD)DetourFunction((PBYTE)calcviewmodelbob, (PBYTE)hooks::hooked_calcviewmodelbob);

    // // // // // // // // // // // // // // // // // // // // // // //

    static auto shouldskipanimframe = (DWORD)(util::FindSignature(crypt_str("client.dll"), g_ctx.signatures.at(17).c_str()));
    DetourFunction((PBYTE)shouldskipanimframe, (PBYTE)hooks::hooked_shouldskipanimframe);

    // // // // // // // // // // // // // // // // // // // // // // //

    static auto checkfilecrcswithserver = (DWORD)(util::FindSignature(crypt_str("engine.dll"), g_ctx.signatures.at(18).c_str()));
    DetourFunction((PBYTE)checkfilecrcswithserver, (PBYTE)hooks::hooked_checkfilecrcswithserver);

    // // // // // // // // // // // // // // // // // // // // // // //

    static auto processinterpolatedlist = (DWORD)(util::FindSignature(crypt_str("client.dll"), g_ctx.signatures.at(19).c_str()));
    hooks::original_processinterpolatedlist = (DWORD)DetourFunction((byte*)processinterpolatedlist, (byte*)hooks::processinterpolatedlist); //-V206

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::client_hook = new vmthook(reinterpret_cast<DWORD**>(m_client()));
    hooks::client_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_fsn), 37); //-V107 //-V221
    hooks::client_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_writeusercmddeltatobuffer), 24); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::clientstate_hook = new vmthook(reinterpret_cast<DWORD**>((CClientState*)(uint32_t(m_clientstate()) + 0x8)));
    hooks::clientstate_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_packetstart), 5); //-V107 //-V221
    hooks::clientstate_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_packetend), 6); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::panel_hook = new vmthook(reinterpret_cast<DWORD**>(m_panel())); //-V1032
    hooks::panel_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_painttraverse), 41); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::clientmode_hook = new vmthook(reinterpret_cast<DWORD**>(m_clientmode()));
    hooks::clientmode_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_createmove), 24); //-V107 //-V221
    hooks::clientmode_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_postscreeneffects), 44); //-V107 //-V221
    hooks::clientmode_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_overrideview), 18); //-V107 //-V221
    hooks::clientmode_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_drawfog), 17); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::inputinternal_hook = new vmthook(reinterpret_cast<DWORD**>(m_inputinternal())); //-V114
    hooks::inputinternal_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_setkeycodestate), 91); //-V107 //-V221
    hooks::inputinternal_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_setmousecodestate), 92); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::engine_hook = new vmthook(reinterpret_cast<DWORD**>(m_engine()));
    hooks::engine_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_isconnected), 27); //-V107 //-V221
    hooks::engine_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_getscreenaspectratio), 101); //-V107 //-V221
    hooks::engine_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_ishltv), 93); //-V107 //-V221
    ///auto pointer = util::FindSignature(crypt_str("engine.dll"), crypt_str(("55 8B EC 81 EC 64 01 00 00 53 56 57 8B 3D"))); // just the basic. todo: get this better method.
    //hooks::original_clmove = (DWORD)DetourFunction((byte*)pointer, (byte*)hooks::hooked_clmove);
    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::renderview_hook = new vmthook(reinterpret_cast<DWORD**>(m_renderview()));
    hooks::renderview_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_sceneend), 9); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::materialsys_hook = new vmthook(reinterpret_cast<DWORD**>(m_materialsystem())); //-V1032
    hooks::materialsys_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_beginframe), 42); //-V107 //-V221
    hooks::materialsys_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_getmaterial), 84); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::modelrender_hook = new vmthook(reinterpret_cast<DWORD**>(m_modelrender()));
    hooks::modelrender_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_dme), 21); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::surface_hook = new vmthook(reinterpret_cast<DWORD**>(m_surface()));
    hooks::surface_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_lockcursor), 67); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::bspquery_hook = new vmthook(reinterpret_cast<DWORD**>(m_engine()->GetBSPTreeQuery()));
    hooks::bspquery_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_listleavesinbox), 6); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::prediction_hook = new vmthook(reinterpret_cast<DWORD**>(m_prediction())); //-V1032
    hooks::prediction_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_runcommand), 19); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::trace_hook = new vmthook(reinterpret_cast<DWORD**>(m_trace()));
    hooks::trace_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_clip_ray_collideable), 4); //-V107 //-V221
    hooks::trace_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_trace_ray), 5); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::filesystem_hook = new vmthook(reinterpret_cast<DWORD**>(util::FindSignature(crypt_str("engine.dll"), g_ctx.signatures.at(20).c_str()) + 0x2));
    hooks::filesystem_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_loosefileallowed), 128); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    while (!(INIT::Window = IFH(FindWindow)(crypt_str("Valve001"), nullptr)))
        std::this_thread::sleep_for(std::chrono::milliseconds(100));

    // // // // // // // // // // // // // // // // // // // // // // //

    INIT::OldWindow = (WNDPROC)IFH(SetWindowLongPtr)(INIT::Window, GWL_WNDPROC, (LONG_PTR)hooks::Hooked_WndProc);

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::directx_hook = new vmthook(reinterpret_cast<DWORD**>(m_device()));
    hooks::directx_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::Hooked_EndScene_Reset), 16); //-V107 //-V221
    hooks::directx_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::hooked_present), 17); //-V107 //-V221
    hooks::directx_hook->hook_function(reinterpret_cast<uintptr_t>(hooks::Hooked_EndScene), 42); //-V107 //-V221

    // // // // // // // // // // // // // // // // // // // // // // //

    hooks::hooked_events.RegisterSelf();
}
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Назад
Сверху Снизу