This commit is contained in:
nullifiedcat 2017-07-22 11:04:02 +03:00
commit 4f4243b298
7 changed files with 153 additions and 68 deletions

View File

@ -8,6 +8,7 @@
#include "Im.hpp"
#include "Schema.hpp"
#include "Playerlist.hpp"
#include "InfoPanel.hpp"
#include "../../common.h"
@ -335,6 +336,10 @@ void Render() {
style->Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(1.00f, 0.98f, 0.95f, 0.73f);
styles_setup = true;
}
// Info panel should be rendered even with main gui disabled
//RenderInfoPanel();
if (!gui_visible) {
ImGui::GetIO().MouseDrawCursor = false;
return;
@ -343,7 +348,6 @@ void Render() {
ImGui::SetMouseCursor(ImGuiMouseCursor_Arrow);
}
//ImGui::ShowTestWindow();
RenderPlayerlist();
/*ImGui::Begin("Colors");

View File

@ -5,4 +5,69 @@
* Author: nullifiedcat
*/
/*
#include "../../common.h"
#include "../../cvwrapper.h"
#include "imgui.h"
#include "InfoPanel.hpp"
namespace menu { namespace im {
// User settings
CatVar enabled(CV_SWITCH, "info_panel_enabled", "0", "Enable Info Panel");
CatVar aimbot_enabled(CV_SWITCH, "info_panel_aimbot", "0", "Show Aimbot");
CatVar aimkey_enabled(CV_SWITCH, "info_panel_aimkey_toggle", "0", "Show Aimkey Toggle");
// Main ImGui menu creator
void RenderInfoPanel() {
// Check if info menu is enabled
if (!enabled) return;
// Check if in-game
if (!g_IEngine->IsInGame()) return;
// Menu creation stuff pasted from playerlist
if (ImGui::Begin("Info Panel")) {
ImGui::SetWindowSize(ImVec2(0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 1));
// The main meat of the info panel
if (aimbot_enabled) AddInfoItem(EInfo::AIMBOT, 169);
if (aimkey_enabled) AddInfoItem(EInfo::AIMKEY, 269);
ImGui::PopStyleVar();
}
ImGui::End();
}
// Function to add individual items to menu
void AddInfoItem(EInfo info_type, int id) {
// Dont know what this does but i just use some numbers with 69 to make it somewhat different
ImGui::PushID(id);
// Switch based on into_type
switch (info_type) {
case EInfo::AIMBOT:
ImGui::Text(format("Aimbot: ", GetCatVar("aimbot_enabled") ? "enabled" : "disabled").c_str());
break;
case EInfo::AIMKEY:
ImGui::Text(format("Todo, get toggle mode from aimkey").c_str());
break;
};
// Dont know what this does but im expecting i would need it
ImGui::PopID();
}
// Helper function ripped from schema.cpp due to ussues if i tri to use it directly from there
CatVar* GetCatVar(const std::string name) {
for (auto var : CatVarList()) {
if (var->name == name) return var;
}
return nullptr;
}
}}*/

View File

@ -4,17 +4,25 @@
* Created on: Jul 7, 2017
* Author: nullifiedcat
*/
#pragma once
/*
#include "../../common.h"
#include "../../sdk.h"
namespace menu { namespace im {
struct infopanel_data {
// std::vector<CatVar*> variable_watchlist {};
// used to determine what var we need to display
enum class EInfo {
AIMBOT,
AIMKEY
};
void Render(bool ingame);
void RenderInfoPanel();
void AddInfoItem(EInfo info_type, int id);
}}
std::string GetBoolString(CatVar* value);
CatVar* GetCatVar(const std::string name);
}}*/

View File

@ -15,13 +15,7 @@ class IClientEntity;
namespace hacks { namespace shared { namespace aimbot {
enum class EAimKeyMode {
DISABLED,
PRESS_TO_ENABLE,
PRESS_TO_DISABLE,
PRESS_TO_TOGGLE
};
// Used to store aimbot data to prevent calculating it again
struct AimbotCalculatedData_s {
unsigned long predict_tick { 0 };
Vector aim_position { 0 };
@ -31,23 +25,24 @@ struct AimbotCalculatedData_s {
int hitbox { 0 };
};
// Functions used to calculate aimbot data, and if already calculated use it
const Vector& PredictEntity(CachedEntity* entity);
bool VischeckPredictedEntity(CachedEntity* entity);
// Variable used to tell when the aimbot has found a target
extern bool foundTarget;
const Vector& PredictEntity(CachedEntity* entity);
bool VischeckPredictedEntity(CachedEntity* entity);
// Used by esp to set their color
extern int target_eid;
// Functions called by other functions for when certian game calls are run
void CreateMove();
void DrawText();
void Reset();
// Used by esp to set their color
extern int target_eid;
float EffectiveTargetingRange();
// Stuff to make storing functions easy
CachedEntity* CurrentTarget();
bool ShouldAim();
CachedEntity* RetrieveBestTarget(bool aimkey_state);
@ -59,6 +54,7 @@ int ClosestHitbox(CachedEntity* target);
void slowAim(Vector &inputAngle, Vector userAngle);
bool UpdateAimkey();
bool GetCanAim(int mode);
float EffectiveTargetingRange();
}}}

View File

@ -53,6 +53,8 @@ float idle_time = 0;
// An array for storing the breadcrumbs
static Vector breadcrumbs [64];
// Int for storing length of array
constexpr int MAX_CRUMBS = 64;
// Array Bookkeeping vars
int crumbBottom = 0;
int crumbTop = 0;
@ -145,11 +147,8 @@ void DoWalking() {
} else {
best_target = target_priority;
}
}
// Doesnt work for some reason, FIX!!!
// If we cant use steam id target, try someone else
if (roaming && CE_BAD(best_target)) {
@ -647,7 +646,7 @@ void CrumbReset() {
void CrumbTopAdd(Vector crumbToAdd) {
// Once the crumbs have hit the limit of the array, loop around and over write unused spots
if (crumbTop == 64) {
if (crumbTop == MAX_CRUMBS) {
crumbTop = 0;
} else {
// Else, bump the top number market of the array
@ -660,7 +659,7 @@ void CrumbTopAdd(Vector crumbToAdd) {
logging::Info("Crumb Top add");
// The array can only hold so many crumbs, once it goes over its cap, stop the bot to prevent un-needed movement
if (crumbArrayLength > 64) {
if (crumbArrayLength > MAX_CRUMBS) {
CrumbReset();
crumbStopped = true;
logging::Info("Crumb Overload!\nDumping array");
@ -671,7 +670,7 @@ void CrumbTopAdd(Vector crumbToAdd) {
void CrumbBottomAdd() {
// Once the crumbs have hit the limit of the array, loop around and over write unused spots
if (crumbBottom == 64) {
if (crumbBottom == MAX_CRUMBS) {
crumbBottom = 0;
} else {
// Else, bump the top number market of the array
@ -756,10 +755,10 @@ void DrawFollowbot() {
tmpCrumb2 = crumbBottom + i + 1;
// Correction for array numbers when one goes over our limit
if (tmpCrumb1 >= 64)
tmpCrumb1 - 64;
if (tmpCrumb2 >= 64)
tmpCrumb1 - 64;
if (tmpCrumb1 >= MAX_CRUMBS)
tmpCrumb1 - MAX_CRUMBS;
if (tmpCrumb2 >= MAX_CRUMBS)
tmpCrumb1 - MAX_CRUMBS;
// Take our 2 crumbs and get a position on the screen
draw::WorldToScreen(breadcrumbs[tmpCrumb1], scnSrt);
@ -804,10 +803,10 @@ void DrawFollowbot() {
tmpCrumb2 = crumbBottom + i + 1;
// Correction for array numbers when one goes over our limit
if (tmpCrumb1 >= 64)
tmpCrumb1 - 64;
if (tmpCrumb2 >= 64)
tmpCrumb2 - 64;
if (tmpCrumb1 >= MAX_CRUMBS)
tmpCrumb1 - MAX_CRUMBS;
if (tmpCrumb2 >= MAX_CRUMBS)
tmpCrumb2 - MAX_CRUMBS;
// Take our 2 crumbs and get a position on the screen
draw::WorldToScreen(breadcrumbs[tmpCrumb1], scnSrt);

View File

@ -128,6 +128,42 @@ void CreateMove() {
}
}
}
// Infinite pickups (health and ammo)
if (infinite_packs && CE_GOOD(LOCAL_E)) {
ICollideable* p = RAW_ENT(LOCAL_E)->GetCollideable();
const Vector& max1 = p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin();
const Vector& min1 = p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin();
for (int i = 1; i < entity_cache::max; i++) {
CachedEntity* e = ENTITY(i);
// CE_BAD is used to prevent removeconding on empty spaces where the item hasn't respawned
// Class check to ensure entity is pickup item
if (CE_BAD(e) || e->m_iClassID != CL_CLASS(CBaseAnimating)) {
continue;
}
// Bounds check
const Vector& max2 = c->OBBMaxs() + e->m_vecOrigin + Vector(8, 8, 8);
const Vector& min2 = c->OBBMins() + e->m_vecOrigin - Vector(8, 8, 8);
if (
(min1.x <= max2.x && max1.x >= min2.x) &&
(min1.y <= max2.y && max1.y >= min2.y) &&
(min1.z <= max2.z && max1.z >= min2.z) ) {
//logging::Info("Collision with %d", i);
// Lag for health
if (LOCAL_E->m_iHealth < LOCAL_E->m_iMaxHealth && (e->m_ItemType == ITEM_HEALTH_SMALL || e->m_ItemType == ITEM_HEALTH_MEDIUM || e->m_ItemType == ITEM_HEALTH_LARGE) ) {
AddExploitTicks(3);
}
// Lag for ammo / metal
// TODO: Alternative to - LOCAL_E->m_iAmmo < LOCAL_E->m_iMaxAmmo
// That is pseudocode but checking each weapon for ammo + engie for metal would be ideal
if ((e->m_ItemType == ITEM_AMMO_SMALL || e->m_ItemType == ITEM_AMMO_MEDIUM || e->m_ItemType == ITEM_AMMO_LARGE) ) {
AddExploitTicks(3);
}
}
}
}
}
// More paste from kathook
if (g_pUserCmd->buttons & (IN_ATTACK | IN_ATTACK2)) {
@ -148,29 +184,6 @@ void CreateMove() {
}
// Infinite healthpacks (I'll probably have to move this somewhere else)
if (infinite_packs && CE_GOOD(LOCAL_E) && LOCAL_E->m_iHealth < LOCAL_E->m_iMaxHealth) {
ICollideable* p = RAW_ENT(LOCAL_E)->GetCollideable();
const Vector& max1 = p->OBBMaxs() + RAW_ENT(LOCAL_E)->GetAbsOrigin();
const Vector& min1 = p->OBBMins() + RAW_ENT(LOCAL_E)->GetAbsOrigin();
for (int i = 1; i < entity_cache::max; i++) {
CachedEntity* e = ENTITY(i);
if (CE_BAD(e)) continue;
if (e->m_iClassID != CL_CLASS(CBaseAnimating)) continue;
if (e->m_ItemType != ITEM_HEALTH_SMALL && e->m_ItemType != ITEM_HEALTH_MEDIUM && e->m_ItemType != ITEM_HEALTH_LARGE) continue;
ICollideable* c = RAW_ENT(e)->GetCollideable();
const Vector& max2 = c->OBBMaxs() + e->m_vecOrigin + Vector(8, 8, 8);
const Vector& min2 = c->OBBMins() + e->m_vecOrigin - Vector(8, 8, 8);
if ( (min1.x <= max2.x && max1.x >= min2.x) &&
(min1.y <= max2.y && max1.y >= min2.y) &&
(min1.z <= max2.z && max1.z >= min2.z) ) {
//logging::Info("Collision with %d", i);
amount = 900;
break;
}
}
}
if (!amount) return;
// Modifying command_number and lastoutgoingcommand turned out to be useless