Fix Demoknight Aimbot (and a crash in it)
This commit is contained in:
parent
480dd64ce8
commit
f5320b3690
@ -29,7 +29,7 @@ public:
|
|||||||
}
|
}
|
||||||
inline static IClientEntity *GetEquippedDemoShield(IClientEntity *self)
|
inline static IClientEntity *GetEquippedDemoShield(IClientEntity *self)
|
||||||
{
|
{
|
||||||
static auto signature = gSignatures.GetClientSignature("55 89 E5 57 56 53 83 EC 2C 8B 45 ? 8B 98 ? ? ? ? 85 DB 7E");
|
static auto signature = e8call_direct(gSignatures.GetClientSignature("E8 ? ? ? ? 8B 55 ? 85 C0 0F 84 ? ? ? ? 89 5C 24"));
|
||||||
typedef IClientEntity *(*GetEquippedDemoShield_t)(IClientEntity *);
|
typedef IClientEntity *(*GetEquippedDemoShield_t)(IClientEntity *);
|
||||||
static GetEquippedDemoShield_t GetEquippedDemoShield_fn = GetEquippedDemoShield_t(signature);
|
static GetEquippedDemoShield_t GetEquippedDemoShield_fn = GetEquippedDemoShield_t(signature);
|
||||||
return GetEquippedDemoShield_fn(self);
|
return GetEquippedDemoShield_fn(self);
|
||||||
|
@ -62,7 +62,7 @@ std::pair<CachedEntity *, Vector> FindBestEnt(bool teammate, bool Predict, bool
|
|||||||
continue;
|
continue;
|
||||||
float scr = ent->m_flDistance();
|
float scr = ent->m_flDistance();
|
||||||
std::optional<backtrack::BacktrackData> data = std::nullopt;
|
std::optional<backtrack::BacktrackData> data = std::nullopt;
|
||||||
if (!shouldBacktrack && demoknight_mode)
|
if (shouldBacktrack && demoknight_mode)
|
||||||
{
|
{
|
||||||
auto good_ticks = backtrack::getGoodTicks(ent);
|
auto good_ticks = backtrack::getGoodTicks(ent);
|
||||||
if (good_ticks)
|
if (good_ticks)
|
||||||
@ -144,7 +144,7 @@ std::pair<CachedEntity *, Vector> FindBestEnt(bool teammate, bool Predict, bool
|
|||||||
float scr = ent->m_flDistance();
|
float scr = ent->m_flDistance();
|
||||||
std::optional<backtrack::BacktrackData> data = std::nullopt;
|
std::optional<backtrack::BacktrackData> data = std::nullopt;
|
||||||
|
|
||||||
if (!shouldBacktrack && demoknight_mode)
|
if (shouldBacktrack && demoknight_mode)
|
||||||
{
|
{
|
||||||
auto good_ticks = backtrack::getGoodTicks(ent);
|
auto good_ticks = backtrack::getGoodTicks(ent);
|
||||||
if (good_ticks)
|
if (good_ticks)
|
||||||
@ -649,14 +649,16 @@ float CAM_CapYaw_Hook(IInput *this_, float fVal)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define foffset(p, i) ((unsigned char *) &p)[i]
|
#define foffset(p, i) ((unsigned char *) &p)[i]
|
||||||
static InitRoutine init([]() {
|
static InitRoutine init(
|
||||||
EC::Register(EC::CreateMove, CreateMove, "cm_miscaimbot", EC::average);
|
[]()
|
||||||
EC::Register(EC::CreateMoveWarp, CreateMove, "cmw_miscaimbot", EC::average);
|
{
|
||||||
|
EC::Register(EC::CreateMove, CreateMove, "cm_miscaimbot", EC::average);
|
||||||
|
EC::Register(EC::CreateMoveWarp, CreateMove, "cmw_miscaimbot", EC::average);
|
||||||
|
|
||||||
static auto signature = gSignatures.GetClientSignature("55 89 E5 53 83 EC 14 E8 ? ? ? ? 85 C0 74 ? 8D 98 ? ? ? ? C7 44 24 ? 11 00 00 00");
|
static auto signature = gSignatures.GetClientSignature("55 89 E5 53 83 EC 14 E8 ? ? ? ? 85 C0 74 ? 8D 98 ? ? ? ? C7 44 24 ? 11 00 00 00");
|
||||||
|
|
||||||
CAM_CapYaw_detour.Init(signature, (void *) CAM_CapYaw_Hook);
|
CAM_CapYaw_detour.Init(signature, (void *) CAM_CapYaw_Hook);
|
||||||
EC::Register(
|
EC::Register(
|
||||||
EC::Shutdown, []() { CAM_CapYaw_detour.Shutdown(); }, "chargeaim_shutdown");
|
EC::Shutdown, []() { CAM_CapYaw_detour.Shutdown(); }, "chargeaim_shutdown");
|
||||||
});
|
});
|
||||||
} // namespace hacks::tf2::misc_aimbot
|
} // namespace hacks::tf2::misc_aimbot
|
||||||
|
Reference in New Issue
Block a user