Skip to content
Permalink
Browse files

Add more very useful stuff like Gravity compensation on building aimb…

…bot and less buffer overflows
  • Loading branch information...
BenCat07 committed Sep 29, 2018
1 parent 5f90fe3 commit 1ab5c448d8dc3e36928a06f06ac0d88f315c6dab
1 TODO
@@ -26,7 +26,6 @@ No Trigger Mediguns // //
More projectile weapons aimbot (wrap assassin, wrangler, airstrike) // //
// //
// //
Make building aimbot compensate for gravity on projectile weapons // //
// //
// //
// //
@@ -1,5 +1,6 @@
<Tab name="Misc2">
<TabContainer width="fill" height="fill">
<Include path="nullifiedcat/misc/remove.xml"/>
<Include path="nullifiedcat/misc/sandwich.xml"/>
</TabContainer>
</Tab>
@@ -17,6 +17,8 @@ Vector SimpleLatencyPrediction(CachedEntity *ent, int hb);

bool PerformProjectilePrediction(CachedEntity *target, int hitbox);

Vector BuildingPrediction(CachedEntity *building, Vector vec, float speed,
float gravity);
Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed,
float gravitymod, float entgmod);
Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed,
@@ -125,19 +125,19 @@ constexpr rgba_t empty = FromRGBA8(0, 0, 0, 0);

constexpr rgba_t FromHSL(float h, float s, float v)
{
if (s <= 0.0)
if (s <= 0.0f)
{ // < is bogus, just shuts up warnings
return rgba_t{ v, v, v, 1.0f };
}
float hh = h;
if (hh >= 360.0)
hh = 0.0;
hh /= 60.0;
if (hh >= 360.0f)
hh = 0.0f;
hh /= 60.0f;
long i = long(hh);
float ff = hh - i;
float p = v * (1.0 - s);
float q = v * (1.0 - (s * ff));
float t = v * (1.0 - (s * (1.0 - ff)));
float p = v * (1.0f - s);
float q = v * (1.0f - (s * ff));
float t = v * (1.0f - (s * (1.0f - ff)));

switch (i)
{
@@ -149,7 +149,6 @@ constexpr rgba_t FromHSL(float h, float s, float v)
return rgba_t{ p, v, t, 1.0f };
case 3:
return rgba_t{ p, q, v, 1.0f };
break;
case 4:
return rgba_t{ t, p, v, 1.0f };
case 5:
@@ -438,8 +438,7 @@ bool IsTargetStateGood(CachedEntity *entity)
{
PROF_SECTION(PT_aimbot_targetstatecheck);

if (shouldBacktrack() &&
entity->m_Type() != ENTITY_PLAYER)
if (shouldBacktrack() && entity->m_Type() != ENTITY_PLAYER)
return false;
// Checks for Players
if (entity->m_Type() == ENTITY_PLAYER)
@@ -827,7 +826,7 @@ void DoAutoshoot()

// Release Sticky if > chargetime, 3.85 is the max second chargetime,
// 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;
hacks::shared::antiaim::SetSafeSpace(3);
@@ -929,7 +928,8 @@ const Vector &PredictEntity(CachedEntity *entity)
}
else if (entity->m_Type() == ENTITY_BUILDING)
{
result = GetBuildingPosition(entity);
result = BuildingPrediction(entity, GetBuildingPosition(entity),
cur_proj_speed, cur_proj_grav);
// Other
}
else
@@ -7,6 +7,7 @@ if(NOT LagbotMode)
target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Achievement.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Aimbot.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AimSandwich.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Announcer.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiAim.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiAntiAim.cpp"
@@ -58,14 +58,15 @@ std::string ComposeKillSay(IGameEvent *event)
if (g_IEngine->GetPlayerForUserID(kid) != g_IEngine->GetLocalPlayer())
return "";
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.
while (msg == lastmsg)
{
msg = source->at(rand() % source->size());
}
lastmsg = msg;
// checks if the killsays.txt file is not 1 line. 100% sure it's going
//to crash if it is.
while (msg == lastmsg)
{
msg = source->at(rand() % source->size());
}
lastmsg = msg;
}
player_info_s info;
g_IEngine->GetPlayerInfo(g_IEngine->GetPlayerForUserID(vid), &info);
@@ -26,7 +26,8 @@ static settings::Bool engine_pred{ "misc.engine-prediction", "false" };
static settings::Bool debug_projectiles{ "debug.projectiles", "false" };
static settings::Int semiauto{ "misc.semi-auto", "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;
#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 &&
LOCAL_W->m_iClassID() == CL_CLASS(CTFMinigun))
{
CE_INT(LOCAL_W, netvar.iWeaponState) = 0;
}
}
#endif
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();
#endif
}
if (*fuckmode)
{
static int prevbuttons = 0;
current_user_cmd->buttons |= prevbuttons;
prevbuttons |= current_user_cmd->buttons;
}
hooked_methods::CreateMove();

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

return original::DrawModelExecute(this_, state, info, bone);
@@ -192,7 +192,8 @@ CatCommand pl_set_state(
continue;
std::string currname(info.name);
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)
continue;
id = i;
@@ -259,7 +260,8 @@ static int cat_pl_set_state_completionCallback(
continue;
std::string name(info.name);
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);
}
std::sort(names.begin(), names.end());
@@ -256,7 +256,66 @@ Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed,
result.y - origin.y, result.z - origin.z);*/
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,
float gravitymod, float entgmod)
{
@@ -8,23 +8,41 @@
#include "projlogging.hpp"
#include "common.hpp"

Vector prevloc[2048]{};
namespace projectile_logging
{

void Update()
{
for (int i = 1; i < HIGHEST_ENTITY; i++)
{
CachedEntity *ent = ENTITY(i);
if (CE_BAD(ent))
continue;
if (ent->m_Type() == ENTITY_PROJECTILE)
const model_t *model = RAW_ENT(ent)->GetModel();
bool issandwich = false;
if (model && tickcount % 33 == 0)
{
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;
/*int owner = CE_INT(ent, 0x894) & 0xFFF;
if (owner != LOCAL_W->m_IDX)
continue;
continue;*/
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 &a = ent->m_vecAcceleration;
Vector eav;

0 comments on commit 1ab5c44

Please sign in to comment.
You can’t perform that action at this time.