Add more very useful stuff like Gravity compensation on building aimbbot and less buffer overflows

This commit is contained in:
LightCat 2018-09-29 11:19:50 +02:00
parent 5f90fe3211
commit 1ab5c448d8
12 changed files with 116 additions and 35 deletions

1
TODO
View File

@ -26,7 +26,6 @@ No Trigger Mediguns // //
More projectile weapons aimbot (wrap assassin, wrangler, airstrike) // // More projectile weapons aimbot (wrap assassin, wrangler, airstrike) // //
// // // //
// // // //
Make building aimbot compensate for gravity on projectile weapons // //
// // // //
// // // //
// // // //

View File

@ -1,5 +1,6 @@
<Tab name="Misc2"> <Tab name="Misc2">
<TabContainer width="fill" height="fill"> <TabContainer width="fill" height="fill">
<Include path="nullifiedcat/misc/remove.xml"/> <Include path="nullifiedcat/misc/remove.xml"/>
<Include path="nullifiedcat/misc/sandwich.xml"/>
</TabContainer> </TabContainer>
</Tab> </Tab>

View File

@ -17,6 +17,8 @@ Vector SimpleLatencyPrediction(CachedEntity *ent, int hb);
bool PerformProjectilePrediction(CachedEntity *target, int hitbox); bool PerformProjectilePrediction(CachedEntity *target, int hitbox);
Vector BuildingPrediction(CachedEntity *building, Vector vec, float speed,
float gravity);
Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed, Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed,
float gravitymod, float entgmod); float gravitymod, float entgmod);
Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed, Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed,

View File

