Подпишитесь на наш Telegram-канал, чтобы всегда быть в курсе важных обновлений! Перейти

Вопрос Крашит ayyware, при ключении аима

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
21 Мар 2017
Сообщения
134
Реакции
10
Крашит ayyware, при ключении аима, захожу на карту, проверяю визуалы -работают , нажимаю Active в легит боте нечего, потом нажимаю Enable в аиме, и крашит кс
Как фиксить ?
 
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Наверное, нужен код, тут гадать не умеют
 
Наверное, нужен код, тут гадать не умеют

interface.cpp
Код:
Expand Collapse Copy
#include "Interfaces.h"
#include "Utilities.h"

//SDK Specific Definitions
typedef void* (__cdecl* CreateInterface_t)(const char*, int*);
typedef void* (*CreateInterfaceFn)(const char *pName, int *pReturnCode);

//Some globals for later
CreateInterface_t EngineFactory = NULL; // These are used to store the individual
CreateInterface_t ClientFactory = NULL; //  CreateInterface functions for each game
CreateInterface_t VGUISurfaceFactory = NULL; //  dll that we need access to. Can call
CreateInterface_t VGUI2Factory = NULL; //  them to recieve pointers to game classes.
CreateInterface_t MatFactory = NULL;
CreateInterface_t PhysFactory = NULL;
CreateInterface_t StdFactory = NULL;

void Interfaces::Initialise()
{
    
    //Get function pointers to the CreateInterface function of each module
    EngineFactory = (CreateInterface_t)GetProcAddress((HMODULE)Offsets::Modules::Engine, "CreateInterface");
    ClientFactory = (CreateInterface_t)GetProcAddress((HMODULE)Offsets::Modules::Client, "CreateInterface");
    VGUI2Factory = (CreateInterface_t)GetProcAddress((HMODULE)Offsets::Modules::VGUI2, "CreateInterface");
    VGUISurfaceFactory = (CreateInterface_t)GetProcAddress((HMODULE)Offsets::Modules::VGUISurface, "CreateInterface");
    MatFactory = (CreateInterface_t)GetProcAddress((HMODULE)Offsets::Modules::Material, "CreateInterface");
    PhysFactory = (CreateInterface_t)GetProcAddress((HMODULE)Offsets::Modules::VPhysics, "CreateInterface");
    StdFactory = (CreateInterface_t)GetProcAddress((HMODULE)Offsets::Modules::Stdlib, "CreateInterface");

    //Get the interface names regardless of their version number by scanning for each string
    char* CHLClientInterfaceName = (char*)Utilities::Memory::FindTextPattern("client.dll", "VClient0");
    char* VGUI2PanelsInterfaceName = (char*)Utilities::Memory::FindTextPattern("vgui2.dll", "VGUI_Panel0");
    char* VGUISurfaceInterfaceName = (char*)Utilities::Memory::FindTextPattern("vguimatsurface.dll", "VGUI_Surface0");
    char* EntityListInterfaceName = (char*)Utilities::Memory::FindTextPattern("client.dll", "VClientEntityList0");
    char* EngineDebugThingInterface = (char*)Utilities::Memory::FindTextPattern("engine.dll", "VDebugOverlay0");
    char* EngineClientInterfaceName = (char*)Utilities::Memory::FindTextPattern("engine.dll","VEngineClient0");
    char* ClientPredictionInterface = (char*)Utilities::Memory::FindTextPattern("client.dll", "VClientPrediction0");
    char* MatSystemInterfaceName = (char*)Utilities::Memory::FindTextPattern("materialsystem.dll", "VMaterialSystem0");
    char* EngineRenderViewInterface = (char*)Utilities::Memory::FindTextPattern("engine.dll", "VEngineRenderView0");
    char* EngineModelRenderInterface = (char*)Utilities::Memory::FindTextPattern("engine.dll", "VEngineModel0");
    char* EngineModelInfoInterface = (char*)Utilities::Memory::FindTextPattern("engine.dll", "VModelInfoClient0");
    char* EngineTraceInterfaceName = (char*)Utilities::Memory::FindTextPattern("engine.dll", "EngineTraceClient0");
    char* PhysPropsInterfaces = (char*)Utilities::Memory::FindTextPattern("client.dll", "VPhysicsSurfaceProps0");
    char* VEngineCvarName = (char*)Utilities::Memory::FindTextPattern("engine.dll", "VEngineCvar00");

    // Use the factory function pointers along with the interface versions to grab
    //  pointers to the interfaces
    Client = (IBaseClientDLL*)ClientFactory(CHLClientInterfaceName, NULL);
    Engine = (IVEngineClient*)EngineFactory(EngineClientInterfaceName, NULL);
    Panels = (IPanel*)VGUI2Factory(VGUI2PanelsInterfaceName, NULL);
    Surface = (ISurface*)VGUISurfaceFactory(VGUISurfaceInterfaceName, NULL);
    EntList = (IClientEntityList*)ClientFactory(EntityListInterfaceName, NULL);
    DebugOverlay = (IVDebugOverlay*)EngineFactory(EngineDebugThingInterface, NULL);
    Prediction = (DWORD*)ClientFactory(ClientPredictionInterface, NULL);
    MaterialSystem = (CMaterialSystem*)MatFactory(MatSystemInterfaceName, NULL);
    RenderView = (CVRenderView*)EngineFactory(EngineRenderViewInterface, NULL);
    ModelRender = (IVModelRender*)EngineFactory(EngineModelRenderInterface, NULL);
    ModelInfo = (CModelInfo*)EngineFactory(EngineModelInfoInterface, NULL);
    Trace = (IEngineTrace*)EngineFactory(EngineTraceInterfaceName, NULL);
    PhysProps = (IPhysicsSurfaceProps*)PhysFactory(PhysPropsInterfaces, NULL);
    CVar = (ICVar*)StdFactory(VEngineCvarName, NULL);

    // Get ClientMode Pointer
    DWORD* ppClientMode;
    ppClientMode = nullptr; // before "scripts/vgui_screens.txt"
    DWORD p = Utilities::Memory::FindPattern("client.dll", (BYTE*)"\x8B\x0D\x00\x00\x00\x00\xFF\x75\x08\x8B\x01\xFF\x50\x64", "xx????xxxxxxxx");
    if (p)
    {
        ppClientMode = **(DWORD***)(p + 2);
        ClientMode = **(IClientModeShared***)((*(uintptr_t**)Client)[10] + 0x5);
    }
    
    // Search through the first entry of the Client VTable
    // The initializer contains a pointer to the 'GlobalsVariables' Table
    PDWORD pdwClient = (PDWORD)*(PDWORD)Client;
    DWORD dwInitAddr = (DWORD)(pdwClient[0]);
    for (DWORD dwIter = 0; dwIter <= 0xFF; dwIter++)
    {
        if (*(PBYTE)(dwInitAddr + dwIter - 1) == 0x08 && *(PBYTE)(dwInitAddr + dwIter) == 0xA3)
        {
            Globals = **(CGlobalVarsBase***)((*(DWORD**)Interfaces::Client)[0] + 0x1B);
            break;
        }
    }


    Utilities::Log("Interfaces Loaded");
}

