Skip to content

Commit

Permalink
Final polishes
Browse files Browse the repository at this point in the history
  • Loading branch information
degeneratehyperbola committed Mar 28, 2021
1 parent 25c4862 commit 344b200
Show file tree
Hide file tree
Showing 34 changed files with 1,098 additions and 881 deletions.
2 changes: 1 addition & 1 deletion EventListener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void EventListener::fireGameEvent(GameEvent* event)
Visuals::hitMarker(event);
break;
case fnv::hash("bullet_impact"):
Visuals::bBeams(event);
Visuals::bulletBeams(event);
break;
case fnv::hash("vote_cast"):
Misc::voteRevealer(*event);
Expand Down
69 changes: 56 additions & 13 deletions GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@
#include "Hacks/SkinChanger.h"
#include "Hacks/Aimbot.h"

#include "SDK/ConVar.h"
#include "SDK/Cvar.h"
#ifdef _DEBUG_NEPS
#include "SDK/Client.h"
#include "SDK/ClientMode.h"
#include "SDK/Engine.h"
#include "SDK/EngineTrace.h"
#include "SDK/Entity.h"
#include "SDK/EntityList.h"
#include "SDK/ClientClass.h"
#include "SDK/NetworkStringTable.h"
#endif // _DEBUG_NEPS
#include "SDK/Engine.h"
#include "SDK/ConVar.h"
#include "SDK/Cvar.h"
#include "SDK/Input.h"
#include "SDK/InputSystem.h"

Expand Down Expand Up @@ -609,7 +615,7 @@ void GUI::renderChamsWindow(bool contentOnly) noexcept

static int material = 1;

if (ImGui::Combo("##category", &currentCategory, "Allies\0Enemies\0Planting\0Defusing\0Backtrack\0Local player\0Desync\0Viewmodel\0Sleeves\0Hands\0Weapons\0C4\0Defuse kits\0Ragdolls\0Props\0"))
if (ImGui::Combo("##category", &currentCategory, "Allies\0Enemies\0Planting\0Defusing\0Backtrack\0Local player\0Desync\0Weapon\0Sleeves\0Hands\0World weapons\0C4\0Defuse kits\0Ragdolls\0Props\0"))
material = 1;

ImGui::SameLine();
Expand Down Expand Up @@ -1473,13 +1479,6 @@ void GUI::renderExploitsWindow(bool contentOnly) noexcept
ImGuiCustom::keyBind("Slowwalk", config->exploits.slowwalk);

ImGui::Checkbox("Bypass sv_pure", &config->exploits.bypassPure);
ImGui::PushItemWidth(90.0f);
if (ImGui::Button("Spoof sv_cheats"))
{
const static auto cheatoVar = interfaces->cvar->findVar("sv_cheats");
cheatoVar->onChangeCallbacks.size = 0;
cheatoVar->setValue(true);
}

//ImGuiCustom::keyBind("Doubletap", config->exploits.doubletap);

Expand Down Expand Up @@ -1885,17 +1884,60 @@ void GUI::renderGuiStyle2() noexcept
ImGui::End();
}