@ -125,19 +125,19 @@ constexpr rgba_t empty = FromRGBA8(0, 0, 0, 0);
constexpr rgba_t FromHSL(float h, float s, float v) constexpr rgba_t FromHSL(float h, float s, float v)
{ {
if (s <= 0.0) if (s <= 0.0f)
{ // < is bogus, just shuts up warnings { // < is bogus, just shuts up warnings
return rgba_t{ v, v, v, 1.0f }; return rgba_t{ v, v, v, 1.0f };
} }
float hh = h; float hh = h;
if (hh >= 360.0) if (hh >= 360.0f)
hh = 0.0; hh = 0.0f;
hh /= 60.0; hh /= 60.0f;
long i = long(hh); long i = long(hh);
float ff = hh - i; float ff = hh - i;
float p = v * (1.0 - s); float p = v * (1.0f - s);
float q = v * (1.0 - (s * ff)); float q = v * (1.0f - (s * ff));
float t = v * (1.0 - (s * (1.0 - ff))); float t = v * (1.0f - (s * (1.0f - ff)));
switch (i) switch (i)
{ {
@ -149,7 +149,6 @@ constexpr rgba_t FromHSL(float h, float s, float v)
return rgba_t{ p, v, t, 1.0f }; return rgba_t{ p, v, t, 1.0f };
case 3: case 3:
return rgba_t{ p, q, v, 1.0f }; return rgba_t{ p, q, v, 1.0f };
break;
case 4: case 4:
return rgba_t{ t, p, v, 1.0f }; return rgba_t{ t, p, v, 1.0f };
case 5: case 5:

View File

@ -438,8 +438,7 @@ bool IsTargetStateGood(CachedEntity *entity)
{ {
PROF_SECTION(PT_aimbot_targetstatecheck); PROF_SECTION(PT_aimbot_targetstatecheck);
if (shouldBacktrack() && if (shouldBacktrack() && entity->m_Type() != ENTITY_PLAYER)
entity->m_Type() != ENTITY_PLAYER)
return false; return false;
// Checks for Players // Checks for Players
if (entity->m_Type() == ENTITY_PLAYER) if (entity->m_Type() == ENTITY_PLAYER)
@ -827,7 +826,7 @@ void DoAutoshoot()
// Release Sticky if > chargetime, 3.85 is the max second chargetime, // Release Sticky if > chargetime, 3.85 is the max second chargetime,
// but we want a percent so here we go // but we want a percent so here we go
if ((chargetime >= 3.85f / *sticky_autoshoot) && begansticky > 3) if ((chargetime >= 3.85f * *sticky_autoshoot) && begansticky > 3)
{ {
current_user_cmd->buttons &= ~IN_ATTACK; current_user_cmd->buttons &= ~IN_ATTACK;
hacks::shared::antiaim::SetSafeSpace(3); hacks::shared::antiaim::SetSafeSpace(3);
@ -929,7 +928,8 @@ const Vector &PredictEntity(CachedEntity *entity)
} }
else if (entity->m_Type() == ENTITY_BUILDING) else if (entity->m_Type() == ENTITY_BUILDING)
{ {
result = GetBuildingPosition(entity); result = BuildingPrediction(entity, GetBuildingPosition(entity),
cur_proj_speed, cur_proj_grav);
// Other // Other
} }
else else

View File

@ -7,6 +7,7 @@ if(NOT LagbotMode)
target_sources(cathook PRIVATE target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Achievement.cpp" "${CMAKE_CURRENT_LIST_DIR}/Achievement.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Aimbot.cpp" "${CMAKE_CURRENT_LIST_DIR}/Aimbot.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AimSandwich.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Announcer.cpp" "${CMAKE_CURRENT_LIST_DIR}/Announcer.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiAim.cpp" "${CMAKE_CURRENT_LIST_DIR}/AntiAim.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiAntiAim.cpp" "${CMAKE_CURRENT_LIST_DIR}/AntiAntiAim.cpp"

View File

@ -58,14 +58,15 @@ std::string ComposeKillSay(IGameEvent *event)
if (g_IEngine->GetPlayerForUserID(kid) != g_IEngine->GetLocalPlayer()) if (g_IEngine->GetPlayerForUserID(kid) != g_IEngine->GetLocalPlayer())
return ""; return "";
std::string msg = source->at(rand() % source->size()); std::string msg = source->at(rand() % source->size());
if(source->size() != 1) if (source->size() != 1)
{ {
// checks if the killsays.txt file is not 1 line. 100% sure it's going to crash if it is. // checks if the killsays.txt file is not 1 line. 100% sure it's going
while (msg == lastmsg) //to crash if it is.
{ while (msg == lastmsg)
msg = source->at(rand() % source->size()); {
} msg = source->at(rand() % source->size());
lastmsg = msg; }
lastmsg = msg;
} }
player_info_s info; player_info_s info;
g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(vid), &info); g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(vid), &info);

View File

@ -26,7 +26,8 @@ static settings::Bool engine_pred{ "misc.engine-prediction", "false" };
static settings::Bool debug_projectiles{ "debug.projectiles", "false" }; static settings::Bool debug_projectiles{ "debug.projectiles", "false" };
static settings::Int semiauto{ "misc.semi-auto", "0" }; static settings::Int semiauto{ "misc.semi-auto", "0" };
static settings::Int fakelag_amount{ "misc.fakelag", "0" }; static settings::Int fakelag_amount{ "misc.fakelag", "0" };
static settings::Bool auto_disguise{ "misc.autodisguise", "true" }; static settings::Bool auto_disguise{ "misc.autodisguise", "false" };
static settings::Bool fuckmode{ "misc.fuckmode", "false" };
class CMoveData; class CMoveData;
#if LAGBOT_MODE #if LAGBOT_MODE
@ -142,9 +143,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
{ {
if (CE_GOOD(LOCAL_W) && minigun_jump && if (CE_GOOD(LOCAL_W) && minigun_jump &&
LOCAL_W->m_iClassID() == CL_CLASS(CTFMinigun)) LOCAL_W->m_iClassID() == CL_CLASS(CTFMinigun))
{
CE_INT(LOCAL_W, netvar.iWeaponState) = 0; CE_INT(LOCAL_W, netvar.iWeaponState) = 0;
}
} }
#endif #endif
ret = original::CreateMove(this_, input_sample_time, cmd); ret = original::CreateMove(this_, input_sample_time, cmd);
@ -201,6 +200,12 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
ipc::UpdateServerAddress(); ipc::UpdateServerAddress();
#endif #endif
} }
if (*fuckmode)
{
static int prevbuttons = 0;
current_user_cmd->buttons |= prevbuttons;
prevbuttons |= current_user_cmd->buttons;
}
hooked_methods::CreateMove(); hooked_methods::CreateMove();
if (nolerp) if (nolerp)

View File

@ -55,17 +55,11 @@ DEFINE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *this_,
{ {
IClientEntity *ent = unk->GetIClientEntity(); IClientEntity *ent = unk->GetIClientEntity();
if (ent) if (ent)
{
if (ent->entindex() == spectator_target) if (ent->entindex() == spectator_target)
{
return; return;
}
}
if (ent && !effect_chams::g_EffectChams.drawing && if (ent && !effect_chams::g_EffectChams.drawing &&
effect_chams::g_EffectChams.ShouldRenderChams(ent)) effect_chams::g_EffectChams.ShouldRenderChams(ent))
{
return; return;
}
} }
return original::DrawModelExecute(this_, state, info, bone); return original::DrawModelExecute(this_, state, info, bone);

View File

@ -192,7 +192,8 @@ CatCommand pl_set_state(
continue; continue;
std::string currname(info.name); std::string currname(info.name);
std::replace(currname.begin(), currname.end(), ' ', '-'); std::replace(currname.begin(), currname.end(), ' ', '-');
std::replace_if(currname.begin(), currname.end(),[](char x){return !isprint(x);}, '*'); std::replace_if(currname.begin(), currname.end(),
[](char x) { return !isprint(x); }, '*');
if (currname.find(name) != 0) if (currname.find(name) != 0)
continue; continue;
id = i; id = i;
@ -259,7 +260,8 @@ static int cat_pl_set_state_completionCallback(
continue; continue;
std::string name(info.name); std::string name(info.name);
std::replace(name.begin(), name.end(), ' ', '-'); std::replace(name.begin(), name.end(), ' ', '-');
std::replace_if(name.begin(), name.end(),[](char x){return !isprint(x);}, '*'); std::replace_if(name.begin(), name.end(),
[](char x) { return !isprint(x); }, '*');
names.push_back(name); names.push_back(name);
} }
std::sort(names.begin(), names.end()); std::sort(names.begin(), names.end());

View File

@ -256,7 +256,66 @@ Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed,
result.y - origin.y, result.z - origin.z);*/ result.y - origin.y, result.z - origin.z);*/
return result; return result;
} }
Vector BuildingPrediction(CachedEntity *building, Vector vec, float speed,
float gravity)
{
if (!vec.z || CE_BAD(building))
return Vector();
Vector result = vec;
// if (not debug_pp_extrapolate) {
//} else {
// result = SimpleLatencyPrediction(ent, hb);
//
//}
float latency = g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING) +
g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_INCOMING);
if (speed == 0.0f)
return Vector();
trace::filter_no_player.SetSelf(RAW_ENT(building));
float dtg = DistanceToGround(vec);
// TODO ProjAim
float medianTime = g_pLocalPlayer->v_Eye.DistTo(result) / speed;
float range = 1.5f;
float currenttime = medianTime - range;
if (currenttime <= 0.0f)
currenttime = 0.01f;
float besttime = currenttime;
float mindelta = 65536.0f;
Vector bestpos = result;
int maxsteps = 300;
for (int steps = 0; steps < maxsteps;
steps++, currenttime += ((float) (2 * range) / (float) maxsteps))
{
Vector curpos = result;
curpos += 0 * currenttime;
if (debug_pp_extrapolate)
{
curpos += 0 * currenttime * latency;
}
if (dtg > 0.0f)
{
curpos.z -= currenttime * currenttime * 400.0f * 0;
if (curpos.z < result.z - dtg)
curpos.z = result.z - dtg;
}
float rockettime = g_pLocalPlayer->v_Eye.DistTo(curpos) / speed;
if (debug_pp_rockettimeping)
rockettime +=
g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING);
if (fabs(rockettime - currenttime) < mindelta)
{
besttime = currenttime;
bestpos = curpos;
mindelta = fabs(rockettime - currenttime);
}
}
if (debug_pp_rockettimeping)
besttime += g_IEngine->GetNetChannelInfo()->GetLatency(FLOW_OUTGOING);
bestpos.z += (400 * besttime * besttime * gravity);
// S = at^2/2 ; t = sqrt(2S/a)*/
return bestpos;
}
Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed, Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed,
float gravitymod, float entgmod) float gravitymod, float entgmod)
{ {

View File

@ -8,9 +8,9 @@
#include "projlogging.hpp" #include "projlogging.hpp"
#include "common.hpp" #include "common.hpp"
Vector prevloc[2048]{};
namespace projectile_logging namespace projectile_logging
{ {
void Update() void Update()
{ {
for (int i = 1; i < HIGHEST_ENTITY; i++) for (int i = 1; i < HIGHEST_ENTITY; i++)
@ -18,13 +18,31 @@ void Update()
CachedEntity *ent = ENTITY(i); CachedEntity *ent = ENTITY(i);
if (CE_BAD(ent)) if (CE_BAD(ent))
continue; continue;
if (ent->m_Type() == ENTITY_PROJECTILE) const model_t *model = RAW_ENT(ent)->GetModel();
bool issandwich = false;
if (model && tickcount % 33 == 0)
{ {
int owner = CE_INT(ent, 0x894) & 0xFFF; std::string model_name(g_IModelInfo->GetModelName(model));
if (model_name.find("plate") != std::string::npos)
{
issandwich = true;
Vector abs_orig = RAW_ENT(ent)->GetAbsOrigin();
float movement = prevloc[i].DistTo(abs_orig);
logging::Info("Sandwich movement: %f", movement);
prevloc[i] = abs_orig;
}
}
if (ent->m_Type() == ENTITY_PROJECTILE || issandwich)
{
/*int owner = CE_INT(ent, 0x894) & 0xFFF;
if (owner != LOCAL_W->m_IDX) if (owner != LOCAL_W->m_IDX)
continue; continue;*/
if (tickcount % 20 == 0) if (tickcount % 20 == 0)
{ {
Vector abs_orig = RAW_ENT(ent)->GetAbsOrigin();
float movement = prevloc[i].DistTo(abs_orig);
logging::Info("movement: %f", movement);
prevloc[i] = abs_orig;
const Vector &v = ent->m_vecVelocity; const Vector &v = ent->m_vecVelocity;
const Vector &a = ent->m_vecAcceleration; const Vector &a = ent->m_vecAcceleration;
Vector eav; Vector eav;