// Namespace to contain all the valve interfaces
namespace Interfaces
{
    IBaseClientDLL* Client;
    IVEngineClient* Engine;
    IPanel* Panels;
    IClientEntityList* EntList;
    ISurface* Surface;
    IVDebugOverlay* DebugOverlay;
    IClientModeShared* ClientMode;
    CGlobalVarsBase *Globals;
    DWORD *Prediction;
    CMaterialSystem* MaterialSystem;
    CVRenderView* RenderView;
    IVModelRender* ModelRender;
    CModelInfo* ModelInfo;
    IEngineTrace* Trace;
    IPhysicsSurfaceProps* PhysProps;
    ICVar *CVar;
};

legitbot.cpp
Код:
Expand Collapse Copy
/*
Syn's AyyWare Framework 2015
*/

#include "LegitBot.h"
#include "RenderManager.h"

void CLegitBot::Init()
{
    IsLocked = false;
    TargetID = -1;
}

void CLegitBot::Draw()
{

}

void CLegitBot::Move(CUserCmd *pCmd, bool& bSendPacket)
{
    // Master switch
    if (!Menu::Window.LegitBotTab.Active.GetState())
        return;

    // Aimbot
    if (Menu::Window.LegitBotTab.AimbotEnable.GetState())
        DoAimbot(pCmd);

    // Triggerbot
    if (Menu::Window.LegitBotTab.TriggerEnable.GetState() && (!Menu::Window.LegitBotTab.TriggerKeyPress.GetState() || GUI.GetKeyState(Menu::Window.LegitBotTab.TriggerKeyBind.GetKey())))
        DoTrigger(pCmd);
}

