Compare commits
2 Commits
d3c189f949
...
03af6d458c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03af6d458c | ||
|
|
f892794557 |
@ -171,6 +171,7 @@
|
||||
<ClCompile Include="source\cs2\entity\C_CSWeaponBase\C_CSWeaponBase.cpp" />
|
||||
<ClCompile Include="source\templeware\features\aim\aim.cpp" />
|
||||
<ClCompile Include="source\templeware\features\chams\chams.cpp" />
|
||||
<ClCompile Include="source\templeware\features\spectators\spectators.cpp" />
|
||||
<ClCompile Include="source\templeware\features\triggerbot\triggerbot.cpp" />
|
||||
<ClCompile Include="source\templeware\features\visuals\antiflash\antiflash.cpp" />
|
||||
<ClCompile Include="source\templeware\features\visuals\fov\fov.cpp" />
|
||||
@ -228,6 +229,7 @@
|
||||
<ClInclude Include="source\cs2\entity\handle.h" />
|
||||
<ClInclude Include="source\templeware\features\aim\aim.h" />
|
||||
<ClInclude Include="source\templeware\features\chams\chams.h" />
|
||||
<ClInclude Include="source\templeware\features\spectators\spectators.h" />
|
||||
<ClInclude Include="source\templeware\features\triggerbot\triggerbot.h" />
|
||||
<ClInclude Include="source\templeware\interfaces\CGameEntitySystem\CGameEntitySystem.h" />
|
||||
<ClInclude Include="source\templeware\interfaces\IEngineClient\IEngineClient.h" />
|
||||
|
||||
@ -34,7 +34,6 @@ CKeyValues3* CKeyValues3::create_material_from_resource()
|
||||
using fnSetTypeKV3 = CKeyValues3 * (__fastcall*)(CKeyValues3*, unsigned int, unsigned int);
|
||||
static const fnSetTypeKV3 oSetTypeKV3 = reinterpret_cast<fnSetTypeKV3>(M::FindPattern("tier0.dll", ("40 53 48 83 EC 30 48 8B D9 49")));
|
||||
|
||||
|
||||
CKeyValues3* pKeyValue = new CKeyValues3[0x10];
|
||||
CKeyValues3* pKeyValue = new CKeyValues3;
|
||||
return oSetTypeKV3(pKeyValue, 1U, 6U);
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#pragma once
|
||||
#include "../handle.h"
|
||||
#include "../../../templeware/utils/memory/memorycommon.h"
|
||||
#include "../../../templeware/utils/math/vector/vector.h"
|
||||
#include "../../../templeware/utils/schema/schema.h"
|
||||
@ -14,6 +14,7 @@ public:
|
||||
|
||||
SCHEMA_ADD_OFFSET(bool, IsLocalPlayer, 0x6F0);
|
||||
SCHEMA_ADD_OFFSET(CBaseHandle, m_hPawn, 0x62C);
|
||||
SCHEMA_ADD_OFFSET(CBaseHandle, m_hObserverPawn, 0x48);
|
||||
SCHEMA_ADD_OFFSET(const char*, m_sSanitizedPlayerName, 0x778);
|
||||
|
||||
private:
|
||||
|
||||
@ -12,6 +12,7 @@ public:
|
||||
SCHEMA_ADD_OFFSET(Vector_t, m_vOldOrigin, 0x1324);
|
||||
SCHEMA_ADD_OFFSET(Vector_t, m_vecViewOffset, 0xCB0);
|
||||
SCHEMA_ADD_OFFSET(CCSPlayer_WeaponServices*, m_pWeaponServices, 0x11A8);
|
||||
SCHEMA_ADD_OFFSET(CBaseHandle, m_hController, 0x133C);
|
||||
C_CSPlayerPawn(uintptr_t address);
|
||||
|
||||
C_CSWeaponBase* GetActiveWeapon()const;
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
#include "../external/imgui/imgui.h"
|
||||
#include "../external/imgui/imgui_impl_win32.h"
|
||||
#include "../external/imgui/imgui_impl_dx11.h"
|
||||
#include "cs2/entity/handle.h"
|
||||
|
||||
typedef HRESULT(__stdcall* Present) (IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
|
||||
typedef LRESULT(CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
@ -63,5 +63,23 @@ namespace Config {
|
||||
bool triggerbot = false;
|
||||
bool always_on_triggerbot = false;
|
||||
int triggerbot_key = 0x05; // Например, VK_X или другой
|
||||
int triggerbot_alt_key = 0x06; // Альтернативная кнопка по умолчанию (например, VK_Y)
|
||||
float triggerbot_delay = 0.0f;
|
||||
int rcsActivationShots = 1;
|
||||
|
||||
// --- Для отображения наблюдателей ---
|
||||
bool showSpectators = true;
|
||||
ImVec4 spectatorListColor = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
ImVec4 spectatorListBgColor = ImVec4(0.0f, 0.0f, 0.0f, 0.7f);
|
||||
float spectatorListOpacity = 0.8f;
|
||||
|
||||
bool silent_aim = true;
|
||||
float silent_aim_fov = 90.0f;
|
||||
float silent_aim_smooth = 0.0f;
|
||||
int silent_aim_bone = Config::BONE_HEAD;
|
||||
int silent_aim_key = 0x12; // VK_DELETE по умолчанию
|
||||
bool always_on_silent_aim = false;
|
||||
float silent_aim_smooth_slider = 0.0f; // Новый параметр для ползунка смуза
|
||||
bool silent_shooterAfterAim = false; // Аналог shooterAfterAim для сайлент аимбота
|
||||
bool silent_rage = false; // По умолчанию выключен
|
||||
}
|
||||
|
||||
@ -70,5 +70,23 @@ namespace Config {
|
||||
extern bool triggerbot;
|
||||
extern bool always_on_triggerbot;
|
||||
extern int triggerbot_key;
|
||||
extern int triggerbot_alt_key; // Альтернативная кнопка для триггербота
|
||||
extern float triggerbot_delay;
|
||||
extern int rcsActivationShots;
|
||||
|
||||
// --- Для отображения наблюдателей ---
|
||||
extern bool showSpectators;
|
||||
extern ImVec4 spectatorListColor;
|
||||
extern ImVec4 spectatorListBgColor;
|
||||
extern float spectatorListOpacity;
|
||||
|
||||
extern bool silent_aim;
|
||||
extern float silent_aim_fov;
|
||||
extern float silent_aim_smooth;
|
||||
extern int silent_aim_bone;
|
||||
extern int silent_aim_key;
|
||||
extern bool always_on_silent_aim;
|
||||
extern float silent_aim_smooth_slider; // Новый параметр для ползунка смуза
|
||||
extern bool silent_shooterAfterAim; // Аналог shooterAfterAim для сайлент аимбота
|
||||
extern bool silent_rage; // Включает постоянный поиск цели (rage-режим)
|
||||
}
|
||||
|
||||
@ -130,10 +130,13 @@ namespace internal_config
|
||||
j["showNameTags"] = Config::showNameTags;
|
||||
j["triggerbot_hold_lmb"] = Config::triggerbot_hold_lmb;
|
||||
j["shooterAfterAim"] = Config::shooterAfterAim;
|
||||
j["silent_shooterAfterAim"] = Config::silent_shooterAfterAim;
|
||||
j["always_on_triggerbot"] = Config::always_on_triggerbot;
|
||||
j["triggerbot"] = Config::triggerbot;
|
||||
j["triggerbot_key"] = Config::triggerbot_key;
|
||||
j["triggerbot_alt_key"] = Config::triggerbot_alt_key;
|
||||
j["triggerbot_delay"] = Config::triggerbot_delay;
|
||||
j["silent_rage"] = Config::silent_rage;
|
||||
|
||||
j["enemyChamsInvisible"] = Config::enemyChamsInvisible;
|
||||
j["enemyChams"] = Config::enemyChams;
|
||||
@ -170,6 +173,7 @@ namespace internal_config
|
||||
Config::fovCircleColor.z,
|
||||
Config::fovCircleColor.w
|
||||
};
|
||||
j["rcsActivationShots"] = Config::rcsActivationShots;
|
||||
|
||||
auto filePath = GetConfigPath(configName);
|
||||
std::ofstream ofs(filePath);
|
||||
@ -243,10 +247,13 @@ namespace internal_config
|
||||
Config::showNameTags = j.value("showNameTags", false);
|
||||
Config::triggerbot_hold_lmb = j.value("triggerbot_hold_lmb", false);
|
||||
Config::shooterAfterAim = j.value("shooterAfterAim", false);
|
||||
Config::silent_shooterAfterAim = j.value("silent_shooterAfterAim", false);
|
||||
Config::always_on_triggerbot = j.value("always_on_triggerbot", false);
|
||||
Config::triggerbot = j.value("triggerbot", false);
|
||||
Config::triggerbot_key = j.value("triggerbot_key", 0x05);
|
||||
Config::triggerbot_alt_key = j.value("triggerbot_alt_key", 0x06);
|
||||
Config::triggerbot_delay = j.value("triggerbot_delay", 0.0f);
|
||||
Config::silent_rage = j.value("silent_rage", false);
|
||||
|
||||
Config::antiflash = j.value("antiflash", false);
|
||||
|
||||
@ -315,6 +322,8 @@ namespace internal_config
|
||||
Config::fovCircleColor.w = arr[3].get<float>();
|
||||
}
|
||||
|
||||
Config::rcsActivationShots = j.value("rcsActivationShots", 1);
|
||||
|
||||
ifs.close();
|
||||
}
|
||||
|
||||
|
||||
150
TempleWare-CS2/source/templeware/features/aim/CUserCmd.h
Normal file
150
TempleWare-CS2/source/templeware/features/aim/CUserCmd.h
Normal file
@ -0,0 +1,150 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include "../../../templeware/utils/math/vector/vector.h"
|
||||
|
||||
#pragma pack(push, 1)
|
||||
// --- Протобуферные структуры для сабтиков (CS2) ---
|
||||
|
||||
struct CCmdQAnglePB {
|
||||
QAngle_t angValue;
|
||||
};
|
||||
|
||||
struct CCmdVectorPB {
|
||||
Vector4D_t vecValue;
|
||||
};
|
||||
|
||||
struct CBasePB_CS2 {
|
||||
void* vtable;
|
||||
uint32_t nHasBits;
|
||||
uint64_t nCachedBits;
|
||||
};
|
||||
|
||||
struct CInButtonStatePB_CS2 : CBasePB_CS2 {
|
||||
uint64_t nValue;
|
||||
uint64_t nValueChanged;
|
||||
uint64_t nValueScroll;
|
||||
};
|
||||
|
||||
struct CSubtickMoveStepPB_CS2 : CBasePB_CS2 {
|
||||
uint64_t nButton;
|
||||
bool bPressed;
|
||||
float flWhen;
|
||||
float flAnalogForwardDelta;
|
||||
float flAnalogLeftDelta;
|
||||
};
|
||||
|
||||
struct CCSGOInterpolationInfoPB_CS2 : CBasePB_CS2 {
|
||||
float flFraction;
|
||||
int nSrcTick;
|
||||
int nDstTick;
|
||||
};
|
||||
|
||||
struct CMsgQAnglePB_CS2 { QAngle_t angValue; };
|
||||
struct CMsgVectorPB_CS2 { Vector4D_t vecValue; };
|
||||
|
||||
struct CCSGOInputHistoryEntryPB_CS2 {
|
||||
CMsgQAnglePB_CS2* pViewAngles;
|
||||
CMsgVectorPB_CS2* pShootPosition;
|
||||
CMsgVectorPB_CS2* pTargetHeadPositionCheck;
|
||||
CMsgVectorPB_CS2* pTargetAbsPositionCheck;
|
||||
CMsgQAnglePB_CS2* pTargetAngPositionCheck;
|
||||
CCSGOInterpolationInfoPB_CS2* cl_interp;
|
||||
CCSGOInterpolationInfoPB_CS2* sv_interp0;
|
||||
CCSGOInterpolationInfoPB_CS2* sv_interp1;
|
||||
CCSGOInterpolationInfoPB_CS2* player_interp;
|
||||
int nRenderTickCount;
|
||||
float flRenderTickFraction;
|
||||
int nPlayerTickCount;
|
||||
float flPlayerTickFraction;
|
||||
int nFrameNumber;
|
||||
int nTargetEntIndex;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct RepeatedPtrFieldPB_CS2 {
|
||||
struct Rep_t {
|
||||
int nAllocatedSize;
|
||||
T* tElements[128];
|
||||
};
|
||||
void* pArena; // 0x0 (8 байт)
|
||||
int nCurrentSize; // 0x8 (4 байта)
|
||||
int nTotalSize; // 0xC (4 байта)
|
||||
Rep_t* pRep; // 0x10 (8 байт)
|
||||
// 0x18
|
||||
};
|
||||
static_assert(sizeof(RepeatedPtrFieldPB_CS2<int>) == 0x18, "RepeatedPtrFieldPB_CS2 size mismatch!");
|
||||
|
||||
struct CBaseUserCmdPB_CS2 {
|
||||
RepeatedPtrFieldPB_CS2<int> subtickMovesField; // 0x0 (0x18)
|
||||
void* strMoveCrc; // 0x18
|
||||
void* pInButtonState; // 0x20
|
||||
CMsgQAnglePB_CS2* pViewAngles; // 0x28
|
||||
int32_t nLegacyCommandNumber; // 0x30
|
||||
int32_t nClientTick; // 0x34
|
||||
float flForwardMove; // 0x38
|
||||
float flSideMove; // 0x3C
|
||||
float flUpMove; // 0x40
|
||||
int32_t nImpulse; // 0x44
|
||||
int32_t nWeaponSelect; // 0x48
|
||||
int32_t nRandomSeed; // 0x4C
|
||||
int32_t nMousedX; // 0x50
|
||||
int32_t nMousedY; // 0x54
|
||||
uint32_t nConsumedServerAngleChanges; // 0x58
|
||||
int32_t nCmdFlags; // 0x5C
|
||||
uint32_t nPawnEntityHandle; // 0x60
|
||||
char pad[0x80 - 0x64]; // паддинг до 0x80
|
||||
};
|
||||
static_assert(sizeof(CBaseUserCmdPB_CS2) == 0x80, "CBaseUserCmdPB_CS2 size mismatch!");
|
||||
|
||||
struct CCSGOUserCmdPB_CS2 {
|
||||
uint32_t nHasBits; // 0x0
|
||||
uint64_t nCachedSize; // 0x8
|
||||
RepeatedPtrFieldPB_CS2<CCSGOInputHistoryEntryPB_CS2> inputHistoryField; // 0x10 (0x18)
|
||||
CBaseUserCmdPB_CS2* pBaseCmd; // 0x28
|
||||
bool bLeftHandDesired; // 0x30
|
||||
char pad1[3]; // 0x31-0x33
|
||||
int32_t nAttack3StartHistoryIndex; // 0x34
|
||||
int32_t nAttack1StartHistoryIndex; // 0x38
|
||||
int32_t nAttack2StartHistoryIndex; // 0x3C
|
||||
char pad2[4]; // 0x40-0x43 (чтобы размер стал 0x40)
|
||||
};
|
||||
static_assert(sizeof(CCSGOUserCmdPB_CS2) == 0x40, "CCSGOUserCmdPB_CS2 size mismatch!");
|
||||
|
||||
struct CInButtonState_CS2 {
|
||||
void* vtable; // 0x0
|
||||
uint64_t nValue; // 0x8
|
||||
uint64_t nValueChanged; // 0x10
|
||||
uint64_t nValueScroll; // 0x18
|
||||
};
|
||||
static_assert(sizeof(CInButtonState_CS2) == 0x20, "CInButtonState_CS2 size mismatch!");
|
||||
|
||||
class CUserCmd {
|
||||
public:
|
||||
char pad_0x00[0x8]; // 0x0
|
||||
char pad_0x08[0x10]; // 0x8
|
||||
CCSGOUserCmdPB_CS2 csgoUserCmd; // 0x18
|
||||
CInButtonState_CS2 nButtons; // 0x58
|
||||
char pad_0x78[0x20]; // 0x78
|
||||
|
||||
CCSGOInputHistoryEntryPB_CS2* GetInputHistoryEntry(int nIndex) {
|
||||
if (!csgoUserCmd.inputHistoryField.pRep) return nullptr;
|
||||
if (nIndex < 0 || nIndex >= csgoUserCmd.inputHistoryField.nCurrentSize) return nullptr;
|
||||
return csgoUserCmd.inputHistoryField.pRep->tElements[nIndex];
|
||||
}
|
||||
|
||||
void SetSubTickAngle(const QAngle_t& angView) {
|
||||
if (!csgoUserCmd.inputHistoryField.pRep) return;
|
||||
for (int i = 0; i < csgoUserCmd.inputHistoryField.nCurrentSize; ++i) {
|
||||
CCSGOInputHistoryEntryPB_CS2* pInputEntry = GetInputHistoryEntry(i);
|
||||
if (!pInputEntry || !pInputEntry->pViewAngles) continue;
|
||||
pInputEntry->pViewAngles->angValue = angView;
|
||||
}
|
||||
}
|
||||
};
|
||||
static_assert(sizeof(CUserCmd) == 0x98, "CUserCmd size mismatch! Проверь паддинг и порядок полей.");
|
||||
|
||||
// static_assert(sizeof(CUserCmd) == 0x98, "CUserCmd size mismatch! Проверь паддинг и порядок полей.");
|
||||
|
||||
// Для overlay/hud:
|
||||
// extern size_t g_szCBaseUserCmdPB_CS2;
|
||||
// extern size_t g_szRepeatedPtrFieldPB_CS2;
|
||||
@ -4,13 +4,34 @@
|
||||
#include "../../../templeware/hooks/hooks.h"
|
||||
#include "../../../templeware/config/config.h"
|
||||
#include "../../utils/memory/patternscan/patternscan.h"
|
||||
#include "../visuals/visuals.h"
|
||||
#include "CUserCmd.h"
|
||||
#include "../../../templeware/utils/schema/schema.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <Windows.h>
|
||||
#include "../../menu/hud.h"
|
||||
#include "../../menu/menu.h"
|
||||
#include <array>
|
||||
#include <cmath>
|
||||
#include <Psapi.h>
|
||||
#include "../../menu/hud.h"
|
||||
#include "../../menu/menu.h"
|
||||
#include <iostream>
|
||||
|
||||
// Адреса из дампа (актуально для 2024-07-18)
|
||||
#define DW_SENSITIVITY 0x1A6A9D8
|
||||
#define DW_SENSITIVITY_SENS 0x40
|
||||
|
||||
float GetGameSensitivity() {
|
||||
static float fallback = 2.0f;
|
||||
HMODULE hClient = GetModuleHandleA("client.dll");
|
||||
if (!hClient) return fallback;
|
||||
uintptr_t sensBase = reinterpret_cast<uintptr_t>(hClient) + DW_SENSITIVITY;
|
||||
uintptr_t sensPtr = *reinterpret_cast<uintptr_t*>(sensBase);
|
||||
if (!sensPtr) return fallback;
|
||||
float sens = *reinterpret_cast<float*>(sensPtr + DW_SENSITIVITY_SENS);
|
||||
if (sens < 0.01f || sens > 20.0f) return fallback;
|
||||
return sens;
|
||||
}
|
||||
|
||||
// Индексы костей (актуально для CS2)
|
||||
constexpr int BONE_INDEX_HEAD = 6; // Head
|
||||
@ -107,25 +128,30 @@ Vector_t GetEntityEyePos(const C_CSPlayerPawn* Entity) {
|
||||
return Result;
|
||||
}
|
||||
|
||||
// Удаляем все вспомогательные функции инкапсуляции
|
||||
|
||||
void Aimbot() {
|
||||
static C_CSPlayerPawn* lockedTarget = nullptr;
|
||||
static bool prevAimbotState = false;
|
||||
static bool targetWasLost = false;
|
||||
static QAngle_t last_punch_angle = { 0,0,0 };
|
||||
static int shotCount = 0;
|
||||
float sensitivity = GetGameSensitivity();
|
||||
bool aimbotActive = Config::always_on_aimbot ? true : Config::aimbot;
|
||||
// --- shooterAfterAim + triggerbot_key ---
|
||||
if (Config::shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
|
||||
aimbotActive = true;
|
||||
}
|
||||
C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
|
||||
if (cached_players.empty() || !lp || !lp->handle().valid() || lp->getHealth() <= 0)
|
||||
return;
|
||||
Vector_t lep = GetEntityEyePos(lp);
|
||||
QAngle_t* viewangles = (QAngle_t*)(modules.getModule("client") + 0x1A78650);
|
||||
bool isShooting = (GetAsyncKeyState(Config::triggerbot_key) & 0x8000) || (GetAsyncKeyState(VK_LBUTTON) & 0x8000);
|
||||
|
||||
int shotsFired = lp ? lp->getShotsFired() : 0;
|
||||
shotCount = shotsFired;
|
||||
g_DebugString = "debug: " + std::to_string(shotsFired);
|
||||
//g_DebugString = "debug: " + std::to_string(shotsFired) + "Sens: " + std::to_string(sensitivity);
|
||||
|
||||
if (Config::aimbot_on_lmb && !Config::always_on_aimbot) {
|
||||
aimbotActive = isShooting;
|
||||
@ -141,31 +167,15 @@ void Aimbot() {
|
||||
|
||||
// --- Новый режим: always_on_aimbot ---
|
||||
if (Config::always_on_aimbot) {
|
||||
int nMaxHighestEntity = I::GameEntity->Instance->GetHighestEntityIndex();
|
||||
float bestFov = Config::aimbot_fov;
|
||||
C_CSPlayerPawn* bestTarget = nullptr;
|
||||
PlayerCache* bestTarget = nullptr;
|
||||
QAngle_t bestAngle = { 0, 0, 0 };
|
||||
|
||||
for (int i = 1; i <= nMaxHighestEntity; i++) {
|
||||
auto Entity = I::GameEntity->Instance->Get(i);
|
||||
if (!Entity)
|
||||
for (auto& Player : cached_players) {
|
||||
if (!Player.handle.valid() || Player.health <= 0 || Player.handle.index() == INVALID_EHANDLE_INDEX)
|
||||
continue;
|
||||
if (!Entity->handle().valid())
|
||||
if (Config::teamCheck && (Player.team_num == cached_local.team))
|
||||
continue;
|
||||
SchemaClassInfoData_t* _class = nullptr;
|
||||
Entity->dump_class_info(&_class);
|
||||
if (!_class)
|
||||
continue;
|
||||
const uint32_t hash = HASH(_class->szName);
|
||||
if (hash == HASH("C_CSPlayerPawn")) {
|
||||
C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
|
||||
if (pawn->get_entity_by_handle() == lp->get_entity_by_handle())
|
||||
continue;
|
||||
if (pawn->getHealth() <= 0)
|
||||
continue;
|
||||
if (Config::team_check && pawn->getTeam() == lp->getTeam())
|
||||
continue;
|
||||
Vector_t target_pos = GetEntityEyePos(pawn);//GetAimbotTargetPos(pawn, lep);
|
||||
Vector_t target_pos = Player.position + Player.viewOffset;
|
||||
QAngle_t angle = CalcAngles(target_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
angle.y += 180.f;
|
||||
@ -173,45 +183,40 @@ void Aimbot() {
|
||||
if (!std::isfinite(fov) || fov > bestFov)
|
||||
continue;
|
||||
bestFov = fov;
|
||||
bestTarget = pawn;
|
||||
bestTarget = &Player;
|
||||
bestAngle = angle;
|
||||
}
|
||||
}
|
||||
if (bestTarget) {
|
||||
Vector_t target_pos = GetAimbotTargetPos(bestTarget, lep, *viewangles);
|
||||
//Vector_t target_pos = GetEntityEyePos(bestTarget);
|
||||
Vector_t target_pos = bestTarget->position + bestTarget->viewOffset;
|
||||
QAngle_t angle = CalcAngles(target_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
angle.y += 180.f;
|
||||
QAngle_t ang_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
|
||||
if (isShooting) {
|
||||
last_punch_angle = ang_punch_angle;
|
||||
} else {
|
||||
QAngle_t cur_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
|
||||
// --- RCS ---
|
||||
bool rcsActive = false;
|
||||
if (Config::shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
|
||||
rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
|
||||
}
|
||||
else {
|
||||
rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
|
||||
}
|
||||
if (rcsActive && shotsFired > 1) {
|
||||
// Для прямого изменения viewangles: делить НЕ нужно
|
||||
//QAngle_t punchDelta = cur_punch_angle - last_punch_angle;
|
||||
//g_DebugString = "debug: " + std::to_string(punchDelta.x);
|
||||
angle -= cur_punch_angle * 2.f;
|
||||
last_punch_angle = cur_punch_angle;
|
||||
}
|
||||
else {
|
||||
last_punch_angle = { 0,0,0 };
|
||||
}
|
||||
// --- RCS ---
|
||||
bool rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > 1);
|
||||
if (rcsActive)
|
||||
angle -= last_punch_angle * 2.f;
|
||||
angle.z = 0.f;
|
||||
angle = angle.Normalize();
|
||||
// --- RCS ---
|
||||
QAngle_t delta = (angle - *viewangles).Normalize();
|
||||
if (rcsActive) {
|
||||
float smooth_rcs = Config::aimbot_smooth;
|
||||
if (Config::aimbot_dynamic_smooth) {
|
||||
float fov = sqrtf(delta.x * delta.x + delta.y * delta.y);
|
||||
float maxFov = Config::aimbot_fov;
|
||||
float factor = (maxFov > 0.01f) ? (fov / maxFov) : 0.f;
|
||||
smooth_rcs = Config::aimbot_smooth + (Config::aimbot_smooth * factor * Config::aimbot_dynamic_smooth_factor);
|
||||
}
|
||||
smooth_rcs = std::fmax(smooth_rcs / 10.f, 1.0f);
|
||||
angle -= last_punch_angle * 2.f * smooth_rcs;
|
||||
}
|
||||
|
||||
// --- Smooth ---
|
||||
QAngle_t delta = (angle - *viewangles).Normalize();
|
||||
if (Config::aimbot_smooth > 0.f) {
|
||||
QAngle_t cur = *viewangles;
|
||||
QAngle_t delta = (angle - cur).Normalize();
|
||||
float smooth = Config::aimbot_smooth;
|
||||
if (Config::aimbot_dynamic_smooth) {
|
||||
float fov = sqrtf(delta.x * delta.x + delta.y * delta.y);
|
||||
@ -222,7 +227,8 @@ void Aimbot() {
|
||||
angle = cur + delta * (1.f / smooth);
|
||||
angle = angle.Normalize();
|
||||
*viewangles = angle;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
*viewangles = angle;
|
||||
}
|
||||
}
|
||||
@ -251,12 +257,10 @@ void Aimbot() {
|
||||
const uint32_t hash = HASH(_class->szName);
|
||||
if (hash == HASH("C_CSPlayerPawn")) {
|
||||
C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
|
||||
if (pawn->get_entity_by_handle() == lp->get_entity_by_handle())
|
||||
continue;
|
||||
if (pawn->getHealth() <= 0)
|
||||
continue;
|
||||
if (Config::team_check && pawn->getTeam() == lp->getTeam())
|
||||
continue;
|
||||
if (!pawn) continue;
|
||||
if (pawn->get_entity_by_handle() == lp->get_entity_by_handle()) continue;
|
||||
if (pawn->getHealth() <= 0) continue;
|
||||
if (Config::team_check && pawn->getTeam() == lp->getTeam()) continue;
|
||||
Vector_t target_pos = GetEntityEyePos(pawn);//GetAimbotTargetPos(pawn, lep);
|
||||
QAngle_t angle = CalcAngles(target_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
@ -287,10 +291,19 @@ void Aimbot() {
|
||||
// Если есть захваченная цель и кнопка удерживается
|
||||
if (aimbotActive && lockedTarget) {
|
||||
// Проверяем, что цель всё ещё валидна
|
||||
if (!lockedTarget->handle().valid() || lockedTarget->getHealth() <= 0) {
|
||||
if (!lp || !lp->handle().valid() || lp->getHealth() <= 0) {
|
||||
lockedTarget = nullptr;
|
||||
targetWasLost = false;
|
||||
last_punch_angle = { 0,0,0 };
|
||||
return;
|
||||
}
|
||||
if (
|
||||
lockedTarget->get_entity_by_handle() == lp->get_entity_by_handle() ||
|
||||
lockedTarget->getHealth() <= 0 ||
|
||||
!lockedTarget->handle().valid()
|
||||
) {
|
||||
lockedTarget = nullptr;
|
||||
targetWasLost = true;
|
||||
// Не ищем новую цель до повторного нажатия!
|
||||
last_punch_angle = { 0,0,0 }; // сброс rcs
|
||||
}
|
||||
else {
|
||||
@ -298,31 +311,27 @@ void Aimbot() {
|
||||
QAngle_t angle = CalcAngles(target_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
angle.y += 180.f;
|
||||
QAngle_t ang_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
|
||||
if (isShooting) {
|
||||
last_punch_angle = ang_punch_angle;
|
||||
} else {
|
||||
QAngle_t cur_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
|
||||
// --- RCS ---
|
||||
bool rcsActive = false;
|
||||
if (Config::shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
|
||||
rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
|
||||
}
|
||||
else {
|
||||
rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
|
||||
}
|
||||
if (rcsActive && shotCount > 1) {
|
||||
// Для прямого изменения viewangles: делить НЕ нужно
|
||||
//QAngle_t punchDelta = cur_punch_angle - last_punch_angle;
|
||||
//g_DebugString = "debug: " + std::to_string(punchDelta.x);
|
||||
angle -= cur_punch_angle * 2.f;
|
||||
last_punch_angle = cur_punch_angle;
|
||||
}
|
||||
else {
|
||||
last_punch_angle = { 0,0,0 };
|
||||
}
|
||||
// --- RCS ---
|
||||
bool rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > 1);
|
||||
if (rcsActive)
|
||||
angle -= last_punch_angle * 2.f;
|
||||
angle.z = 0.f;
|
||||
angle = angle.Normalize();
|
||||
// --- RCS ---
|
||||
QAngle_t delta = (angle - *viewangles).Normalize();
|
||||
if (rcsActive) {
|
||||
float smooth_rcs = Config::aimbot_smooth;
|
||||
if (Config::aimbot_dynamic_smooth) {
|
||||
float fov = sqrtf(delta.x * delta.x + delta.y * delta.y);
|
||||
float maxFov = Config::aimbot_fov;
|
||||
float factor = (maxFov > 0.01f) ? (fov / maxFov) : 0.f;
|
||||
smooth_rcs = Config::aimbot_smooth + (Config::aimbot_smooth * factor * Config::aimbot_dynamic_smooth_factor);
|
||||
}
|
||||
smooth_rcs = std::fmax(smooth_rcs / 10.f, 1.0f);
|
||||
angle -= last_punch_angle * 2.f * smooth_rcs;
|
||||
}
|
||||
// --- Smooth ---
|
||||
if (Config::aimbot_smooth > 0.f) {
|
||||
QAngle_t cur = *viewangles;
|
||||
@ -337,7 +346,8 @@ void Aimbot() {
|
||||
angle = cur + delta * (1.f / smooth);
|
||||
angle = angle.Normalize();
|
||||
*viewangles = angle;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
*viewangles = angle;
|
||||
}
|
||||
}
|
||||
@ -363,12 +373,10 @@ void Aimbot() {
|
||||
const uint32_t hash = HASH(_class->szName);
|
||||
if (hash == HASH("C_CSPlayerPawn")) {
|
||||
C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
|
||||
if (pawn->get_entity_by_handle() == lp->get_entity_by_handle())
|
||||
continue;
|
||||
if (pawn->getHealth() <= 0)
|
||||
continue;
|
||||
if (Config::team_check && pawn->getTeam() == lp->getTeam())
|
||||
continue;
|
||||
if (!pawn) continue;
|
||||
if (pawn->get_entity_by_handle() == lp->get_entity_by_handle()) continue;
|
||||
if (pawn->getHealth() <= 0) continue;
|
||||
if (Config::team_check && pawn->getTeam() == lp->getTeam()) continue;
|
||||
Vector_t target_pos = GetEntityEyePos(pawn);//GetAimbotTargetPos(pawn, lep);
|
||||
QAngle_t angle = CalcAngles(target_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
@ -387,26 +395,331 @@ void Aimbot() {
|
||||
}
|
||||
|
||||
prevAimbotState = aimbotActive;
|
||||
|
||||
//if (Config::shooterAfterAim) {
|
||||
// if (g_ShowMenu) return;
|
||||
// C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
|
||||
// bool onEnemy = false;
|
||||
// if (lp) {
|
||||
// int crosshairIdx = *(int*)((uintptr_t)lp + 0x1458); // m_iIDEntIndex
|
||||
// if (crosshairIdx > 0) {
|
||||
// auto target = I::GameEntity->Instance->Get<C_CSPlayerPawn>(crosshairIdx);
|
||||
// if (target && target->getHealth() > 0 && (!Config::team_check || target->getTeam() != lp->getTeam()))
|
||||
// onEnemy = true;
|
||||
// }
|
||||
// }
|
||||
// // Если врага нет под прицелом — всегда блокируем ЛКМ
|
||||
// if (!onEnemy && (GetAsyncKeyState(VK_LBUTTON) & 0x8000)) {
|
||||
// INPUT input = { 0 };
|
||||
// input.type = INPUT_MOUSE;
|
||||
// input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
|
||||
// SendInput(1, &input, sizeof(INPUT));
|
||||
// }
|
||||
// // return; // Не делаем return, чтобы аимбот работал всегда
|
||||
//}
|
||||
}
|
||||
|
||||
void Ver2Aimbot(CUserCmd* pCmd) {
|
||||
// --- Silent Aim: чистая и безопасная реализация ---
|
||||
if (!Config::silent_aim || !pCmd) return;
|
||||
static C_CSPlayerPawn* lockedTarget = nullptr;
|
||||
static bool prevSilentState = false;
|
||||
static QAngle_t last_punch_angle = { 0,0,0 };
|
||||
static int shotCount = 0;
|
||||
static bool targetWasLost = false;
|
||||
static bool targetWasLockedThisPress = false;
|
||||
C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
|
||||
if (!lp || !lp->handle().valid() || lp->getHealth() <= 0) return;
|
||||
Vector_t lep = GetEntityEyePos(lp);
|
||||
// Получаем viewangles только из CUserCmd!
|
||||
QAngle_t* cur = nullptr;
|
||||
if (pCmd->csgoUserCmd.pBaseCmd && pCmd->csgoUserCmd.pBaseCmd->pViewAngles) {
|
||||
cur = &pCmd->csgoUserCmd.pBaseCmd->pViewAngles->angValue;
|
||||
}
|
||||
if (!cur) return;
|
||||
// --- Кнопка активации ---
|
||||
bool silentActive = Config::always_on_silent_aim ? true : (GetAsyncKeyState(Config::silent_aim_key) & 0x8000);
|
||||
if (Config::silent_shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
|
||||
silentActive = true;
|
||||
}
|
||||
int shotsFired = lp ? lp->getShotsFired() : 0;
|
||||
shotCount = shotsFired;
|
||||
// --- Сброс флагов при новом нажатии ---
|
||||
if (silentActive && !prevSilentState) {
|
||||
targetWasLost = false;
|
||||
targetWasLockedThisPress = false;
|
||||
}
|
||||
// --- Поиск цели ---
|
||||
if (silentActive && !lockedTarget) {
|
||||
if (Config::silent_rage || (!targetWasLost && !targetWasLockedThisPress)) {
|
||||
int nMaxHighestEntity = I::GameEntity->Instance->GetHighestEntityIndex();
|
||||
float bestFov = Config::silent_aim_fov;
|
||||
C_CSPlayerPawn* bestTarget = nullptr;
|
||||
QAngle_t bestAngle = { 0, 0, 0 };
|
||||
for (int i = 1; i <= nMaxHighestEntity; i++) {
|
||||
auto Entity = I::GameEntity->Instance->Get(i);
|
||||
if (!Entity) continue;
|
||||
if (!Entity->handle().valid()) continue;
|
||||
SchemaClassInfoData_t* _class = nullptr;
|
||||
Entity->dump_class_info(&_class);
|
||||
if (!_class) continue;
|
||||
const uint32_t hash = HASH(_class->szName);
|
||||
if (hash == HASH("C_CSPlayerPawn")) {
|
||||
C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
|
||||
if (!pawn) continue;
|
||||
if (pawn->get_entity_by_handle() == lp->get_entity_by_handle()) continue;
|
||||
if (pawn->getHealth() <= 0) continue;
|
||||
if (Config::team_check && pawn->getTeam() == lp->getTeam()) continue;
|
||||
// --- Выбор кости для silent aim ---
|
||||
Vector_t target_pos;
|
||||
switch (Config::silent_aim_bone) {
|
||||
case Config::BONE_HEAD:
|
||||
target_pos = GetBonePosition(pawn, BONE_INDEX_HEAD); break;
|
||||
case Config::BONE_NECK:
|
||||
target_pos = GetBonePosition(pawn, BONE_INDEX_NECK); break;
|
||||
case Config::BONE_BODY:
|
||||
target_pos = GetBonePosition(pawn, BONE_INDEX_BODY); break;
|
||||
case Config::BONE_NEAREST:
|
||||
default:
|
||||
target_pos = GetAimbotTargetPos(pawn, lep, *cur); break;
|
||||
}
|
||||
QAngle_t angle = CalcAngles(target_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
angle.y += 180.f;
|
||||
float fov = GetFov(*cur, angle);
|
||||
if (!std::isfinite(fov) || fov > bestFov) continue;
|
||||
bestFov = fov;
|
||||
bestTarget = pawn;
|
||||
bestAngle = angle;
|
||||
}
|
||||
}
|
||||
lockedTarget = bestTarget;
|
||||
last_punch_angle = { 0,0,0 };
|
||||
if (!Config::silent_rage && lockedTarget) targetWasLockedThisPress = true;
|
||||
if (!Config::silent_rage && !lockedTarget) targetWasLost = true;
|
||||
}
|
||||
}
|
||||
// --- Сброс при отпускании кнопки ---
|
||||
if (!silentActive) {
|
||||
lockedTarget = nullptr;
|
||||
last_punch_angle = { 0,0,0 };
|
||||
targetWasLost = false;
|
||||
targetWasLockedThisPress = false;
|
||||
}
|
||||
// --- Наведение на цель ---
|
||||
if (silentActive && lockedTarget) {
|
||||
// Проверка валидности цели
|
||||
if (!lp || !lp->handle().valid() || lp->getHealth() <= 0 ||
|
||||
lockedTarget->get_entity_by_handle() == lp->get_entity_by_handle() ||
|
||||
lockedTarget->getHealth() <= 0 ||
|
||||
!lockedTarget->handle().valid() ||
|
||||
(Config::team_check && lockedTarget->getTeam() == lp->getTeam())) {
|
||||
lockedTarget = nullptr;
|
||||
last_punch_angle = { 0,0,0 };
|
||||
targetWasLost = true;
|
||||
prevSilentState = silentActive;
|
||||
return;
|
||||
}
|
||||
// --- Выбор кости для silent aim ---
|
||||
Vector_t target_pos;
|
||||
switch (Config::silent_aim_bone) {
|
||||
case Config::BONE_HEAD:
|
||||
target_pos = GetBonePosition(lockedTarget, BONE_INDEX_HEAD); break;
|
||||
case Config::BONE_NECK:
|
||||
target_pos = GetBonePosition(lockedTarget, BONE_INDEX_NECK); break;
|
||||
case Config::BONE_BODY:
|
||||
target_pos = GetBonePosition(lockedTarget, BONE_INDEX_BODY); break;
|
||||
case Config::BONE_NEAREST:
|
||||
default:
|
||||
target_pos = GetAimbotTargetPos(lockedTarget, lep, *cur); break;
|
||||
}
|
||||
QAngle_t angle = CalcAngles(target_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
angle.y += 180.f;
|
||||
// --- Smooth ---
|
||||
if (Config::silent_aim_smooth > 0.f) {
|
||||
QAngle_t delta = (angle - *cur).Normalize();
|
||||
float smooth = Config::silent_aim_smooth;
|
||||
angle = *cur + delta * (1.f / smooth);
|
||||
angle = angle.Normalize();
|
||||
}
|
||||
*cur = angle;
|
||||
}
|
||||
prevSilentState = silentActive;
|
||||
}
|
||||
|
||||
// --- Функция для вывода отладочной информации через ImGui ---
|
||||
void ShowSilentAimDebugInfo(const CUserCmd* pCmd) {
|
||||
char debugBuf[256];
|
||||
_snprintf_s(debugBuf, sizeof(debugBuf),
|
||||
"CUserCmd: size=%zu, csgoUserCmd@%zu, nButtons@%zu, nSubticks=%d, pRep=%p, pBaseCmd=%p",
|
||||
sizeof(CUserCmd),
|
||||
offsetof(CUserCmd, csgoUserCmd),
|
||||
offsetof(CUserCmd, nButtons),
|
||||
pCmd->csgoUserCmd.inputHistoryField.nCurrentSize,
|
||||
(void*)pCmd->csgoUserCmd.inputHistoryField.pRep,
|
||||
(void*)pCmd->csgoUserCmd.pBaseCmd);
|
||||
g_DebugString = debugBuf;
|
||||
// ImGui::SetTooltip("%s", debugBuf); // Можно включить при необходимости
|
||||
}
|
||||
|
||||
void SilentAimbot(CUserCmd* pCmd) {
|
||||
static bool printed = false;
|
||||
if (!printed) {
|
||||
std::cout << "RepeatedPtrFieldPB_CS2=" << sizeof(RepeatedPtrFieldPB_CS2<int>)
|
||||
<< ", CBaseUserCmdPB_CS2=" << sizeof(CBaseUserCmdPB_CS2)
|
||||
<< ", CCSGOUserCmdPB_CS2=" << sizeof(CCSGOUserCmdPB_CS2)
|
||||
<< ", CUserCmd=" << sizeof(CUserCmd)
|
||||
<< ", csgoUserCmd@0x" << std::hex << offsetof(CUserCmd, csgoUserCmd)
|
||||
<< ", nButtons@0x" << std::hex << offsetof(CUserCmd, nButtons)
|
||||
<< std::dec << std::endl;
|
||||
printed = true;
|
||||
}
|
||||
char debugBuf[256];
|
||||
if (!Config::silent_aim || !pCmd) return;
|
||||
static C_CSPlayerPawn* lockedTarget = nullptr;
|
||||
static bool prevSilentState = false;
|
||||
static QAngle_t last_punch_angle = { 0,0,0 };
|
||||
static int shotCount = 0;
|
||||
static bool targetWasLost = false;
|
||||
static bool targetWasLockedThisPress = false;
|
||||
C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
|
||||
if (!lp || !lp->handle().valid() || lp->getHealth() <= 0) return;
|
||||
Vector_t lep = GetEntityEyePos(lp);
|
||||
// --- Кнопка активации ---
|
||||
bool silentActive = Config::always_on_silent_aim ? true : (GetAsyncKeyState(Config::silent_aim_key) & 0x8000);
|
||||
if (Config::silent_shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
|
||||
silentActive = true;
|
||||
}
|
||||
int shotsFired = lp ? lp->getShotsFired() : 0;
|
||||
shotCount = shotsFired;
|
||||
|
||||
if (silentActive && !prevSilentState) {
|
||||
targetWasLost = false;
|
||||
targetWasLockedThisPress = false;
|
||||
}
|
||||
if (silentActive && !lockedTarget) {
|
||||
if (Config::silent_rage || (!targetWasLost && !targetWasLockedThisPress)) {
|
||||
int nMaxHighestEntity = I::GameEntity->Instance->GetHighestEntityIndex();
|
||||
float bestFov = Config::silent_aim_fov;
|
||||
C_CSPlayerPawn* bestTarget = nullptr;
|
||||
QAngle_t bestAngle{};
|
||||
for (int i = 1; i <= nMaxHighestEntity; i++) {
|
||||
auto Entity = I::GameEntity->Instance->Get(i);
|
||||
if (!Entity) continue;
|
||||
if (!Entity->handle().valid()) continue;
|
||||
SchemaClassInfoData_t* _class = nullptr;
|
||||
Entity->dump_class_info(&_class);
|
||||
if (!_class) continue;
|
||||
const uint32_t hash = HASH(_class->szName);
|
||||
if (hash == HASH("C_CSPlayerPawn")) {
|
||||
C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
|
||||
if (!pawn) continue;
|
||||
if (pawn->get_entity_by_handle() == lp->get_entity_by_handle()) continue;
|
||||
if (pawn->getHealth() <= 0) continue;
|
||||
if (Config::team_check && pawn->getTeam() == lp->getTeam()) continue;
|
||||
Vector_t target_pos;
|
||||
switch (Config::silent_aim_bone) {
|
||||
case Config::BONE_HEAD:
|
||||
target_pos = GetBonePosition(pawn, BONE_INDEX_HEAD); break;
|
||||
case Config::BONE_NECK:
|
||||
target_pos = GetBonePosition(pawn, BONE_INDEX_NECK); break;
|
||||
case Config::BONE_BODY:
|
||||
target_pos = GetBonePosition(pawn, BONE_INDEX_BODY); break;
|
||||
case Config::BONE_NEAREST:
|
||||
default:
|
||||
target_pos = GetAimbotTargetPos(pawn, lep, QAngle_t{}); break;
|
||||
}
|
||||
QAngle_t angle = CalcAngles(target_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
angle.y += 180.f;
|
||||
float fov = sqrtf(angle.x * angle.x + angle.y * angle.y);
|
||||
if (!std::isfinite(fov) || fov > bestFov) continue;
|
||||
bestFov = fov;
|
||||
bestTarget = pawn;
|
||||
bestAngle = angle;
|
||||
}
|
||||
}
|
||||
lockedTarget = bestTarget;
|
||||
last_punch_angle = { 0,0,0 };
|
||||
if (!Config::silent_rage && lockedTarget) targetWasLockedThisPress = true;
|
||||
if (!Config::silent_rage && !lockedTarget) targetWasLost = true;
|
||||
}
|
||||
}
|
||||
if (!silentActive) {
|
||||
lockedTarget = nullptr;
|
||||
last_punch_angle = { 0,0,0 };
|
||||
targetWasLost = false;
|
||||
targetWasLockedThisPress = false;
|
||||
}
|
||||
if (silentActive && lockedTarget) {
|
||||
if (!lp || !lp->handle().valid() || lp->getHealth() <= 0 ||
|
||||
lockedTarget->get_entity_by_handle() == lp->get_entity_by_handle() ||
|
||||
lockedTarget->getHealth() <= 0 ||
|
||||
!lockedTarget->handle().valid() ||
|
||||
(Config::team_check && lockedTarget->getTeam() == lp->getTeam())) {
|
||||
lockedTarget = nullptr;
|
||||
last_punch_angle = { 0,0,0 };
|
||||
targetWasLost = true;
|
||||
prevSilentState = silentActive;
|
||||
return;
|
||||
}
|
||||
Vector_t target_pos;
|
||||
switch (Config::silent_aim_bone) {
|
||||
case Config::BONE_HEAD:
|
||||
target_pos = GetBonePosition(lockedTarget, BONE_INDEX_HEAD); break;
|
||||
case Config::BONE_NECK:
|
||||
target_pos = GetBonePosition(lockedTarget, BONE_INDEX_NECK); break;
|
||||
case Config::BONE_BODY:
|
||||
target_pos = GetBonePosition(lockedTarget, BONE_INDEX_BODY); break;
|
||||
case Config::BONE_NEAREST:
|
||||
default:
|
||||
target_pos = GetAimbotTargetPos(lockedTarget, lep, QAngle_t{}); break;
|
||||
}
|
||||
QAngle_t angle = CalcAngles(target_pos, lep);
|
||||
angle.x *= -1.f;
|
||||
angle.y += 180.f;
|
||||
// --- Smooth ---
|
||||
if (Config::silent_aim_smooth > 0.f) {
|
||||
QAngle_t cur = angle;
|
||||
bool found = false;
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
CCSGOInputHistoryEntryPB_CS2* entry = pCmd->GetInputHistoryEntry(i);
|
||||
if (entry && entry->pViewAngles) {
|
||||
cur = entry->pViewAngles->angValue;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
QAngle_t delta = (angle - cur).Normalize();
|
||||
float smooth = Config::silent_aim_smooth;
|
||||
angle = cur + delta * (1.f / smooth);
|
||||
angle = angle.Normalize();
|
||||
}
|
||||
// --- Устанавливаем угол для всех сабтиков ---
|
||||
int nSubticks = pCmd->csgoUserCmd.inputHistoryField.nCurrentSize;
|
||||
_snprintf_s(debugBuf, sizeof(debugBuf), "nSubticks=%d, pRep=%p", nSubticks, (void*)pCmd->csgoUserCmd.inputHistoryField.pRep);
|
||||
// g_DebugString = debugBuf; // Удалено
|
||||
|
||||
// --- Расширенный отладочный вывод ---
|
||||
// char debugBuf[256]; // Удалено
|
||||
// _snprintf_s(debugBuf, sizeof(debugBuf), // Удалено
|
||||
// "CUserCmd: size=%zu, csgoUserCmd@%zu, nButtons@%zu, nSubticks=%d, pRep=%p, pBaseCmd=%p", // Удалено
|
||||
// sizeof(CUserCmd), // Удалено
|
||||
// offsetof(CUserCmd, csgoUserCmd), // Удалено
|
||||
// offsetof(CUserCmd, nButtons), // Удалено
|
||||
// pCmd->csgoUserCmd.inputHistoryField.nCurrentSize, // Удалено
|
||||
// (void*)pCmd->csgoUserCmd.inputHistoryField.pRep, // Удалено
|
||||
// (void*)pCmd->csgoUserCmd.pBaseCmd); // Удалено
|
||||
// g_DebugString = debugBuf; // Удалено
|
||||
|
||||
ShowSilentAimDebugInfo(pCmd);
|
||||
|
||||
_snprintf_s(debugBuf, sizeof(debugBuf),
|
||||
"sizeof(CUserCmd)=%zu, csgoUserCmd@0x%zX, nButtons@0x%zX",
|
||||
sizeof(CUserCmd),
|
||||
offsetof(CUserCmd, csgoUserCmd),
|
||||
offsetof(CUserCmd, nButtons));
|
||||
g_DebugString = debugBuf;
|
||||
|
||||
_snprintf_s(debugBuf, sizeof(debugBuf),
|
||||
"sizeof(CUserCmd)=%zu, csgoUserCmd@0x%zX, nButtons@0x%zX, RepeatedPtrFieldPB_CS2=%zu, CBaseUserCmdPB_CS2=%zu",
|
||||
sizeof(CUserCmd),
|
||||
offsetof(CUserCmd, csgoUserCmd),
|
||||
offsetof(CUserCmd, nButtons),
|
||||
sizeof(RepeatedPtrFieldPB_CS2<int>),
|
||||
sizeof(CBaseUserCmdPB_CS2));
|
||||
g_DebugString = debugBuf;
|
||||
|
||||
_snprintf_s(debugBuf, sizeof(debugBuf),
|
||||
"RepeatedPtrFieldPB_CS2=%zu, CBaseUserCmdPB_CS2=%zu, CCSGOUserCmdPB_CS2=%zu, CUserCmd=%zu, csgoUserCmd@0x%zX, nButtons@0x%zX",
|
||||
sizeof(RepeatedPtrFieldPB_CS2<int>),
|
||||
sizeof(CBaseUserCmdPB_CS2),
|
||||
sizeof(CCSGOUserCmdPB_CS2),
|
||||
sizeof(CUserCmd),
|
||||
offsetof(CUserCmd, csgoUserCmd),
|
||||
offsetof(CUserCmd, nButtons));
|
||||
g_DebugString = debugBuf;
|
||||
|
||||
|
||||
}
|
||||
prevSilentState = silentActive;
|
||||
}
|
||||
|
||||
@ -1,3 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "CUserCmd.h"
|
||||
|
||||
void Aimbot();
|
||||
void SilentAimbot(CUserCmd* pCmd);
|
||||
void Ver2Aimbot(CUserCmd* pCmd);
|
||||
|
||||
@ -0,0 +1,120 @@
|
||||
#include "spectators.h"
|
||||
#include "../../interfaces/interfaces.h"
|
||||
#include "../../hooks/hooks.h"
|
||||
#include "../../../../external/imgui/imgui.h"
|
||||
#include "../../../cs2/entity/CCSPlayerController/CCSPlayerController.h"
|
||||
#include "../visuals/visuals.h"
|
||||
#include "../../menu/hud.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "../../players/players.h"
|
||||
#include "../../../cs2/entity/C_CSPlayerPawn/C_CSPlayerPawn.h"
|
||||
|
||||
namespace Spectators {
|
||||
|
||||
bool IsPlayerSpectatingYou(CCSPlayerController* controller, C_CSPlayerPawn* localPlayer) {
|
||||
if (!controller || !localPlayer) return false;
|
||||
if (controller->IsLocalPlayer()) return false;
|
||||
|
||||
uintptr_t pObserverServices = *reinterpret_cast<uintptr_t*>(
|
||||
reinterpret_cast<uintptr_t>(controller) +
|
||||
SchemaFinder::Get(hash_32_fnv1a_const("CCSPlayerController->m_pObserverServices"))
|
||||
);
|
||||
if (!pObserverServices) return false;
|
||||
|
||||
CBaseHandle hObserverTarget = *reinterpret_cast<CBaseHandle*>(
|
||||
pObserverServices +
|
||||
SchemaFinder::Get(hash_32_fnv1a_const("CPlayer_ObserverServices->m_hObserverTarget"))
|
||||
);
|
||||
if (!hObserverTarget.valid()) return false;
|
||||
|
||||
g_DebugString = "pObserverServices";
|
||||
|
||||
// Получаем указатель на pawn, за которым наблюдают
|
||||
auto* observerPawn = reinterpret_cast<C_CSPlayerPawn*>(
|
||||
I::GameEntity->Instance->Get(hObserverTarget.index())
|
||||
);
|
||||
if (!observerPawn) return false;
|
||||
|
||||
g_DebugString = "pObserverServices";
|
||||
|
||||
g_DebugString = observerPawn->handle().index() + " " + localPlayer->handle().index();
|
||||
// Сравниваем указатели
|
||||
return observerPawn->handle().index() == localPlayer->handle().index();
|
||||
}
|
||||
|
||||
std::vector<SpectatorInfo> GetSpectators() {
|
||||
std::vector<SpectatorInfo> spectators;
|
||||
if (!H::oGetLocalPlayer || !I::GameEntity || !I::GameEntity->Instance) {
|
||||
g_DebugString = "[Spectators] Не инициализированы (GetSpectators): "
|
||||
+ std::string(!H::oGetLocalPlayer ? "oGetLocalPlayer " : "")
|
||||
+ std::string(!I::GameEntity ? "GameEntity " : "")
|
||||
+ std::string((I::GameEntity && !I::GameEntity->Instance) ? "GameEntity->Instance " : "");
|
||||
return spectators;
|
||||
}
|
||||
C_CSPlayerPawn* localPlayer = H::oGetLocalPlayer(0);
|
||||
if (!localPlayer) {
|
||||
g_DebugString = "[Spectators] localPlayer nullptr (GetSpectators)";
|
||||
return spectators;
|
||||
}
|
||||
|
||||
int maxIdx = I::GameEntity->Instance->GetHighestEntityIndex();
|
||||
|
||||
for (int i = 1; i <= maxIdx; ++i) {
|
||||
auto* entity = I::GameEntity->Instance->Get(i);
|
||||
if (!entity) continue;
|
||||
SchemaClassInfoData_t* classInfo = nullptr;
|
||||
entity->dump_class_info(&classInfo);
|
||||
if (!classInfo || strcmp(classInfo->szName, "CCSPlayerController") != 0)
|
||||
continue;
|
||||
auto* controller = reinterpret_cast<CCSPlayerController*>(entity);
|
||||
if (!controller) continue;
|
||||
if (!controller->m_hPawn().valid()) continue;
|
||||
|
||||
if (!IsPlayerSpectatingYou(controller, localPlayer))
|
||||
continue;
|
||||
|
||||
const char* nameStr = controller->m_sSanitizedPlayerName();
|
||||
std::string name = (nameStr && strlen(nameStr) > 0) ? nameStr : "Unknown";
|
||||
|
||||
spectators.emplace_back(name, false, 0, 0);
|
||||
}
|
||||
return spectators;
|
||||
}
|
||||
|
||||
void RenderPlayersDebugList() {
|
||||
ImGui::Begin("Players Debug List", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
|
||||
if (!H::oGetLocalPlayer) {
|
||||
ImGui::TextColored(ImVec4(1, 0, 0, 1), "[Spectators] oGetLocalPlayer не инициализирован");
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
if (!I::GameEntity) {
|
||||
ImGui::TextColored(ImVec4(1, 0, 0, 1), "[Spectators] GameEntity не инициализирован");
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
if (!I::GameEntity->Instance) {
|
||||
ImGui::TextColored(ImVec4(1, 0, 0, 1), "[Spectators] GameEntity->Instance не инициализирован");
|
||||
ImGui::End();
|
||||
return;
|
||||
}
|
||||
//if (!g_DebugString.empty()) {
|
||||
// ImGui::TextColored(ImVec4(1, 0, 0, 1), "%s", g_DebugString.c_str());
|
||||
// ImGui::End();
|
||||
// return;
|
||||
//}
|
||||
ImGui::Text("Name | Team | Alive | Spectating You");
|
||||
ImGui::Separator();
|
||||
auto spectators = GetSpectators();
|
||||
for (const auto& spectator : spectators) {
|
||||
ImGui::Text("%-20s | %4d | %5s | %s",
|
||||
spectator.name.c_str(),
|
||||
spectator.team,
|
||||
spectator.isAlive ? "yes" : "no",
|
||||
"yes"); // Все из GetSpectators наблюдают за вами
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
} // namespace Spectators
|
||||
@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
#include "../../../../external/imgui/imgui.h"
|
||||
#include "../../../cs2/entity/C_CSPlayerPawn/C_CSPlayerPawn.h"
|
||||
#include "../../../cs2/entity/C_BaseEntity/C_BaseEntity.h"
|
||||
#include "../../config/config.h"
|
||||
#include "../../../cs2/entity/CCSPlayerController/CCSPlayerController.h"
|
||||
|
||||
struct SpectatorInfo {
|
||||
std::string name;
|
||||
bool isLocalPlayer;
|
||||
int team;
|
||||
bool isAlive;
|
||||
|
||||
SpectatorInfo(const std::string& n, bool local, int t, bool alive)
|
||||
: name(n), isLocalPlayer(local), team(t), isAlive(alive) {}
|
||||
};
|
||||
|
||||
namespace Spectators {
|
||||
void RenderSpectatorList();
|
||||
std::vector<SpectatorInfo> GetSpectators();
|
||||
bool IsPlayerSpectatingYou(CCSPlayerController* controller, C_CSPlayerPawn* localPlayer);
|
||||
void RenderPlayersDebugList();
|
||||
}
|
||||
@ -32,67 +32,90 @@ void SimulateLMBUp() {
|
||||
SendInput(1, &input, sizeof(INPUT));
|
||||
}
|
||||
|
||||
static DWORD lastShotTime = 0;
|
||||
void Triggerbot() {
|
||||
static DWORD lastShotTime = 0;
|
||||
// Управление удержанием ЛКМ
|
||||
void SetLMBHeld(bool held) {
|
||||
static bool lmbHeld = false;
|
||||
static bool firstShot = true;
|
||||
if (!Config::triggerbot)
|
||||
return;
|
||||
if (!Config::always_on_triggerbot && Config::triggerbot_key && !(GetAsyncKeyState(Config::triggerbot_key) & 0x8000))
|
||||
return;
|
||||
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000) {
|
||||
if (lmbHeld) {
|
||||
if (held && !lmbHeld) {
|
||||
SimulateLMBDown();
|
||||
lmbHeld = true;
|
||||
} else if (!held && lmbHeld) {
|
||||
SimulateLMBUp();
|
||||
lmbHeld = false;
|
||||
}
|
||||
}
|
||||
|
||||
static DWORD lastShotTime = 0;
|
||||
void Triggerbot() {
|
||||
static DWORD lastShotTime = 0;
|
||||
static bool firstShot = true;
|
||||
// --- Альтернативная кнопка: триггербот по наведению на врага с задержкой ---
|
||||
if (Config::triggerbot_alt_key && (GetAsyncKeyState(Config::triggerbot_alt_key) & 0x8000)) {
|
||||
C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
|
||||
if (!lp || lp->getHealth() <= 0) { SetLMBHeld(false); return; }
|
||||
int crosshairIdx = *(int*)((uintptr_t)lp + 0x1458); // m_iIDEntIndex
|
||||
if (crosshairIdx <= 0) { SetLMBHeld(false); return; }
|
||||
auto target = I::GameEntity->Instance->Get<C_CSPlayerPawn>(crosshairIdx);
|
||||
if (!target) { SetLMBHeld(false); return; }
|
||||
if (target->getHealth() <= 0) { SetLMBHeld(false); return; }
|
||||
if (Config::team_check && target->getTeam() == lp->getTeam()) { SetLMBHeld(false); return; }
|
||||
DWORD64 now = GetTickCount64();
|
||||
static DWORD64 lastAltShotTime = 0;
|
||||
if (now - lastAltShotTime < static_cast<DWORD64>(Config::triggerbot_delay)) {
|
||||
SetLMBHeld(false);
|
||||
return;
|
||||
}
|
||||
SimulateLMBClick();
|
||||
lastAltShotTime = now;
|
||||
return;
|
||||
}
|
||||
if (!Config::triggerbot)
|
||||
return;
|
||||
if (!Config::always_on_triggerbot && Config::triggerbot_key && !(GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000) {
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
|
||||
if (!lp || lp->getHealth() <= 0) { firstShot = true; return; }
|
||||
if (!lp || lp->getHealth() <= 0) { firstShot = true; SetLMBHeld(false); return; }
|
||||
int crosshairIdx = *(int*)((uintptr_t)lp + 0x1458); // m_iIDEntIndex
|
||||
//g_DebugString = "debug: " + std::to_string(crosshairIdx);
|
||||
int shotsFired = lp ? lp->getShotsFired() : 0;
|
||||
DWORD64 now = GetTickCount64();
|
||||
if (Config::shooterAfterAim) {
|
||||
if (shotsFired > 0) {
|
||||
// После первого выстрела просто удерживаем ЛКМ, игнорируя все условия
|
||||
SetLMBHeld(true);
|
||||
return;
|
||||
} else {
|
||||
// До первого выстрела — обычная логика триггербота
|
||||
if (crosshairIdx <= 0) {
|
||||
if (lmbHeld) {
|
||||
SimulateLMBUp();
|
||||
lmbHeld = false;
|
||||
}
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
auto target = I::GameEntity->Instance->Get<C_CSPlayerPawn>(crosshairIdx);
|
||||
if (!target) {
|
||||
if (lmbHeld) {
|
||||
SimulateLMBUp();
|
||||
lmbHeld = false;
|
||||
}
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
if (target->getHealth() <= 0) {
|
||||
if (lmbHeld) {
|
||||
SimulateLMBUp();
|
||||
lmbHeld = false;
|
||||
}
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
if (Config::team_check && target->getTeam() == lp->getTeam()) {
|
||||
if (lmbHeld) {
|
||||
SimulateLMBUp();
|
||||
lmbHeld = false;
|
||||
}
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
DWORD64 now = GetTickCount64();
|
||||
if (!Config::triggerbot_hold_lmb) {
|
||||
if (now - lastShotTime < static_cast<DWORD64>(Config::triggerbot_delay)) {
|
||||
if (lmbHeld) {
|
||||
SimulateLMBUp();
|
||||
lmbHeld = false;
|
||||
}
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
@ -103,9 +126,55 @@ void Triggerbot() {
|
||||
firstShot = false;
|
||||
lastShotTime = now;
|
||||
return;
|
||||
} else if (!lmbHeld) {
|
||||
SimulateLMBDown();
|
||||
lmbHeld = true;
|
||||
} else {
|
||||
SetLMBHeld(true);
|
||||
}
|
||||
lastShotTime = now;
|
||||
return;
|
||||
}
|
||||
SimulateLMBClick();
|
||||
lastShotTime = now;
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
// --- Обычная логика триггербота, если shooterAfterAim выключен ---
|
||||
if (crosshairIdx <= 0) {
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
auto target = I::GameEntity->Instance->Get<C_CSPlayerPawn>(crosshairIdx);
|
||||
if (!target) {
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
if (target->getHealth() <= 0) {
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
if (Config::team_check && target->getTeam() == lp->getTeam()) {
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
if (!Config::triggerbot_hold_lmb) {
|
||||
if (now - lastShotTime < static_cast<DWORD64>(Config::triggerbot_delay)) {
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Config::triggerbot_hold_lmb) {
|
||||
if (firstShot) {
|
||||
SimulateLMBClick();
|
||||
firstShot = false;
|
||||
lastShotTime = now;
|
||||
return;
|
||||
} else {
|
||||
SetLMBHeld(true);
|
||||
}
|
||||
lastShotTime = now;
|
||||
return;
|
||||
|
||||
@ -40,20 +40,16 @@ void Esp::cache()
|
||||
if (!entityInfo) continue;
|
||||
|
||||
if (strcmp(entityInfo->szName, "C_CSPlayerPawn") == 0) {
|
||||
bool exists = std::any_of(Players::pawns.begin(), Players::pawns.end(),
|
||||
[&](const C_CSPlayerPawn& pawn) { return pawn.getAddress() == entityPointer; });
|
||||
if (!exists) {
|
||||
Players::pawns.emplace_back(entityPointer);
|
||||
if (!Players::pawns.contains(entityPointer)) {
|
||||
Players::pawns.insert(entityPointer);
|
||||
std::cout << "Added pawn " << Players::pawns.size() << "\n";
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcmp(entityInfo->szName, "CCSPlayerController") == 0) {
|
||||
bool exists = std::any_of(Players::controllers.begin(), Players::controllers.end(),
|
||||
[&](const CCSPlayerController& controller) { return controller.getAddress() == entityPointer; });
|
||||
if (!exists) {
|
||||
Players::controllers.emplace_back(entityPointer);
|
||||
if (!Players::controllers.contains(entityPointer)) {
|
||||
Players::controllers.insert(entityPointer);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -27,9 +27,6 @@ void __fastcall H::hkFrameStageNotify(void* a1, int stage)
|
||||
// frame_render_stage | 9
|
||||
if (stage == 9 && oGetLocalPlayer(0)) {
|
||||
Esp::cache();
|
||||
|
||||
Aimbot();
|
||||
Triggerbot(); // <--- вызов триггербота
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,6 +38,14 @@ void* __fastcall H::hkLevelInit(void* pClientModeShared, const char* szNewMap) {
|
||||
return LevelInit.GetOriginal()(pClientModeShared, szNewMap);
|
||||
}
|
||||
|
||||
bool __fastcall H::hkCreateMove(void* pInput, int nSlot, void* pCmd) {
|
||||
//Aimbot();
|
||||
//SilentAimbot(reinterpret_cast<CUserCmd*>(pCmd));
|
||||
Ver2Aimbot(reinterpret_cast<CUserCmd*>(pCmd));
|
||||
Triggerbot();
|
||||
return CreateMove.GetOriginal()(pInput, nSlot, pCmd);
|
||||
}
|
||||
|
||||
void H::Hooks::init() {
|
||||
|
||||
oGetWeaponData = *reinterpret_cast<int*>(M::patternScan("client", ("48 8B 81 ? ? ? ? 85 D2 78 ? 48 83 FA ? 73 ? F3 0F 10 84 90 ? ? ? ? C3 F3 0F 10 80 ? ? ? ? C3 CC CC CC CC")) + 0x3);
|
||||
@ -53,6 +58,7 @@ void H::Hooks::init() {
|
||||
GetRenderFov.Add((void*)M::getAbsoluteAddress(M::patternScan("client", "E8 ? ? ? ? F3 0F 11 45 00 48 8B 5C 24 40"), 1), &hkGetRenderFov);
|
||||
LevelInit.Add((void*)M::getAbsoluteAddress(M::patternScan("client", "E8 ? ? ? ? C6 83 ? ? ? ? ? C6 83"), 1), &hkLevelInit);
|
||||
RenderFlashBangOverlay.Add((void*)M::patternScan("client", ("85 D2 0F 88 ? ? ? ? 55 56 41 55")), &hkRenderFlashbangOverlay);
|
||||
CreateMove.Add((void*)M::patternScan("client", ("48 8B C4 4C 89 40 18 48 89 48 08 55 53 57 41 54 48 8D A8")), &hkCreateMove);
|
||||
|
||||
MH_EnableHook(MH_ALL_HOOKS);
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ namespace H {
|
||||
void* __fastcall hkLevelInit(void* pClientModeShared, const char* szNewMap);
|
||||
void __fastcall hkChamsObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2);
|
||||
void __fastcall hkRenderFlashbangOverlay(void* a1, void* a2, void* a3, void* a4, void* a5);
|
||||
bool __fastcall hkCreateMove(void* pInput, int nSlot, void* pCmd);
|
||||
inline float g_flActiveFov;
|
||||
float hkGetRenderFov(void* rcx);
|
||||
|
||||
@ -25,6 +26,7 @@ namespace H {
|
||||
inline CInlineHookObj<decltype(&hkGetRenderFov)> GetRenderFov = { };
|
||||
inline CInlineHookObj<decltype(&hkLevelInit)> LevelInit = { };
|
||||
inline CInlineHookObj<decltype(&hkRenderFlashbangOverlay)> RenderFlashBangOverlay = { };
|
||||
inline CInlineHookObj<decltype(&hkCreateMove)> CreateMove = { };
|
||||
|
||||
// inline hooks
|
||||
inline int oGetWeaponData;
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <DirectXMath.h>
|
||||
#include "../features/spectators/spectators.h"
|
||||
|
||||
std::string g_DebugString;
|
||||
|
||||
@ -79,4 +80,16 @@ void Hud::render() {
|
||||
ImU32 debugColor = IM_COL32(255, 255, 0, 255); // жёлтый
|
||||
ImGui::GetBackgroundDrawList()->AddText(debugPos, debugColor, g_DebugString.c_str());
|
||||
}
|
||||
|
||||
// Отображение списка наблюдателей
|
||||
//Spectators::RenderSpectatorList();
|
||||
//Spectators::RenderPlayersDebugList();
|
||||
|
||||
|
||||
// Тестовая информация для отладки
|
||||
//static int testCounter = 0;
|
||||
//testCounter++;
|
||||
//if (testCounter % 60 == 0) { // Каждую секунду (при 60 FPS)
|
||||
// g_DebugString = "Spectator test: " + std::to_string(Spectators::GetSpectators().size()) + " players found";
|
||||
//}
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "../features/spectators/spectators.h"
|
||||
extern std::string g_DebugString;
|
||||
|
||||
class Hud {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user