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;
|
||||
File diff suppressed because it is too large
Load Diff
@ -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,137 @@ void SimulateLMBUp() {
|
||||
SendInput(1, &input, sizeof(INPUT));
|
||||
}
|
||||
|
||||
// Управление удержанием ЛКМ
|
||||
void SetLMBHeld(bool held) {
|
||||
static bool lmbHeld = false;
|
||||
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 lmbHeld = false;
|
||||
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))
|
||||
if (!Config::always_on_triggerbot && Config::triggerbot_key && !(GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
|
||||
SetLMBHeld(false);
|
||||
firstShot = true;
|
||||
return;
|
||||
}
|
||||
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000) {
|
||||
if (lmbHeld) {
|
||||
SimulateLMBUp();
|
||||
lmbHeld = false;
|
||||
}
|
||||
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);
|
||||
if (crosshairIdx <= 0) {
|
||||
if (lmbHeld) {
|
||||
SimulateLMBUp();
|
||||
lmbHeld = false;
|
||||
int shotsFired = lp ? lp->getShotsFired() : 0;
|
||||
DWORD64 now = GetTickCount64();
|
||||
if (Config::shooterAfterAim) {
|
||||
if (shotsFired > 0) {
|
||||
// После первого выстрела просто удерживаем ЛКМ, игнорируя все условия
|
||||
SetLMBHeld(true);
|
||||
return;
|
||||
} else {
|
||||
// До первого выстрела — обычная логика триггербота
|
||||
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;
|
||||
}
|
||||
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) {
|
||||
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 +173,8 @@ void Triggerbot() {
|
||||
firstShot = false;
|
||||
lastShotTime = now;
|
||||
return;
|
||||
} else if (!lmbHeld) {
|
||||
SimulateLMBDown();
|
||||
lmbHeld = true;
|
||||
} 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