void CLegitBot::SyncWeaponSettings()
{
    IClientEntity* pLocal = hackManager.pLocal();
    CBaseCombatWeapon* pWeapon = (CBaseCombatWeapon*)Interfaces::EntList->GetClientEntityFromHandle(pLocal->GetActiveWeaponHandle());

    if (!pWeapon)
        return;

    if (GameUtils::IsPistol(pWeapon))
    {
        Speed = Menu::Window.LegitBotTab.WeaponPistSpeed.GetValue();
        FoV = Menu::Window.LegitBotTab.WeaponPistFoV.GetValue();
        RecoilControl = Menu::Window.LegitBotTab.WeaponPistRecoil.GetState();

        switch (Menu::Window.LegitBotTab.WeaponPistHitbox.GetIndex())
        {
        case 0:
            HitBox = ((int)CSGOHitboxID::Head);
            break;
        case 1:
            HitBox = ((int)CSGOHitboxID::Neck);
            break;
        case 2:
            HitBox = ((int)CSGOHitboxID::Chest);
            break;
        case 3:
            HitBox = ((int)CSGOHitboxID::Stomach);
            break;
        }
    }
    else if (GameUtils::IsSniper(pWeapon))
    {
        Speed = Menu::Window.LegitBotTab.WeaponSnipSpeed.GetValue();
        FoV = Menu::Window.LegitBotTab.WeaponSnipFoV.GetValue();
        RecoilControl = Menu::Window.LegitBotTab.WeaponSnipRecoil.GetState();

        switch (Menu::Window.LegitBotTab.WeaponSnipHitbox.GetIndex())
        {
        case 0:
            HitBox = ((int)CSGOHitboxID::Head);
            break;
        case 1:
            HitBox = ((int)CSGOHitboxID::Neck);
            break;
        case 2:
            HitBox = ((int)CSGOHitboxID::Chest);
            break;
        case 3:
            HitBox = ((int)CSGOHitboxID::Stomach);
            break;
        }
    }
    else
    {
        Speed = Menu::Window.LegitBotTab.WeaponMainSpeed.GetValue();
        FoV = Menu::Window.LegitBotTab.WeaponMainFoV.GetValue();
        RecoilControl = Menu::Window.LegitBotTab.WeaponMainRecoil.GetState();

        switch (Menu::Window.LegitBotTab.WeaponMainHitbox.GetIndex())
        {
        case 0:
            HitBox = ((int)CSGOHitboxID::Head);
            break;
        case 1:
            HitBox = ((int)CSGOHitboxID::Neck);
            break;
        case 2:
            HitBox = ((int)CSGOHitboxID::Chest);
            break;
        case 3:
            HitBox = ((int)CSGOHitboxID::Stomach);
            break;
        }
    }
}

// Functionality
void CLegitBot::DoAimbot(CUserCmd *pCmd)
{
    IClientEntity* pTarget = nullptr;
    IClientEntity* pLocal = hackManager.pLocal();
    bool FindNewTarget = true;
    //IsLocked = false;

    // Don't aimbot with the knife..
    CBaseCombatWeapon* pWeapon = (CBaseCombatWeapon*)Interfaces::EntList->GetClientEntityFromHandle(pLocal->GetActiveWeaponHandle());
    if (pWeapon)
    {
        if (pWeapon->GetAmmoInClip() == 0 || !GameUtils::IsBallisticWeapon(pWeapon))
        {
            //TargetID = 0;
            //pTarget = nullptr;
            //HitBox = -1;
            return;
        }
        SyncWeaponSettings();

    }
    else
        return;

    // Make sure we have a good target
    if (IsLocked && TargetID >= 0 && HitBox >= 0)
    {
        pTarget = Interfaces::EntList->GetClientEntity(TargetID);
        if (pTarget  && TargetMeetsRequirements(pTarget))
        {
            SyncWeaponSettings();
            if (HitBox >= 0)
            {
                Vector ViewOffset = pLocal->GetOrigin() + pLocal->GetViewOffset();
                Vector View; Interfaces::Engine->GetViewAngles(View);
                View += pLocal->localPlayerExclusive()->GetAimPunchAngle() * 2.f;
                float nFoV = FovToPlayer(ViewOffset, View, pTarget, HitBox);
                if (nFoV < FoV)
                    FindNewTarget = false;
            }
        }
    }

    // Find a new target, apparently we need to
    if (FindNewTarget)
    {
        TargetID = 0;
        pTarget = nullptr;
        HitBox = -1;

        TargetID = GetTargetCrosshair();

        // Memes
        if (TargetID >= 0)
        {
            pTarget = Interfaces::EntList->GetClientEntity(TargetID);
        }
        else
        {
            pTarget = nullptr;
            HitBox = -1;
        }
    }

    SyncWeaponSettings();

    // If we finally have a good target
    if (TargetID >= 0 && pTarget)
    {
        //HitBox = (int)CSGOHitboxID::Head;//
        SyncWeaponSettings();

        // Key
        if (Menu::Window.LegitBotTab.AimbotKeyPress.GetState())
        {
            int Key = Menu::Window.LegitBotTab.AimbotKeyBind.GetKey();
            if (Key >= 0 && !GUI.GetKeyState(Key))
            {
                TargetID = -1;
                pTarget = nullptr;
                HitBox = -1;
                return;
            }
        }

        Vector AimPoint = GetHitboxPosition(pTarget, HitBox);

        if (AimAtPoint(pLocal, AimPoint, pCmd))
        {
            //IsLocked = true;
            if (Menu::Window.LegitBotTab.AimbotAutoFire.GetState() && !(pCmd->buttons & IN_ATTACK))
            {
                pCmd->buttons |= IN_ATTACK;
            }
        }
    }

    // Auto Pistol
    static bool WasFiring = false;
    CSWeaponInfo* WeaponInfo = pWeapon->GetCSWpnData();
    if (!WeaponInfo->m_IsFullAuto && Menu::Window.LegitBotTab.AimbotAutoPistol.GetState())
    {
        if (pCmd->buttons & IN_ATTACK)
        {
            if (WasFiring)
            {
                pCmd->buttons &= ~IN_ATTACK;
            }
        }

        WasFiring = pCmd->buttons & IN_ATTACK ? true : false;
    }
}