#ifdef _DEBUG_NEPS
void GUI::debug() noexcept
{
if (ImGui::Button("Test chat hook"))
{
memory->clientMode->getHudChat()->printf(0, "\x01N \x02N \x03N \x04N \x05N \x06N \x07N \x08N \x09N \x0AN \x0BN \x0CN \x0DN \x0EN \x0FN \x10N");
memory->clientMode->getHudChat()->printf(0, "\x01N \x02N \x03N \x04N \x05N \x06N \x07N \x08N \x09N \x0AN \x0BN \x0CN \x0DN \x0EN \x0FN \x10N \x01");
memory->clientMode->getHudChat()->printf(0, " \x01[NEPS]\x08 %s voted %c%s\x01", "River", '\x04', "YES");
memory->clientMode->getHudChat()->printf(0, " \x01[NEPS]\x08 %s voted %c%s\x01", "Hyperbola", '\x02', "NO");
}

static bool dumpColors = false;
if (ImGui::Button("List client classes"))
{
for (int i = 1; i <= interfaces->entityList->getHighestEntityIndex(); i++)
{
auto entity = interfaces->entityList->getEntity(i);
if (!entity) continue;

memory->conColorMsg({0, 200, 0, 255}, std::to_string(i).c_str());
memory->debugMsg(": ");
memory->conColorMsg({0, 120, 255, 255}, entity->getClientClass()->networkName);
memory->debugMsg(" -> ");
memory->conColorMsg({255, 120, 255, 255}, std::to_string((int)entity->getClientClass()->classID).c_str());
memory->debugMsg(" ");
}
}

static const char *entName;
static ClassID entClassID;
if (ImGui::Button("Loking at...") && localPlayer)
{
Vector start = localPlayer->getEyePosition();
Vector end = start + Vector::fromAngle(interfaces->engine->getViewAngles()) * 1000.0f;

Trace trace;
interfaces->engineTrace->traceRay({start, end}, ALL_VISIBLE_CONTENTS | CONTENTS_MOVEABLE | CONTENTS_DETAIL, localPlayer.get(), trace);

if (trace.entity)
{
auto clientClass = trace.entity->getClientClass();
entName = clientClass->networkName;
entClassID = clientClass->classID;
}
}

if (entName)
{
ImGui::TextUnformatted(entName);
ImGui::TextUnformatted(std::to_string((int)entClassID).c_str());
}

if (ImGui::Button("Precache info"))
interfaces->engine->clientCmdUnrestricted("sv_precacheinfo");

static bool dumpColors = false;
ImGui::Checkbox("Style colors code", &dumpColors);

if (!dumpColors) return;
Expand All @@ -1920,3 +1962,4 @@ void GUI::debug() noexcept

ImGui::InputTextMultiline("", buffer, 128 * ImGuiCol_COUNT, {400.0f, 500.0f}, ImGuiInputTextFlags_ReadOnly);
}
#endif // _DEBUG_NEPS
84 changes: 42 additions & 42 deletions GameData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,47 +108,47 @@ void GameData::update() noexcept
weaponData.emplace_back(entity);
} else
{
switch (entity->getClientClass()->classId)
switch (entity->getClientClass()->classID)
{
case ClassId::BaseCSGrenadeProjectile:
case ClassID::GrenadeProjectile:
if (entity->grenadeExploded())
{
if (const auto it = std::find(projectileData.begin(), projectileData.end(), entity->handle()); it != projectileData.end())
it->exploded = true;
break;
}
[[fallthrough]];
case ClassId::BreachChargeProjectile:
case ClassId::BumpMineProjectile:
case ClassId::DecoyProjectile:
case ClassId::MolotovProjectile:
case ClassId::SensorGrenadeProjectile:
case ClassId::SmokeGrenadeProjectile:
case ClassId::SnowballProjectile:
case ClassID::BreachChargeProjectile:
case ClassID::BumpMineProjectile:
case ClassID::DecoyProjectile:
case ClassID::MolotovProjectile:
case ClassID::SensorGrenadeProjectile:
case ClassID::SmokeGrenadeProjectile:
case ClassID::SnowballProjectile:
if (const auto it = std::find(projectileData.begin(), projectileData.end(), entity->handle()); it != projectileData.end())
it->update(entity);
else
projectileData.emplace_front(entity);
break;
case ClassId::DynamicProp:
case ClassID::PropDynamic:
if (const auto model = entity->getModel(); !model || !std::strstr(model->name, "challenge_coin"))
break;
[[fallthrough]];
case ClassId::EconEntity:
case ClassId::Chicken:
case ClassId::PlantedC4:
case ClassId::Hostage:
case ClassId::Dronegun:
case ClassId::Cash:
case ClassId::AmmoBox:
case ClassId::RadarJammer:
case ClassId::SnowballPile:
case ClassID::EconEntity:
case ClassID::Chicken:
case ClassID::PlantedC4:
case ClassID::Hostage:
case ClassID::Dronegun:
case ClassID::Cash:
case ClassID::AmmoBox:
case ClassID::RadarJammer:
case ClassID::SnowballPile:
entityData.emplace_back(entity);
break;
case ClassId::LootCrate:
case ClassID::LootCrate:
lootCrateData.emplace_back(entity);
break;
case ClassId::Inferno:
case ClassID::Inferno:
infernoData.emplace_back(entity);
break;
}
Expand Down Expand Up @@ -317,17 +317,17 @@ BaseData::BaseData(Entity* entity) noexcept
EntityData::EntityData(Entity* entity) noexcept : BaseData{ entity }
{
name = [](Entity *entity) {
switch (entity->getClientClass()->classId) {
case ClassId::EconEntity: return "Defuse Kit";
case ClassId::Chicken: return "Chicken";
case ClassId::PlantedC4: return "Planted C4";
case ClassId::Hostage: return "Hostage";
case ClassId::Dronegun: return "Sentry";
case ClassId::Cash: return "Cash";
case ClassId::AmmoBox: return "Ammo Box";
case ClassId::RadarJammer: return "Radar Jammer";
case ClassId::SnowballPile: return "Snowball Pile";
case ClassId::DynamicProp: return "Collectable Coin";
switch (entity->getClientClass()->classID) {
case ClassID::EconEntity: return "Defuse Kit";
case ClassID::Chicken: return "Chicken";
case ClassID::PlantedC4: return "Planted C4";
case ClassID::Hostage: return "Hostage";
case ClassID::Dronegun: return "Sentry";
case ClassID::Cash: return "Cash";
case ClassID::AmmoBox: return "Ammo Box";
case ClassID::RadarJammer: return "Radar Jammer";
case ClassID::SnowballPile: return "Snowball Pile";
case ClassID::PropDynamic: return "Collectable Coin";
default: assert(false); return "unknown";
}
}(entity);
Expand All @@ -336,19 +336,19 @@ EntityData::EntityData(Entity* entity) noexcept : BaseData{ entity }
ProjectileData::ProjectileData(Entity* projectile) noexcept : BaseData { projectile }
{
name = [](Entity* projectile) {
switch (projectile->getClientClass()->classId) {
case ClassId::BaseCSGrenadeProjectile:
switch (projectile->getClientClass()->classID) {
case ClassID::GrenadeProjectile:
if (const auto model = projectile->getModel(); model && strstr(model->name, "flashbang"))
return "Flashbang";
else
return "HE Grenade";
case ClassId::BreachChargeProjectile: return "Breach Charge";
case ClassId::BumpMineProjectile: return "Bump Mine";
case ClassId::DecoyProjectile: return "Decoy Grenade";
case ClassId::MolotovProjectile: return "Molotov";
case ClassId::SensorGrenadeProjectile: return "TA Grenade";
case ClassId::SmokeGrenadeProjectile: return "Smoke Grenade";
case ClassId::SnowballProjectile: return "Snowball";
case ClassID::BreachChargeProjectile: return "Breach Charge";
case ClassID::BumpMineProjectile: return "Bump Mine";
case ClassID::DecoyProjectile: return "Decoy Grenade";
case ClassID::MolotovProjectile: return "Molotov";
case ClassID::SensorGrenadeProjectile: return "TA Grenade";
case ClassID::SmokeGrenadeProjectile: return "Smoke Grenade";
case ClassID::SnowballProjectile: return "Snowball";
default: assert(false); return "unknown";
}
}(projectile);
Expand Down Expand Up @@ -441,7 +441,7 @@ void PlayerData::update(Entity* entity) noexcept
if (!studioModel)
return;

matrix3x4 boneMatrices[MAXSTUDIOBONES];
Matrix3x4 boneMatrices[MAXSTUDIOBONES];
if (!entity->setupBones(boneMatrices, MAXSTUDIOBONES, BONE_USED_BY_HITBOX, memory->globalVars->currenttime))
return;

Expand Down
11 changes: 7 additions & 4 deletions GameData.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <vector>
#include <array>

#include "SDK/matrix3x4.h"
#include "SDK/Matrix3x4.h"
#include "SDK/Vector.h"
#include "SDK/AnimState.h"
#include "SDK/ModelInfo.h"
Expand Down Expand Up @@ -69,15 +69,18 @@ struct Indicators
int blockTarget = 0;
Vector serverHead = Vector{};
Vector desyncHead = Vector{};
std::vector<Vector> multipoints;
float deltaLby = 0.0f;

#ifdef _DEBUG_NEPS
std::vector<Vector> multipoints;
#endif // _DEBUG_NEPS
};

struct GlobalData
{
UserCmd lastCmd = UserCmd{};
bool sentPacket = true;
matrix3x4 lerpedBones[MAXSTUDIOBONES];
Matrix3x4 lerpedBones[MAXSTUDIOBONES];

Indicators indicators;
};
Expand Down Expand Up @@ -115,7 +118,7 @@ struct BaseData

float distanceToLocal;
Vector obbMins, obbMaxs;
matrix3x4 coordinateFrame;
Matrix3x4 coordinateFrame;
};

struct EntityData final : BaseData
Expand Down
2 changes: 1 addition & 1 deletion Hacks/Aimbot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void Aimbot::run(UserCmd *cmd) noexcept

const auto localPlayerEyePosition = localPlayer->getEyePosition();

std::array<matrix3x4, MAXSTUDIOBONES> bufferBones;
std::array<Matrix3x4, MAXSTUDIOBONES> bufferBones;
#ifdef _DEBUG_NEPS
std::vector<Vector> multipoints;
#endif // _DEBUG_NEPS
Expand Down
4 changes: 2 additions & 2 deletions Hacks/Animations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "../SDK/Input.h"
#include "../SDK/GlobalVars.h"
#include "../SDK/LocalPlayer.h"
#include "../SDK/matrix3x4.h"
#include "../SDK/Matrix3x4.h"
#include "../SDK/ModelInfo.h"
#include "../SDK/NetworkChannel.h"
#include "../SDK/UserCmd.h"
Expand All @@ -20,7 +20,7 @@
#include "../Interfaces.h"
#include "../Memory.h"

bool Animations::clientLerped(matrix3x4 *out, UserCmd *cmd, bool &sendPacket, Vector *headPos, float *feetYawDelta) noexcept
bool Animations::clientLerped(Matrix3x4 *out, UserCmd *cmd, bool &sendPacket, Vector *headPos, float *feetYawDelta) noexcept
{
bool matrixUpdated = false;

Expand Down
4 changes: 2 additions & 2 deletions Hacks/Animations.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

class matrix3x4;
class Matrix3x4;
struct UserCmd;
struct Vector;

namespace Animations
{
bool clientLerped(matrix3x4 *out, UserCmd *cmd, bool &sendPacket, Vector *headPos = nullptr, float *feetYawDelta = nullptr) noexcept;
bool clientLerped(Matrix3x4 *out, UserCmd *cmd, bool &sendPacket, Vector *headPos = nullptr, float *feetYawDelta = nullptr) noexcept;
void animSync(UserCmd *cmd, bool &sendPacket, Vector *headPos = nullptr) noexcept;
}
4 changes: 2 additions & 2 deletions Hacks/Backtrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <array>
#include <deque>

#include "../SDK/matrix3x4.h"
#include "../SDK/Matrix3x4.h"
#include "../SDK/Vector.h"

enum class FrameStage;
Expand All @@ -16,7 +16,7 @@ namespace Backtrack {
struct Record {
Vector origin;
float simulationTime;
matrix3x4 matrix[256];
Matrix3x4 matrix[256];
};

const std::deque<Record>& getRecords(std::size_t index) noexcept;
Expand Down
Loading

0 comments on commit 344b200

Please sign in to comment.