asdddddddd

This commit is contained in:
nullifiedcat 2016-11-20 08:30:37 +03:00
parent bb304aa6e7
commit 0692a7133b
37 changed files with 268 additions and 79 deletions

View File

@ -17,6 +17,13 @@ Target system respect mannpower powerups
Aimbot charge detection respect powerups
tournament_teamname
ignore taunt
CritTrigger
CritAim
huntsman aim fix

View File

@ -13,5 +13,7 @@
#define POSIX 1
#define GNUC 1
#undef min
#define private public
#define protected public
#endif /* FIXSDK_H_ */

View File

@ -26,9 +26,9 @@
#include "helpers.h"
#include "hacks/HBunnyhop.h"
#include "hacks/HTrigger.h"
#include "hacks/AutoReflect.h"
#include "hacks/HEsp.h"
//#include "hacks/HGlow.h"
#include "hacks/HPyroBot.h"
#include "hacks/HAimbot.h"
#include "hacks/AntiAim.h"
#include "hacks/Quickscope.h"
@ -59,6 +59,7 @@
#include "copypasted/CSignature.h"
#include "copypasted/Netvar.h"
#include "CDumper.h"
#include "hacks/FollowBot.h"
/*
* Credits to josh33901 aka F1ssi0N for butifel F1Public and Darkstorm 2015 Linux
@ -173,6 +174,19 @@ void hack::AddHack(IHack* hack) {
ICvar* g_pCVar = 0;
void hack::InitHacks() {
hack::AddHack(g_phAntiAim = new AntiAim());
hack::AddHack(g_phAntiDisguise = new AntiDisguise());
hack::AddHack(g_phAutoReflect = new AutoReflect());
hack::AddHack(g_phFollowBot = new FollowBot());
hack::AddHack(g_phAimbot = new HAimbot());
hack::AddHack(g_phBunnyhop = new HBunnyhop());
hack::AddHack(g_phEsp = new HEsp());
hack::AddHack(g_phTrigger = new HTrigger());
hack::AddHack(g_phMisc = new Misc());
hack::AddHack(g_phQuickscope = new Quickscope());
}
void hack::Initialize() {
logging::Initialize();
//std::string test = "";
@ -187,24 +201,14 @@ void hack::Initialize() {
interfaces::CreateInterfaces();
logging::Info("Interfaces created!");
logging::Info("APPID: %i", interfaces::engineClient->GetAppID());
logging::Info("Dumping NetVars...");
CDumper dumper;
dumper.SaveDump();
//logging::Info("Dumping NetVars...");
//CDumper dumper;
//dumper.SaveDump();
logging::Info("Initializing surface...");
draw::Initialize();
logging::Info("Adding hacks...");
SetCVarInterface(interfaces::cvar);
hack::AddHack(new AntiAim());
logging::Info("Quickscoping");
hack::AddHack(new Quickscope());
hack::AddHack(new HBunnyhop());
hack::AddHack(new Misc());
hack::AddHack(new HEsp());
hack::AddHack(new HAimbot());
hack::AddHack(new AntiDisguise());
hack::AddHack(new HTrigger());
//hack::AddHack(new HGlow());
hack::AddHack(new HPyroBot());
hack::InitHacks();
ConVar_Register();
logging::Info("Initializing NetVar tree...");
gNetvars.init();

View File

@ -28,6 +28,8 @@ void Initialize();
void Think();
void Shutdown();
void InitHacks();
}
#endif /* HACK_H_ */

View File

@ -28,16 +28,10 @@ bool AntiAim::CreateMove(void*, float, CUserCmd* cmd) {
//angl.z = 180;
cmd->viewangles = angl;
g_pLocalPlayer->bUseSilentAngles = true;
/*Vector vsilent(cmd->forwardmove, cmd->sidemove, cmd->upmove);
float speed = sqrt(vsilent.x * vsilent.x + vsilent.y * vsilent.y);
Vector ang;
VectorAngles(vsilent, ang);
float yaw = deg2rad(ang.y - g_pLocalPlayer->v_OrigViewangles.y + cmd->viewangles.y);
cmd->forwardmove = cos(yaw) * speed;
cmd->sidemove = sin(yaw) * speed;*/
//FixMovement(*cmd, g_pLocalPlayer->v_OrigViewangles);
return false;
}
void AntiAim::Destroy() {}
void AntiAim::PaintTraverse(void*, unsigned int, bool, bool) {}
AntiAim* g_phAntiAim = 0;