bool TargetMeetsTriggerRequirements(IClientEntity* pEntity)
{
    // Is a valid player
    if (pEntity && pEntity->IsDormant() == false && pEntity->IsAlive() && pEntity->GetIndex() != hackManager.pLocal()->GetIndex())
    {
        // Entity Type checks
        ClientClass *pClientClass = pEntity->GetClientClass();
        player_info_t pinfo;
        if (pClientClass->m_ClassID == (int)CSGOClassID::CCSPlayer && Interfaces::Engine->GetPlayerInfo(pEntity->GetIndex(), &pinfo))
        {
            // Team Check
            if (pEntity->GetTeamNum() != hackManager.pLocal()->GetTeamNum() || Menu::Window.LegitBotTab.AimbotFriendlyFire.GetState())
            {
                // Spawn Check
                if (!pEntity->HasGunGameImmunity())
                {
                    return true;
                }
            }
        }
    }

    // They must have failed a requirement
    return false;
}

void CLegitBot::DoTrigger(CUserCmd *pCmd)
{
    IClientEntity* pLocal = hackManager.pLocal();

    // Don't triggerbot with the knife..
    CBaseCombatWeapon* pWeapon = (CBaseCombatWeapon*)Interfaces::EntList->GetClientEntityFromHandle(pLocal->GetActiveWeaponHandle());
    if (pWeapon)
    {
        if (pWeapon->GetAmmoInClip() == 0 || !GameUtils::IsBallisticWeapon(pWeapon))
        {
            return;
        }
    }
    else
        return;

    // Triggerbot
    // Get the view with the recoil
    Vector ViewAngles;
    Interfaces::Engine->GetViewAngles(ViewAngles);
    ViewAngles += pLocal->localPlayerExclusive()->GetAimPunchAngle() * 2.f;

    // Build a ray going fowards at that angle
    Vector fowardVec;
    AngleVectors(ViewAngles, &fowardVec);
    fowardVec *= 10000;

    // Get ray start / end
    Vector start = pLocal->GetOrigin() + pLocal->GetViewOffset();
    Vector end = start + fowardVec, endScreen;

    trace_t Trace;
    UTIL_TraceLine(start, end, MASK_SOLID, pLocal, 0, &Trace);

    if (Trace.m_pEnt && 0 < Trace.hitgroup <= 7)
    {
        if (TargetMeetsTriggerRequirements(Trace.m_pEnt))
        {
            pCmd->buttons |= IN_ATTACK;
        }
    }

    // Auto Pistol
    static bool WasFiring = false;
    CSWeaponInfo* WeaponInfo = pWeapon->GetCSWpnData();
    if (!WeaponInfo->m_IsFullAuto && Menu::Window.LegitBotTab.AimbotAutoPistol.GetState())
    {
        if (pCmd->buttons & IN_ATTACK)
        {
            if (WasFiring)
            {
                pCmd->buttons &= ~IN_ATTACK;
            }
        }

        WasFiring = pCmd->buttons & IN_ATTACK ? true : false;
    }
}

