test
This commit is contained in:
parent
f892794557
commit
03af6d458c
@ -81,4 +81,5 @@ namespace Config {
|
||||
bool always_on_silent_aim = false;
|
||||
float silent_aim_smooth_slider = 0.0f; // Новый параметр для ползунка смуза
|
||||
bool silent_shooterAfterAim = false; // Аналог shooterAfterAim для сайлент аимбота
|
||||
bool silent_rage = false; // По умолчанию выключен
|
||||
}
|
||||
|
||||
@ -88,4 +88,5 @@ namespace Config {
|
||||
extern bool always_on_silent_aim;
|
||||
extern float silent_aim_smooth_slider; // Новый параметр для ползунка смуза
|
||||
extern bool silent_shooterAfterAim; // Аналог shooterAfterAim для сайлент аимбота
|
||||
extern bool silent_rage; // Включает постоянный поиск цели (rage-режим)
|
||||
}
|
||||
|
||||
@ -136,6 +136,7 @@ namespace internal_config
|
||||
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;
|
||||
@ -252,6 +253,7 @@ namespace internal_config
|
||||
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);
|
||||
|
||||
|
||||
@ -1,29 +1,150 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <array>
|
||||
#include "../../../templeware/utils/math/vector/vector.h"
|
||||
|
||||
struct CCmdQAngle {
|
||||
#pragma pack(push, 1)
|
||||
// --- Протобуферные структуры для сабтиков (CS2) ---
|
||||
|
||||
struct CCmdQAnglePB {
|
||||
QAngle_t angValue;
|
||||
};
|
||||
|
||||
class CBaseUserCmdPB {
|
||||
public:
|
||||
char pad_0x00[0x40];
|
||||
CCmdQAngle* pViewangles; // 0x40
|
||||
// ... другие поля не нужны для silent aim
|
||||
struct CCmdVectorPB {
|
||||
Vector4D_t vecValue;
|
||||
};
|
||||
|
||||
class CCSGOUserCmdPB {
|
||||
public:
|
||||
char pad_0x00[0x18];
|
||||
CBaseUserCmdPB* pBase; // 0x18
|
||||
// ... другие поля не нужны для silent aim
|
||||
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[0x18];
|
||||
CCSGOUserCmdPB pBase; // 0x18
|
||||
// ... другие поля не нужны для silent aim
|
||||
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;
|
||||
@ -15,6 +15,7 @@
|
||||
#include <Psapi.h>
|
||||
#include "../../menu/hud.h"
|
||||
#include "../../menu/menu.h"
|
||||
#include <iostream>
|
||||
|
||||
// Адреса из дампа (актуально для 2024-07-18)
|
||||
#define DW_SENSITIVITY 0x1A6A9D8
|
||||
@ -195,7 +196,8 @@ void Aimbot() {
|
||||
bool rcsActive = false;
|
||||
if (Config::shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
|
||||
rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
|
||||
}
|
||||
if (rcsActive && shotsFired > 1) {
|
||||
@ -204,7 +206,8 @@ void Aimbot() {
|
||||
//g_DebugString = "debug: " + std::to_string(punchDelta.x);
|
||||
angle -= cur_punch_angle * 2.f;
|
||||
last_punch_angle = cur_punch_angle;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
last_punch_angle = { 0,0,0 };
|
||||
}
|
||||
angle.z = 0.f;
|
||||
@ -224,7 +227,8 @@ void Aimbot() {
|
||||
angle = cur + delta * (1.f / smooth);
|
||||
angle = angle.Normalize();
|
||||
*viewangles = angle;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
*viewangles = angle;
|
||||
}
|
||||
}
|
||||
@ -312,7 +316,8 @@ void Aimbot() {
|
||||
bool rcsActive = false;
|
||||
if (Config::shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
|
||||
rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
|
||||
}
|
||||
if (rcsActive && shotCount > 1) {
|
||||
@ -321,7 +326,8 @@ void Aimbot() {
|
||||
//g_DebugString = "debug: " + std::to_string(punchDelta.x);
|
||||
angle -= cur_punch_angle * 2.f;
|
||||
last_punch_angle = cur_punch_angle;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
last_punch_angle = { 0,0,0 };
|
||||
}
|
||||
angle.z = 0.f;
|
||||
@ -340,7 +346,8 @@ void Aimbot() {
|
||||
angle = cur + delta * (1.f / smooth);
|
||||
angle = angle.Normalize();
|
||||
*viewangles = angle;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
*viewangles = angle;
|
||||
}
|
||||
}
|
||||
@ -390,64 +397,41 @@ void Aimbot() {
|
||||
prevAimbotState = aimbotActive;
|
||||
}
|
||||
|
||||
void SilentAimbot(CUserCmd* pCmd) {
|
||||
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);
|
||||
QAngle_t* cur = (QAngle_t*)(modules.getModule("client") + 0x1A78650);
|
||||
// Получаем 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);
|
||||
// --- shooterAfterAim + triggerbot_key для сайлент аимбота ---
|
||||
if (Config::silent_shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
|
||||
silentActive = true;
|
||||
}
|
||||
int shotsFired = lp ? lp->getShotsFired() : 0;
|
||||
shotCount = shotsFired;
|
||||
|
||||
// Если кнопка только что нажата — ищем новую цель
|
||||
// --- Сброс флагов при новом нажатии ---
|
||||
if (silentActive && !prevSilentState) {
|
||||
int nMaxHighestEntity = I::GameEntity->Instance->GetHighestEntityIndex();
|
||||
float bestFov = Config::aimbot_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;
|
||||
Vector_t target_pos = GetAimbotTargetPos(pawn, lep, *cur);
|
||||
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;
|
||||
targetWasLost = false;
|
||||
targetWasLockedThisPress = false;
|
||||
}
|
||||
}
|
||||
lockedTarget = bestTarget;
|
||||
last_punch_angle = {0,0,0};
|
||||
}
|
||||
|
||||
// Если кнопка зажата, цели нет — постоянный поиск цели
|
||||
// --- Поиск цели ---
|
||||
if (silentActive && !lockedTarget) {
|
||||
if (Config::silent_rage || (!targetWasLost && !targetWasLockedThisPress)) {
|
||||
int nMaxHighestEntity = I::GameEntity->Instance->GetHighestEntityIndex();
|
||||
float bestFov = Config::aimbot_fov;
|
||||
float bestFov = Config::silent_aim_fov;
|
||||
C_CSPlayerPawn* bestTarget = nullptr;
|
||||
QAngle_t bestAngle = { 0, 0, 0 };
|
||||
for (int i = 1; i <= nMaxHighestEntity; i++) {
|
||||
@ -464,7 +448,19 @@ void SilentAimbot(CUserCmd* pCmd) {
|
||||
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 = GetAimbotTargetPos(pawn, lep, *cur);
|
||||
// --- Выбор кости для 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;
|
||||
@ -477,17 +473,20 @@ void SilentAimbot(CUserCmd* pCmd) {
|
||||
}
|
||||
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 ||
|
||||
@ -495,24 +494,26 @@ void SilentAimbot(CUserCmd* pCmd) {
|
||||
(Config::team_check && lockedTarget->getTeam() == lp->getTeam())) {
|
||||
lockedTarget = nullptr;
|
||||
last_punch_angle = { 0,0,0 };
|
||||
targetWasLost = true;
|
||||
prevSilentState = silentActive;
|
||||
return;
|
||||
}
|
||||
Vector_t target_pos = GetAimbotTargetPos(lockedTarget, lep, *cur);
|
||||
// --- Выбор кости для 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;
|
||||
//QAngle_t cur_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
|
||||
//// --- RCS ---
|
||||
//bool rcsActive = (Config::rcs || Config::silent_shooterAfterAim) && (shotCount > Config::rcsActivationShots);
|
||||
//if (rcsActive && shotCount > 1) {
|
||||
// angle -= cur_punch_angle * 2.f;
|
||||
// last_punch_angle = cur_punch_angle;
|
||||
//} else {
|
||||
// last_punch_angle = {0,0,0};
|
||||
//}
|
||||
//angle.z = 0.f;
|
||||
//angle = angle.Normalize();
|
||||
// --- Smooth ---
|
||||
if (Config::silent_aim_smooth > 0.f) {
|
||||
QAngle_t delta = (angle - *cur).Normalize();
|
||||
@ -524,3 +525,201 @@ void SilentAimbot(CUserCmd* pCmd) {
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
@ -4,3 +4,4 @@
|
||||
|
||||
void Aimbot();
|
||||
void SilentAimbot(CUserCmd* pCmd);
|
||||
void Ver2Aimbot(CUserCmd* pCmd);
|
||||
|
||||
@ -40,7 +40,8 @@ void* __fastcall H::hkLevelInit(void* pClientModeShared, const char* szNewMap) {
|
||||
|
||||
bool __fastcall H::hkCreateMove(void* pInput, int nSlot, void* pCmd) {
|
||||
//Aimbot();
|
||||
SilentAimbot(reinterpret_cast<CUserCmd*>(pCmd));
|
||||
//SilentAimbot(reinterpret_cast<CUserCmd*>(pCmd));
|
||||
Ver2Aimbot(reinterpret_cast<CUserCmd*>(pCmd));
|
||||
Triggerbot();
|
||||
return CreateMove.GetOriginal()(pInput, nSlot, pCmd);
|
||||
}
|
||||
|
||||
@ -209,6 +209,7 @@ void Menu::render() {
|
||||
keybind.menuButton(Config::silent_aim_key);
|
||||
ImGui::Checkbox("Always On##SilentAim", &Config::always_on_silent_aim);
|
||||
ImGui::Checkbox("Shooter After Aim##Silent", &Config::silent_shooterAfterAim); // Новый чекбокс
|
||||
ImGui::Checkbox("Rage mode##Silent", &Config::silent_rage); // Новый чекбокс
|
||||
ImGui::SliderFloat("Smooth##SilentAim", &Config::silent_aim_smooth_slider, 0.f, 10.f, "%.2f");
|
||||
Config::silent_aim_smooth = Config::silent_aim_smooth_slider; // Применяем значение ползунка к логике
|
||||
ImGui::SliderFloat("Silent Aim FOV", &Config::silent_aim_fov, 1.f, 180.f, "%1.0f");
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user