View File

@ -10,15 +10,12 @@
#include "IHack.h"
class ConVar;
class AntiAim : public IHack {
public:
void Create();
void Destroy();
bool CreateMove(void*, float, CUserCmd*);
void PaintTraverse(void*, unsigned int, bool, bool);
DECLARE_HACK()
ConVar* v_bEnabled;
};
extern AntiAim* g_phAntiAim;
#endif /* ANTIAIM_H_ */

View File

@ -34,3 +34,5 @@ void AntiDisguise::PaintTraverse(void*, unsigned int, bool, bool) {
bool AntiDisguise::CreateMove(void*, float, CUserCmd*) {return true;}
void AntiDisguise::Destroy() {}
AntiDisguise* g_phAntiDisguise = 0;

View File

@ -12,8 +12,10 @@
class AntiDisguise : public IHack {
public:
DECL_HACK
DECLARE_HACK()
ConVar* v_bEnabled;
};
extern AntiDisguise* g_phAntiDisguise;
#endif /* HACKS_ANTIDISGUISE_H_ */

View File

@ -10,6 +10,7 @@
#include "../localplayer.h"
#include "../entitycache.h"
#include "../usercmd.h"
#include "../entity.h"
#include "../helpers.h"
#include "../sdk/in_buttons.h"
@ -23,19 +24,24 @@
// Hack Methods
void AutoReflect::Create() {
v_bEnabled = CreateConVar("u_reflect_enabled", "0", "Reflectbot enabled");
v_iReflectDistance = CreateConVar("u_reflect_distance", "300", "Reflectbot distance");
}
// TODO
bool AutoReflect::CreateMove(void*, float, CUserCmd* cmd) {
if (!v_bEnabled->GetBool()) return true;
if (g_pLocalPlayer->weapon->GetClientClass()->m_ClassID != ClassID::CTFFlameThrower) return true;
CachedEntity* closest = 0;
float closest_dist = 0.0f;
for (int i = 0; i < gEntityCache.m_nMax; i++) {
CachedEntity* ent = gEntityCache.GetEntity(i);
if (!ent || ent->m_bNULL || ent->m_bDormant) continue;
if (!ent->m_iClassID == ClassID::CTFProjectile_Rocket) continue;
if (ent->m_iClassID != ClassID::CTFProjectile_Rocket &&
ent->m_iClassID != ClassID::CTFGrenadePipebombProjectile) continue;
if (ent->Var<int>(eoffsets.iTeamNum) == g_pLocalPlayer->team) continue;
float dist = ent->m_pEntity->GetAbsOrigin().DistToSqr(g_pLocalPlayer->v_Origin);
if (dist < closest_dist || !closest) {
closest = ent;
@ -43,13 +49,14 @@ bool AutoReflect::CreateMove(void*, float, CUserCmd* cmd) {
}
}
if (closest_dist == 0 || closest_dist > v_iReflectDistance->GetInt()) return true;
if (closest_dist == 0 || closest_dist > v_iReflectDistance->GetInt() * v_iReflectDistance->GetInt()) return true;
Vector tr = (closest->m_pEntity->GetAbsOrigin() - g_pLocalPlayer->v_Eye);
Vector angles;
fVectorAngles(tr, angles);
fClampAngle(angles);
cmd->viewangles = angles;
g_pLocalPlayer->bUseSilentAngles = true;
cmd->buttons |= IN_ATTACK2;
return true;
@ -57,3 +64,5 @@ bool AutoReflect::CreateMove(void*, float, CUserCmd* cmd) {
void AutoReflect::PaintTraverse(void*, unsigned int, bool, bool) {}
void AutoReflect::Destroy() {}
AutoReflect* g_phAutoReflect = 0;

View File

@ -10,11 +10,13 @@
#include "IHack.h"
class AutoReflect : IHack {
class AutoReflect : public IHack {
public:
DECL_HACK
DECLARE_HACK()
ConVar* v_bEnabled;
ConVar* v_iReflectDistance;
};
extern AutoReflect* g_phAutoReflect;
#endif /* HACKS_AUTOREFLECT_H_ */

View File

@ -5,7 +5,7 @@
* Author: nullifiedcat
*/
#include "HPyroBot.h"
#include "FollowBot.h"
#include "../interfaces.h"
#include "../entity.h"
@ -19,6 +19,7 @@
#include <icliententitylist.h>
#include <client_class.h>
#include <cdll_int.h>
#include <igameevents.h>
enum bot_state_t {
IDLE = 0,
@ -47,11 +48,22 @@ IClientEntity* GetTarget() {
return interfaces::entityList->GetClientEntity(g_nTargetID);
}
void HPyroBot::ProcessEntity(IClientEntity* entity, bool enemy) {
int called = 0;
class MedicCallListener : public IGameEventListener2 {
public:
MedicCallListener() {}
void FireGameEvent(IGameEvent* pEvent) {
if (strcmp("player_calledformedic", pEvent->GetName())) return;
int id = interfaces::engineClient->GetPlayerForUserID(pEvent->GetInt("userid", -1));
}
};
void FollowBot::ProcessEntity(IClientEntity* entity, bool enemy) {
IClientEntity* target = GetTarget();
if (!target) {
if (!enemy) {
if (!enemy || v_bMediBot->GetBool()) {
if (v_iForceFollow->GetInt() != -1) {
if (v_bForceFollowOnly->GetBool() && (v_iForceFollow->GetInt() != entity->entindex())) {
return;
@ -62,7 +74,7 @@ void HPyroBot::ProcessEntity(IClientEntity* entity, bool enemy) {
SetTarget(target);
}
if (enemy) {
if (enemy && !v_bMediBot->GetBool()) {
if (g_bState == bot_state_t::FOLLOWING_ENEMY) {
if (DistToSqr(entity) <= DistToSqr(target)) {
target = entity;
@ -122,7 +134,7 @@ void AimAt(IClientEntity* entity, CUserCmd* cmd) {
* shoot
*/
int HPyroBot::ShouldTarget(IClientEntity* ent, bool notrace) {
int FollowBot::ShouldTarget(IClientEntity* ent, bool notrace) {
if (!ent || ent->IsDormant()) return 1;
if (ent->GetClientClass()->m_ClassID != 241) return 2;
if (GetEntityValue<char>(ent, eoffsets.iLifeState)) return 3;
@ -143,7 +155,7 @@ int HPyroBot::ShouldTarget(IClientEntity* ent, bool notrace) {
return 0;
}
void HPyroBot::Tick(CUserCmd* cmd) {
void FollowBot::Tick(CUserCmd* cmd) {
if (!g_pLocalPlayer->entity || g_pLocalPlayer->entity->IsDormant()) return;
if (g_pLocalPlayer->life_state) return;
@ -231,14 +243,14 @@ void HPyroBot::Tick(CUserCmd* cmd) {
interfaces::engineClient->ExecuteClientCmd("-forward");
}
if (DistToSqr(target) < (v_iShootDistance->GetInt() * v_iShootDistance->GetInt()) && g_bState == bot_state_t::FOLLOWING_ENEMY) {
if (DistToSqr(target) < (v_iShootDistance->GetInt() * v_iShootDistance->GetInt()) && (g_bState == bot_state_t::FOLLOWING_ENEMY || v_bMediBot->GetBool())) {
interfaces::engineClient->ExecuteClientCmd("+attack");
} else {
interfaces::engineClient->ExecuteClientCmd("-attack");
}
}
bool HPyroBot::CreateMove(void*, float, CUserCmd* cmd) {
bool FollowBot::CreateMove(void*, float, CUserCmd* cmd) {
if (!v_bEnabled->GetBool()) return true;
Tick(cmd);
g_nTick++;
@ -249,17 +261,21 @@ void CC_Status(const CCommand& args) {
logging::Info("W+M1 State: %i, ID: %i, Search: %i", g_bState, g_nTargetID, nPilotSearch);
}
void HPyroBot::Create() {
logging::Info("Creating PyroBot");
v_bEnabled = CreateConVar("u_pyrobot_enabled", "0", "Enables WM1 bot");
v_iForceFollow = CreateConVar("u_pyrobot_force_follow", "-1", "Force follow a teammate");
v_bForceFollowOnly = CreateConVar("u_pyrobot_force_follow_only", "1", "only follow force");
v_iMaxDeltaY = CreateConVar("u_pyrobot_max_height", "450", "Max dY");
v_iMaxDistance = CreateConVar("u_pyrobot_aim_distance", "1300", "Distance");
v_iShootDistance = CreateConVar("u_pyrobot_shoot_distance", "800", "Shoot distance");
v_bChat = CreateConVar("u_pyrobot_chat", "0", "Enable chat");
cmd_Status = CreateConCommand("u_pyrobot_status", CC_Status, "Status");
void FollowBot::Create() {
v_bEnabled = CreateConVar("u_follow_enabled", "0", "Enables followbot");
v_iForceFollow = CreateConVar("u_follow_force_follow", "-1", "Force follow by UID");
v_bForceFollowOnly = CreateConVar("u_follow_force_follow_only", "1", "Only follow that player");
v_iMaxDeltaY = CreateConVar("u_follow_max_height", "450", "Max dY");
v_iMaxDistance = CreateConVar("u_follow_aim_distance", "1300", "Distance");
v_iShootDistance = CreateConVar("u_follow_shoot_distance", "800", "Shoot distance");
v_bChat = CreateConVar("u_follow_chat", "0", "Enable chat");
v_bMediBot = CreateConVar("u_followbot", "1", "Medic mode");
cmd_Status = CreateConCommand("u_followbot_status", CC_Status, "Status");
}
void HPyroBot::Destroy() {}
void HPyroBot::PaintTraverse(void*, unsigned int, bool, bool) {}
void FollowBot::Destroy() {}
void FollowBot::PaintTraverse(void*, unsigned int, bool, bool) {}
FollowBot* g_phFollowBot = 0;

View File

@ -14,7 +14,7 @@ class ConVar;
class IClientEntity;
class ConCommand;
class HPyroBot : public IHack {
class FollowBot : public IHack {
public:
void Create();
bool CreateMove(void*, float, CUserCmd*);
@ -30,7 +30,10 @@ public:
ConVar* v_iMaxDistance;
ConVar* v_iShootDistance;
ConVar* v_iMaxDeltaY;
ConVar* v_bMediBot;
ConVar* v_bChat;
};
extern FollowBot* g_phFollowBot;
#endif /* HPYROBOT_H_ */

View File

@ -251,3 +251,5 @@ bool HAimbot::Aim(IClientEntity* entity, CUserCmd* cmd) {
}
return true;
}
HAimbot* g_phAimbot = 0;

View File

@ -44,5 +44,6 @@ public:
ConVar* v_bMachinaPenetration;
};
extern HAimbot* g_phAimbot;
#endif /* HAIMBOT_H_ */

View File

@ -56,4 +56,5 @@ void HBunnyhop::Destroy() {
void HBunnyhop::PaintTraverse(void*, unsigned int, bool, bool) {}
HBunnyhop* g_phBunnyhop = 0;

View File

@ -21,4 +21,6 @@ public:
ConVar* v_bEnabled;
};
extern HBunnyhop* g_phBunnyhop;
#endif /* HBUNNYHOP_H_ */

View File

@ -374,6 +374,5 @@ bool HEsp::CreateMove(void*, float, CUserCmd*) {
void HEsp::Destroy() {};
HEsp* g_phEsp;

View File

@ -46,4 +46,6 @@ public:
//ConVar* v_bModelInfo;
};
extern HEsp* g_phEsp;
#endif /* HESP_H_ */

View File

@ -10,7 +10,9 @@
#include "IHack.h"
class HPowerupList : public IHack {
// TODO implement
/*class HPowerupList : public IHack {
public:
void Create();
void Destroy();
@ -26,6 +28,6 @@ public:
// TODO
};
*/
#endif /* HPOWERUPLIST_H_ */

View File

@ -112,14 +112,14 @@ bool HTrigger::CreateMove(void* thisptr, float sampl, CUserCmd* cmd) {
// If we need charge...
if (!bodyshot && this->v_bBodyshot->GetBool()) {
float bdmg = GetEntityValue<float>(g_pLocalPlayer->weapon, eoffsets.flChargedDamage);
if (bdmg >= 15.0f && (bdmg) >= health) {
if (CanHeadshot(g_pLocalPlayer->entity) && (bdmg) >= health) {
bodyshot = true;
}
}
}
if (!bodyshot && (g_pLocalPlayer->clazz == tf_class::tf_sniper) && this->v_bZoomedOnly->GetBool() &&
!(g_pLocalPlayer->cond_0 & cond::zoomed)) {
!((g_pLocalPlayer->cond_0 & cond::zoomed) && CanHeadshot(g_pLocalPlayer->entity))) {
return true;
}
//IClientEntity* weapon;
@ -136,3 +136,5 @@ void HTrigger::Destroy() {
}
void HTrigger::PaintTraverse(void*, unsigned int, bool, bool) {};
HTrigger* g_phTrigger = 0;

View File

@ -28,4 +28,6 @@ public:
ConVar* v_bBuildings;
};
extern HTrigger* g_phTrigger;
#endif /* HTRIGGER_H_ */

View File

@ -11,8 +11,9 @@
class CUserCmd;
class ConVar;
class ConCommand;
class CCommand;
#define DECL_HACK \
#define DECLARE_HACK() \
void Create(); \
bool CreateMove(void*, float, CUserCmd*); \
void Destroy(); \

View File

@ -0,0 +1,16 @@
/*
* InfoSpam.cpp
*
* Created on: Nov 19, 2016
* Author: nullifiedcat
*/
#include "InfoSpam.h"
/*void InfoSpam::Create() {
}
bool InfoSpam::CreateMove(void*, float, CUserCmd*) { return true; }
void InfoSpam::PaintTraverse(void*, unsigned int, bool, bool) {}
void InfoSpam::Destroy() {}*/

25
uran/src/hacks/InfoSpam.h Normal file
View File

@ -0,0 +1,25 @@
/*
* InfoSpam.h
*
* Created on: Nov 19, 2016
* Author: nullifiedcat
*/
#ifndef HACKS_INFOSPAM_H_
#define HACKS_INFOSPAM_H_
#include "IHack.h"
// TODO
/*#include <vector>
void CC_ShowInfo(const CCommand& args);
class InfoSpam : public IHack {
public:
DECLARE_HACK();
ConVar* v_bEnabled;
ConCommand* c_ShowInfo;
};*/
#endif /* HACKS_INFOSPAM_H_ */

View File

@ -23,7 +23,9 @@
#include <icliententitylist.h>
#include <Color.h>
#include <cdll_int.h>
#include <iconvar.h>
#include <dt_common.h>
#include <inputsystem/iinputsystem.h>
void CC_SayLines(const CCommand& args) {
char cmd[256];
@ -108,8 +110,27 @@ void CC_DumpPlayers(const CCommand& args) {
}
}
void LockConCommand(const char* name, bool lock) {
ConCommandBase* cmd = interfaces::cvar->FindCommandBase(name);
if (lock) {
cmd->m_nFlags |= FCVAR_CHEAT;
} else {
cmd->m_nFlags &= ~FCVAR_CHEAT;
}
}
void LockConCommands(bool lock) {
LockConCommand("thirdperson", lock);
}
ConCommandBase* teamname = 0;
void CC_Lockee(const CCommand& args) {
if (args.ArgC() > 1) {
LockConCommands(atoi(args.Arg(1)));
}
}
void CC_Teamname(const CCommand& args) {
if (!teamname) {
logging::Info("searching");
@ -128,6 +149,14 @@ void CC_Teamname(const CCommand& args) {
logging::Info("B");*/
}
void CC_SayInfo(const CCommand& args) {
int id = atoi(args.Arg(1));
player_info_t info;
if (!interfaces::engineClient->GetPlayerInfo(id, &info)) return;
char* buf = new char[256];
}
void Misc::Create() {
v_bDbWeaponInfo = CreateConVar("u_misc_debug_weapon", "0", "Debug info: Weapon");
v_bSemiAuto = CreateConVar("u_misc_semiauto", "0", "Force semi-auto");
@ -138,6 +167,7 @@ void Misc::Create() {
c_DumpVars = CreateConCommand("u_dumpent", CC_DumpVars, "Dumps entity data");
c_DumpPlayers = CreateConCommand("u_dumpplayers", CC_DumpPlayers, "Dumps player data");
c_Teamname = CreateConCommand("u_teamname", CC_Teamname, "Team name");
c_Lockee = CreateConCommand("u_lockee", CC_Lockee, "Lock/Unlock commands");
}
int sa_switch = 0;
@ -162,7 +192,13 @@ void Misc::Destroy() {
void Misc::PaintTraverse(void*, unsigned int, bool, bool) {
int y = 10;
if (v_bDbWeaponInfo->GetBool()) {
if (!v_bDbWeaponInfo->GetBool())return;
if (!interfaces::input->IsButtonDown(ButtonCode_t::KEY_F)) {
interfaces::baseClient->IN_ActivateMouse();
} else {
interfaces::baseClient->IN_DeactivateMouse();
}
if (g_pLocalPlayer->weapon) {
IClientEntity* weapon = g_pLocalPlayer->weapon;
draw::DrawString(10, y, draw::white, draw::black, false, "Weapon: %s [%i]", weapon->GetClientClass()->GetName(), weapon->GetClientClass()->m_ClassID);
@ -176,6 +212,9 @@ void Misc::PaintTraverse(void*, unsigned int, bool, bool) {
draw::DrawString(10, y, draw::white, draw::black, false, "Decaps: %i", GetEntityValue<int>(g_pLocalPlayer->entity, eoffsets.iDecapitations));
y += 14;
draw::DrawString(10, y, draw::white, draw::black, false, "Damage: %f", GetEntityValue<float>(g_pLocalPlayer->weapon, eoffsets.flChargedDamage));
}
}
y += 14;
draw::DrawString(draw::font_handle, interfaces::input->GetAnalogValue(AnalogCode_t::MOUSE_X), interfaces::input->GetAnalogValue(AnalogCode_t::MOUSE_Y), draw::white, L"S\u0FD5");
}
}
Misc* g_phMisc = 0;

View File

@ -28,6 +28,10 @@ public:
ConCommand* c_DumpVars;
ConCommand* c_DumpPlayers;
ConCommand* c_Teamname;
ConCommand* c_Lockee;
ConCommand* c_Info;
};
extern Misc* g_phMisc;
#endif /* HACKS_MISC_H_ */

View File

@ -41,3 +41,5 @@ bool Quickscope::CreateMove(void*, float, CUserCmd* cmd) {
void Quickscope::Destroy() {}
void Quickscope::PaintTraverse(void*, unsigned int, bool, bool) { }
Quickscope* g_phQuickscope = 0;

View File

@ -12,8 +12,10 @@
class Quickscope : public IHack {
public:
DECL_HACK
DECLARE_HACK()
ConVar* v_bEnabled;
};
extern Quickscope* g_phQuickscope;
#endif /* HACKS_QUICKSCOPE_H_ */

View File

@ -7,7 +7,8 @@
#include "Tracers.h"
void Tracers::Create() {
//TODO
/*void Tracers::Create() {
}
@ -16,4 +17,4 @@ bool Tracers::CreateMove(void*, float, CUserCmd*) { return true; }
void Tracers::PaintTraverse(void*, unsigned int, bool, bool) {
}
}*/

View File

@ -9,14 +9,12 @@
#define HACKS_TRACERS_H_
#include "IHack.h"
class ConVar;
class Tracers : public IHack {
// TODO tracers
/*class Tracers : public IHack {
public:
DECL_HACK
DECLARE_HACK()
ConVar* v_bEnabled;
ConVar* v_bTraceVisible;
};
};*/
#endif /* HACKS_TRACERS_H_ */

View File

@ -603,6 +603,15 @@ bool IsEntityVisiblePenetration(IClientEntity* entity, int hb) {
return false;
}
char* strfmt(const char* fmt, ...) {
char* buf = new char[1024];
va_list list;
va_start(list, fmt);
vsprintf(buf, fmt, list);
va_end(list);
return buf;
}
const char* powerups[] = {
"STRENGTH",
"RESISTANCE",
@ -619,6 +628,18 @@ const char* powerups[] = {
"CRITS"
};
/*const char* classes[] = {
"",
"",
"",
"",
"",
"",
"",
"",
""
};*/
uint32 friends[256];
uint32 rage[256];

View File

@ -52,6 +52,7 @@ bool IsVectorVisible(Vector a, Vector b);
bool PredictProjectileAim(Vector origin, IClientEntity* target, hitbox hb, float speed, bool arc, Vector& result);
relation GetRelation(IClientEntity* ent);
bool IsSentryBuster(IClientEntity* ent);
char* strfmt(const char* fmt, ...);
bool CanHeadshot(IClientEntity* player);
@ -71,6 +72,7 @@ Vector CalcAngle(Vector src, Vector dst);
void MakeVector(Vector ang, Vector& out);
float GetFov(Vector ang, Vector src, Vector dst);
//extern const char* classes[9];
extern const char* powerups[POWERUP_COUNT];
extern const char* packs[PACK_COUNT];
extern uint32 friends[256];

View File

@ -24,6 +24,7 @@ IGameEventManager2* interfaces::eventManager = 0;
IBaseClientDLL* interfaces::baseClient = 0;
IEngineTrace* interfaces::trace = 0;
IVModelInfoClient* interfaces::model = 0;
IInputSystem* interfaces::input = 0;
//ICvar* interfaces::cvar = 0;
void interfaces::CreateInterfaces() {
@ -38,6 +39,7 @@ void interfaces::CreateInterfaces() {
interfaces::baseClient = reinterpret_cast<IBaseClientDLL*>(sharedobj::client->CreateInterface("VClient017"));
interfaces::trace = reinterpret_cast<IEngineTrace*>(sharedobj::engine->CreateInterface("EngineTraceClient003"));
interfaces::model = reinterpret_cast<IVModelInfoClient*>(sharedobj::engine->CreateInterface("VModelInfoClient006"));
interfaces::input = reinterpret_cast<IInputSystem*>(sharedobj::inputsystem->CreateInterface("InputSystemVersion001"));
HSteamPipe sp = interfaces::steamClient->CreateSteamPipe();
HSteamUser su = interfaces::steamClient->ConnectToGlobalUser(sp);
interfaces::steamFriends = reinterpret_cast<ISteamFriends002*>(interfaces::steamClient->GetISteamFriends(su, sp, "SteamFriends002"));

View File

@ -24,6 +24,7 @@ class IBaseClientDLL;
class ClientModeShared;
class IEngineTrace;
class IVModelInfoClient;
class IInputSystem;
namespace interfaces {
@ -39,6 +40,7 @@ extern IGameEventManager2* eventManager;
extern IBaseClientDLL* baseClient;
extern IEngineTrace* trace;
extern IVModelInfoClient* model;
extern IInputSystem* input;
void CreateInterfaces();

View File

@ -6,9 +6,11 @@
*/
#include "logging.h"
#include "helpers.h"
#include <stdarg.h>
#include <string.h>
#include <pwd.h>
#include "fixsdk.h"
#include <icvar.h>
@ -20,7 +22,9 @@ ICvar* cvar;
FILE* logging::handle = 0;
void logging::Initialize() {
logging::handle = fopen("/tmp/uran.log", "w");
passwd* pwd = getpwuid(getuid());
char* user = pwd->pw_name;
logging::handle = fopen(strfmt("/tmp/uran-%s.log", user), "w");
}
void logging::Info(const char* fmt, ...) {

View File

@ -7,11 +7,13 @@
#include "sharedobj.h"
#include "logging.h"
#include "helpers.h"
#include <unistd.h>
#include <link.h>
#include <dlfcn.h>
#include <libgen.h>
#include <pwd.h>
// TODO
#define STEAM_BASEDIR "/home/nullifiedcat/.local/share/Steam/"
@ -27,9 +29,11 @@ sharedobj::SharedObject* sharedobj::vguimatsurface = 0;
sharedobj::SharedObject* sharedobj::vgui2 = 0;
sharedobj::SharedObject* sharedobj::vstdlib = 0;
sharedobj::SharedObject* sharedobj::tier0 = 0;
sharedobj::SharedObject* sharedobj::inputsystem = 0;
sharedobj::SharedObject::SharedObject(const char* path, bool factory) {
this->path = path;
logging::Info("Loading SharedObject: %s", path);
while (!(lmap = (link_map*)dlopen(path, RTLD_NOLOAD))) {
sleep(1);
if (0 != dlerror()) {
@ -63,12 +67,24 @@ void* sharedobj::SharedObject::CreateInterface(const char* name) {
}
void sharedobj::LoadAllSharedObjects() {
sharedobj::client = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/tf/bin/client.so", true);
passwd* pwd = getpwuid(getuid());
char* user = pwd->pw_name;
sharedobj::client = new SharedObject(strfmt("/home/%s/.local/share/Steam/steamapps/common/Team Fortress 2/tf/bin/client.so", user), true);
sharedobj::engine = new SharedObject(strfmt("/home/%s/.local/share/Steam/steamapps/common/Team Fortress 2/bin/engine.so", user), true);
sharedobj::steamclient = new SharedObject(strfmt("/home/%s/.local/share/Steam/linux32/steamclient.so", user), true);
sharedobj::tier0 = new SharedObject(strfmt("/home/%s/.local/share/Steam/steamapps/common/Team Fortress 2/bin/libtier0.so", user), false);
sharedobj::vgui2 = new SharedObject(strfmt("/home/%s/.local/share/Steam/steamapps/common/Team Fortress 2/bin/vgui2.so", user), true);
sharedobj::vguimatsurface = new SharedObject(strfmt("/home/%s/.local/share/Steam/steamapps/common/Team Fortress 2/bin/vguimatsurface.so", user), true);
sharedobj::vstdlib = new SharedObject(strfmt("/home/%s/.local/share/Steam/steamapps/common/Team Fortress 2/bin/libvstdlib.so", user), true);
sharedobj::inputsystem = new SharedObject(strfmt("/home/%s/.local/share/Steam/steamapps/common/Team Fortress 2/bin/inputsystem.so", user), true);
/*sharedobj::client = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/tf/bin/client.so", true);
sharedobj::engine = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/engine.so", true);
sharedobj::steamclient = new SharedObject(STEAM_BASEDIR "linux32/steamclient.so", true);
//sharedobj::steamclient = new SharedObject(STEAM_BASEDIR "linux32/steamclient.so", true);
sharedobj::steamclient = new SharedObject("/home/steam-0/.local/share/Steam/linux32/steamclient.so", true);
sharedobj::tier0 = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/libtier0.so", false);
sharedobj::vgui2 = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/vgui2.so", true);
sharedobj::vguimatsurface = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/vguimatsurface.so", true);
sharedobj::vstdlib = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/libvstdlib.so", true);
sharedobj::inputsystem = new SharedObject(STEAM_BASEDIR "steamapps/common/Team Fortress 2/bin/inputsystem.so", true);*/
}

View File

@ -30,6 +30,7 @@ extern SharedObject* vguimatsurface;
extern SharedObject* vgui2;
extern SharedObject* vstdlib;
extern SharedObject* tier0;
extern SharedObject* inputsystem;
void LoadAllSharedObjects();