bool CLegitBot::TargetMeetsRequirements(IClientEntity* pEntity)
{
    // Is a valid player
    if (pEntity && pEntity->IsDormant() == false && pEntity->IsAlive() && pEntity->GetIndex() != hackManager.pLocal()->GetIndex())
    {
        // Entity Type checks
        ClientClass *pClientClass = pEntity->GetClientClass();
        player_info_t pinfo;
        if (pClientClass->m_ClassID == (int)CSGOClassID::CCSPlayer && Interfaces::Engine->GetPlayerInfo(pEntity->GetIndex(), &pinfo))
        {
            // Team Check
            if (pEntity->GetTeamNum() != hackManager.pLocal()->GetTeamNum() || Menu::Window.LegitBotTab.AimbotFriendlyFire.GetState())
            {
                // Spawn Check
                if (!pEntity->HasGunGameImmunity() && GameUtils::IsVisible(hackManager.pLocal(), pEntity, HitBox))
                {
                    return true;
                }
            }
        }
    }

    // They must have failed a requirement
    return false;
}

float CLegitBot::FovToPlayer(Vector ViewOffSet, Vector View, IClientEntity* pEntity, int aHitBox)
{
    // Anything past 180 degrees is just going to wrap around
    CONST FLOAT MaxDegrees = 180.0f;

    // Get local angles
    Vector Angles = View;

    // Get local view / eye position
    Vector Origin = ViewOffSet;

    // Create and intiialize vectors for calculations below
    Vector Delta(0, 0, 0);
    //Vector Origin(0, 0, 0);
    Vector Forward(0, 0, 0);

    // Convert angles to normalized directional forward vector
    AngleVectors(Angles, &Forward);
    Vector AimPos = GetHitboxPosition(pEntity, aHitBox);
    // Get delta vector between our local eye position and passed vector
    VectorSubtract(AimPos, Origin, Delta);
    //Delta = AimPos - Origin;

    // Normalize our delta vector
    Normalize(Delta, Delta);

    // Get dot product between delta position and directional forward vectors
    FLOAT DotProduct = Forward.Dot(Delta);

    // Time to calculate the field of view
    return (acos(DotProduct) * (MaxDegrees / PI));
}

int CLegitBot::GetTargetCrosshair()
{
    // Target selection
    SyncWeaponSettings();
    int target = -1;
    float minFoV = FoV;

    IClientEntity* pLocal = hackManager.pLocal();
    Vector ViewOffset = pLocal->GetOrigin() + pLocal->GetViewOffset();
    Vector View; Interfaces::Engine->GetViewAngles(View);
    View += pLocal->localPlayerExclusive()->GetAimPunchAngle() * 2.f;

    for (int i = 0; i < Interfaces::EntList->GetHighestEntityIndex(); i++)
    {
        IClientEntity *pEntity = Interfaces::EntList->GetClientEntity(i);
        if (TargetMeetsRequirements(pEntity))
        {
            int NewHitBox = HitBox;
            if (NewHitBox >= 0)
            {
                float fov = FovToPlayer(ViewOffset, View, pEntity, 0);
                if (fov < minFoV)
                {
                    minFoV = fov;
                    target = i;
                }
            }
        }
    }

    return target;
}

bool CLegitBot::AimAtPoint(IClientEntity* pLocal, Vector point, CUserCmd *pCmd)
{
    // Get the full angles
    if (point.Length() == 0) return false;

    Vector angles;
    Vector src = pLocal->GetOrigin() + pLocal->GetViewOffset();

    CalcAngle(src, point, angles);
    GameUtils::NormaliseViewAngle(angles);

    if (angles[0] != angles[0] || angles[1] != angles[1])
    {
        return false;
    }

    if (RecoilControl)
    {
        Vector AimPunch = pLocal->localPlayerExclusive()->GetAimPunchAngle();
        if (AimPunch.Length2D() > 0 && AimPunch.Length2D() < 150)
        {
            angles -= AimPunch * 2;
            GameUtils::NormaliseViewAngle(angles);
        }
    }

    IsLocked = true;
    //-----------------------------------------------

    Vector shit = angles - pCmd->viewangles;
    bool v = false;

    if (shit.Length() > Speed)
    {
        Normalize(shit, shit);
        shit *= Speed;
    }
    else
    {
        v = true;
    }

    pCmd->viewangles += shit;
    Interfaces::Engine->SetViewAngles(pCmd->viewangles);

    return v;
}
 
Назад
Сверху Снизу