pNoZoom and other stuff
This commit is contained in:
parent
ff1b47b723
commit
599b9574d9
@ -214,7 +214,7 @@
|
||||
<option defaultValue="true" id="gnu.cpp.link.option.shared.498201529" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared" useByScannerDiscovery="false" valueType="boolean"/>
|
||||
<option id="gnu.cpp.link.option.flags.451119206" name="Linker flags" superClass="gnu.cpp.link.option.flags" useByScannerDiscovery="false" value="-m32 -fno-gnu-unique -D_GLIBCXX_USE_CXX11_ABI=0" valueType="string"/>
|
||||
<option id="gnu.cpp.link.option.paths.1006881276" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" useByScannerDiscovery="false" valueType="libPaths">
|
||||
<listOptionValue builtIn="false" value=""/home/nullifiedcat/.steam/steam/steamapps/common/Team Fortress 2/bin""/>
|
||||
<listOptionValue builtIn="false" value=""/home/nullifiedcat/.steam/steam/steamapps/common/Half-Life 2 Deathmatch/bin""/>
|
||||
</option>
|
||||
<option id="gnu.cpp.link.option.nodeflibs.1073691054" name="Do not use default libraries (-nodefaultlibs)" superClass="gnu.cpp.link.option.nodeflibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
<option id="gnu.cpp.link.option.nostdlibs.493909650" name="No startup or default libs (-nostdlib)" superClass="gnu.cpp.link.option.nostdlibs" useByScannerDiscovery="false" value="false" valueType="boolean"/>
|
||||
@ -261,10 +261,12 @@
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Debug">
|
||||
<configuration configurationName="TF2"/>
|
||||
<configuration configurationName="Release">
|
||||
<resource resourceType="PROJECT" workspacePath="/UranHack"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Release">
|
||||
<configuration configurationName="HL2DM"/>
|
||||
<configuration configurationName="Debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/UranHack"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
|
2
uran/.gitignore
vendored
2
uran/.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
/Debug/src/
|
||||
/HL2DM/*
|
||||
/Debug/src_/
|
||||
/Debug/makefile
|
||||
/Debug/objects.mk
|
||||
@ -6,3 +7,4 @@
|
||||
/Debug/
|
||||
/src_/
|
||||
/TF2/
|
||||
/HL2DM/
|
||||
|
@ -46,6 +46,7 @@ void EntityVariables::Init() {
|
||||
this->vecPunchAngle = gNetvars.get_offset("DT_BasePlayer", "localdata", "m_Local", "m_vecPunchAngle");
|
||||
this->vecPunchAngleVel = gNetvars.get_offset("DT_BasePlayer", "localdata", "m_Local", "m_vecPunchAngleVel");
|
||||
this->iItemDefinitionIndex = gNetvars.get_offset("DT_EconEntity", "m_AttributeManager", "m_Item", "m_iItemDefinitionIndex");
|
||||
this->AttributeList = gNetvars.get_offset("DT_EconEntity", "m_AttributeManager", "m_Item", "m_AttributeList");
|
||||
this->flChargeBeginTime = gNetvars.get_offset("DT_WeaponPipebombLauncher", "PipebombLauncherLocalData", "m_flChargeBeginTime");
|
||||
this->flLastFireTime = gNetvars.get_offset("DT_TFWeaponBase", "LocalActiveTFWeaponData", "m_flLastFireTime");
|
||||
this->hThrower = gNetvars.get_offset("DT_BaseGrenade", "m_hThrower");
|
||||
|
@ -67,6 +67,7 @@ public:
|
||||
offset_t iMaxBuffedHealth;
|
||||
|
||||
offset_t iItemDefinitionIndex;
|
||||
offset_t AttributeList;
|
||||
|
||||
offset_t vecPunchAngle;
|
||||
offset_t vecPunchAngleVel;
|
||||
|
@ -12,6 +12,7 @@
|
||||
#define _LINUX 1
|
||||
#define POSIX 1
|
||||
#define GNUC 1
|
||||
#define NO_MALLOC_OVERRIDE 1
|
||||
#undef min
|
||||
#define private public
|
||||
#define protected public
|
||||
|
@ -14,6 +14,9 @@ void GlobalSettings::Init() {
|
||||
this->bIgnoreTaunting = CreateConVar("u_ignore_taunting", "1", "Ignore taunting players");
|
||||
this->flForceFOV = CreateConVar("u_fov", "90", "Forces FOV");
|
||||
this->bProfiler = CreateConVar("u_profiler", "0", "Profiler output enabled");
|
||||
this->bNoZoom = CreateConVar("u_nozoom", "1", "No Zoom");
|
||||
this->bNoFlinch = CreateConVar("u_noflinch", "0", "No-Flinch");
|
||||
this->bSendPackets = CreateConVar("u_sendpackets", "1", "Send packets");
|
||||
}
|
||||
|
||||
GlobalSettings g_Settings;
|
||||
|
@ -18,6 +18,9 @@ public:
|
||||
ConVar* bHackEnabled;
|
||||
ConVar* bIgnoreTaunting;
|
||||
ConVar* bProfiler;
|
||||
ConVar* bNoZoom;
|
||||
ConVar* bNoFlinch;
|
||||
ConVar* bSendPackets;
|
||||
};
|
||||
|
||||
extern GlobalSettings g_Settings;
|
||||
|
@ -59,6 +59,7 @@
|
||||
#include <Color.h>
|
||||
#include <view_shared.h>
|
||||
#include <icvar.h>
|
||||
#include <inetchannel.h>
|
||||
#include "copypasted/CSignature.h"
|
||||
#include "copypasted/Netvar.h"
|
||||
#include "CDumper.h"
|
||||
@ -76,18 +77,20 @@
|
||||
typedef void(PaintTraverse_t)(void*, unsigned int, bool, bool);
|
||||
typedef bool(CreateMove_t)(void*, float, CUserCmd*);
|
||||
typedef void(OverrideView_t)(void*, CViewSetup*);
|
||||
typedef void(FrameStageNotify_t)(void*, int);
|
||||
typedef bool(DispatchUserMessage_t)(void*, int, bf_read&);
|
||||
|
||||
bool hack::invalidated = true;
|
||||
|
||||
void hack::Hk_OverrideView(void* thisptr, CViewSetup* setup) {
|
||||
((OverrideView_t*)hooks::hkCreateMove->GetMethod(hooks::offOverrideView))(thisptr, setup);
|
||||
((OverrideView_t*)hooks::hkClientMode->GetMethod(hooks::offOverrideView))(thisptr, setup);
|
||||
if (g_Settings.flForceFOV && g_Settings.flForceFOV->GetBool()) {
|
||||
setup->fov = g_Settings.flForceFOV->GetFloat();
|
||||
}
|
||||
}
|
||||
|
||||
void hack::Hk_PaintTraverse(void* p, unsigned int vp, bool fr, bool ar) {
|
||||
((PaintTraverse_t*)hooks::hkPaintTraverse->GetMethod(hooks::offPaintTraverse))(p, vp, fr, ar);
|
||||
((PaintTraverse_t*)hooks::hkPanel->GetMethod(hooks::offPaintTraverse))(p, vp, fr, ar);
|
||||
if (!draw::width || !draw::height) {
|
||||
interfaces::engineClient->GetScreenSize(draw::width, draw::height);
|
||||
}
|
||||
@ -133,12 +136,28 @@ void hack::Hk_PaintTraverse(void* p, unsigned int vp, bool fr, bool ar) {
|
||||
}
|
||||
}
|
||||
|
||||
typedef bool(CanPacket_t)(void* thisptr);
|
||||
bool Hk_CanPacket(void* thisptr) {
|
||||
return false;//g_Settings.bSendPackets->GetBool() && ((CanPacket_t*)hooks::hkNetChannel->GetMethod(hooks::offCanPacket))(thisptr);
|
||||
}
|
||||
|
||||
bool hack::Hk_CreateMove(void* thisptr, float inputSample, CUserCmd* cmd) {
|
||||
bool ret = ((CreateMove_t*)hooks::hkCreateMove->GetMethod(hooks::offCreateMove))(thisptr, inputSample, cmd);
|
||||
bool ret = ((CreateMove_t*)hooks::hkClientMode->GetMethod(hooks::offCreateMove))(thisptr, inputSample, cmd);
|
||||
if (!interfaces::engineClient->IsInGame()) {
|
||||
hack::invalidated = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
/*INetChannel* ch = (INetChannel*)interfaces::engineClient->GetNetChannelInfo();
|
||||
if (ch && !hooks::IsHooked(ch)) {
|
||||
logging::Info("NCI not hooked!");
|
||||
hooks::hkNetChannel = new hooks::VMTHook();
|
||||
hooks::hkNetChannel->Init(ch, 0);
|
||||
hooks::hkNetChannel->HookMethod((void*)Hk_CanPacket, hooks::offCanPacket);
|
||||
hooks::hkNetChannel->Apply();
|
||||
logging::Info("Applied!");
|
||||
}
|
||||
logging::Info("Can packet? %i", ch->CanPacket());*/
|
||||
if (!cmd) return ret;
|
||||
|
||||
g_pPlayerResource->Update();
|
||||
@ -147,11 +166,26 @@ bool hack::Hk_CreateMove(void* thisptr, float inputSample, CUserCmd* cmd) {
|
||||
g_pLocalPlayer->v_OrigViewangles = cmd->viewangles;
|
||||
gEntityCache.Update();
|
||||
|
||||
for (IHack* i_hack : hack::hacks) {
|
||||
g_phBunnyhop->CreateMove(thisptr, inputSample, cmd);
|
||||
//RunEnginePrediction(g_pLocalPlayer->entity, cmd);
|
||||
g_phESP->CreateMove(thisptr, inputSample, cmd);
|
||||
g_phAimbot->CreateMove(thisptr, inputSample, cmd);
|
||||
g_phAirstuck->CreateMove(thisptr, inputSample, cmd);
|
||||
g_phAntiAim->CreateMove(thisptr, inputSample, cmd);
|
||||
g_phAntiDisguise->CreateMove(thisptr, inputSample, cmd);
|
||||
g_phAutoHeal->CreateMove(thisptr, inputSample, cmd);
|
||||
g_phAutoReflect->CreateMove(thisptr, inputSample, cmd);
|
||||
g_phAutoSticky->CreateMove(thisptr, inputSample, cmd);
|
||||
g_phAutoStrafe->CreateMove(thisptr, inputSample, cmd);
|
||||
g_phFollowBot->CreateMove(thisptr, inputSample, cmd);
|
||||
g_phMisc->CreateMove(thisptr, inputSample, cmd);
|
||||
g_phTriggerbot->CreateMove(thisptr, inputSample, cmd);
|
||||
|
||||
/*for (IHack* i_hack : hack::hacks) {
|
||||
if (!i_hack->CreateMove(thisptr, inputSample, cmd)) {
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
hack::invalidated = false;
|
||||
if (g_pLocalPlayer->bUseSilentAngles) {
|
||||
Vector vsilent(cmd->forwardmove, cmd->sidemove, cmd->upmove);
|
||||
@ -166,6 +200,40 @@ bool hack::Hk_CreateMove(void* thisptr, float inputSample, CUserCmd* cmd) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void hack::Hk_FrameStageNotify(void* thisptr, int stage) {
|
||||
//logging::Info("FrameStageNotify %i", stage);
|
||||
// Ambassador to festive ambassador changer. simple.
|
||||
if (g_Settings.bNoFlinch->GetBool()) {
|
||||
static Vector oldPunchAngles = Vector();
|
||||
Vector punchAngles = GetEntityValue<Vector>(g_pLocalPlayer->entity, eoffsets.vecPunchAngle);
|
||||
QAngle viewAngles;
|
||||
interfaces::engineClient->GetViewAngles(viewAngles);
|
||||
viewAngles -= VectorToQAngle(punchAngles - oldPunchAngles);
|
||||
oldPunchAngles = punchAngles;
|
||||
interfaces::engineClient->SetViewAngles(viewAngles);
|
||||
}
|
||||
if (g_pLocalPlayer->weapon) {
|
||||
int defidx = GetEntityValue<int>(g_pLocalPlayer->weapon, eoffsets.iItemDefinitionIndex);
|
||||
if (defidx == 61) {
|
||||
SetEntityValue<int>(g_pLocalPlayer->weapon, eoffsets.iItemDefinitionIndex, 1006);
|
||||
}
|
||||
}
|
||||
if (g_Settings.bNoZoom->GetBool()) {
|
||||
if (g_pLocalPlayer->entity) {
|
||||
bool zoomed = (g_pLocalPlayer->cond_0 & cond::zoomed);
|
||||
if (zoomed) {
|
||||
SetEntityValue(g_pLocalPlayer->entity, eoffsets.iCond, g_pLocalPlayer->cond_0 &~ cond::zoomed);
|
||||
}
|
||||
}
|
||||
}
|
||||
((FrameStageNotify_t*)hooks::hkClient->GetMethod(hooks::offFrameStageNotify))(thisptr, stage);
|
||||
}
|
||||
|
||||
bool hack::Hk_DispatchUserMessage(void* thisptr, int type, bf_read& buf) {
|
||||
//logging::Info("message %i", type);
|
||||
return ((DispatchUserMessage_t*)hooks::hkClient->GetMethod(hooks::offFrameStageNotify + 1))(thisptr, type, buf);
|
||||
}
|
||||
|
||||
std::vector<IHack*> hack::hacks;
|
||||
bool hack::shutdown = false;
|
||||
|
||||
@ -175,7 +243,6 @@ void hack::AddHack(IHack* hack) {
|
||||
|
||||
ICvar* g_pCVar = 0;
|
||||
|
||||
|
||||
void hack::InitHacks() {
|
||||
ADD_HACK(AutoStrafe);
|
||||
ADD_HACK(AntiAim);
|
||||
@ -226,22 +293,25 @@ void hack::Initialize() {
|
||||
g_pLocalPlayer = new LocalPlayer();
|
||||
g_pPlayerResource = new TFPlayerResource();
|
||||
|
||||
logging::Info("Hooking PaintTraverse...");
|
||||
hooks::hkPaintTraverse = new hooks::VMTHook();
|
||||
hooks::hkPaintTraverse->Init(interfaces::panel, 0);
|
||||
hooks::hkPaintTraverse->HookMethod((void*)&hack::Hk_PaintTraverse, hooks::offPaintTraverse);
|
||||
hooks::hkPaintTraverse->Apply();
|
||||
logging::Info("Hooking CreateMove...");
|
||||
hooks::hkCreateMove = new hooks::VMTHook();
|
||||
logging::Info("Hooking methods...");
|
||||
hooks::hkPanel = new hooks::VMTHook();
|
||||
hooks::hkPanel->Init(interfaces::panel, 0);
|
||||
hooks::hkPanel->HookMethod((void*)&hack::Hk_PaintTraverse, hooks::offPaintTraverse);
|
||||
hooks::hkPanel->Apply();
|
||||
hooks::hkClientMode = new hooks::VMTHook();
|
||||
uintptr_t* clientMode = 0;
|
||||
while(!(clientMode = **(uintptr_t***)((uintptr_t)((*(void***)interfaces::baseClient)[10]) + 1))) {
|
||||
sleep(1);
|
||||
}
|
||||
hooks::hkCreateMove->Init((void*)clientMode, 0);
|
||||
hooks::hkCreateMove->HookMethod((void*)&hack::Hk_CreateMove, hooks::offCreateMove);
|
||||
logging::Info("Hooking OverrideView...");
|
||||
hooks::hkCreateMove->HookMethod((void*)&hack::Hk_OverrideView, hooks::offOverrideView);
|
||||
hooks::hkCreateMove->Apply();
|
||||
hooks::hkClientMode->Init((void*)clientMode, 0);
|
||||
hooks::hkClientMode->HookMethod((void*)&hack::Hk_CreateMove, hooks::offCreateMove);
|
||||
hooks::hkClientMode->HookMethod((void*)&hack::Hk_OverrideView, hooks::offOverrideView);
|
||||
hooks::hkClientMode->Apply();
|
||||
hooks::hkClient = new hooks::VMTHook();
|
||||
hooks::hkClient->Init((void*)interfaces::baseClient, 0);
|
||||
hooks::hkClient->HookMethod((void*)&hack::Hk_FrameStageNotify, hooks::offFrameStageNotify);
|
||||
hooks::hkClient->HookMethod((void*)&hack::Hk_DispatchUserMessage, hooks::offFrameStageNotify + 1);
|
||||
hooks::hkClient->Apply();
|
||||
logging::Info("Hooked!");
|
||||
InitStrings();
|
||||
logging::Info("Init done!");
|
||||
@ -281,8 +351,9 @@ void hack::Shutdown() {
|
||||
logging::Info("Shutting down...");
|
||||
logging::Shutdown();
|
||||
ConVar_Unregister();
|
||||
hooks::hkPaintTraverse->Kill();
|
||||
hooks::hkCreateMove->Kill();
|
||||
hooks::hkPanel->Kill();
|
||||
hooks::hkClientMode->Kill();
|
||||
hooks::hkClient->Kill();
|
||||
for (IHack* i_hack : hack::hacks) {
|
||||
delete i_hack;
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
class IHack;
|
||||
class CUserCmd;
|
||||
class CViewSetup;
|
||||
class bf_read;
|
||||
|
||||
namespace hack {
|
||||
|
||||
@ -26,6 +27,8 @@ extern bool invalidated;
|
||||
void Hk_OverrideView(void*, CViewSetup*);
|
||||
void Hk_PaintTraverse(void*, unsigned int, bool, bool);
|
||||
bool Hk_CreateMove(void*, float, CUserCmd*);
|
||||
void Hk_FrameStageNotify(void*, int stage);
|
||||
bool Hk_DispatchUserMessage(void*, int, bf_read&);
|
||||
|
||||
void AddHack(IHack* hack);
|
||||
|
||||
|
@ -273,18 +273,6 @@ IClientEntity* FollowBot::GetBestHealingTarget() {
|
||||
bool FollowBot::CreateMove(void*, float, CUserCmd* cmd) {
|
||||
if (!v_bEnabled->GetBool()) return true;
|
||||
|
||||
/*ipc_bot_seg* seg_g = m_pIPC->GetBotCommand(0);
|
||||
ipc_bot_seg* seg_l = m_pIPC->GetBotCommand(m_pIPC->bot_id);
|
||||
|
||||
if (seg_g->command_number > this->last_command_global) {
|
||||
interfaces::engineClient->ExecuteClientCmd(seg_g->command_buffer);
|
||||
this->last_command_global = seg_g->command_number;
|
||||
}
|
||||
if (seg_l->command_number > this->last_command_global) {
|
||||
interfaces::engineClient->ExecuteClientCmd(seg_l->command_buffer);
|
||||
this->last_command_global = seg_l->command_number;
|
||||
}*/
|
||||
|
||||
Tick(cmd);
|
||||
g_nTick++;
|
||||
this->ActuallyCreateMove(cmd);
|
||||
@ -380,7 +368,7 @@ void CC_IPCList(const CCommand& args) {
|
||||
|
||||
FollowBot::FollowBot() {
|
||||
v_bEnabled = CreateConVar("u_bot_enabled", "0", "Enables followbot");
|
||||
v_iBotPackage = CreateConVar("u_bot_ai", "1", "AI Package (FOLLOW, MEDIC, SNIPER)");
|
||||
v_iBotPackage = CreateConVar("u_bot_ai", "0", "AI Package (FOLLOW, MEDIC, SNIPER)");
|
||||
c_AddBotID = CreateConCommand("u_bot_addbot", CC_AddBotID, "Adds another bot's ID");
|
||||
c_SetOwner = CreateConCommand("u_bot_owner", CC_SetOwner, "Set followbot owner");
|
||||
c_ResetList = CreateConCommand("u_bot_reset", CC_ResetList, "Resets bot list");
|
||||
@ -392,6 +380,9 @@ FollowBot::FollowBot() {
|
||||
this->last_command_global = 0;
|
||||
this->last_command_local = 0;
|
||||
|
||||
m_hTargetFollowing = 0;
|
||||
m_hTargetHealing = 0;
|
||||
|
||||
cmd_Status = CreateConCommand("u_bot_status", CC_BotStatus, "Status");
|
||||
g_pListener = new MedicCallListener();
|
||||
interfaces::eventManager->AddListener(g_pListener, "player_calledformedic", false);
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "../interfaces.h"
|
||||
#include "../entity.h"
|
||||
#include "../usercmd.h"
|
||||
#include "../netmessage.h"
|
||||
#include "../sdk/in_buttons.h"
|
||||
|
||||
#include "../fixsdk.h"
|
||||
@ -196,11 +197,19 @@ void CC_DisonnectVAC(const CCommand& args) {
|
||||
ch->Shutdown("VAC banned from secure server\n");
|
||||
}
|
||||
|
||||
void CC_DumpAttribs(const CCommand& args) {
|
||||
if (g_pLocalPlayer->weapon) {
|
||||
for (int i = 0; i < 15; i++) {
|
||||
logging::Info("%i %f", GetEntityValue<int>(g_pLocalPlayer->weapon, eoffsets.AttributeList + i * 12),
|
||||
GetEntityValue<float>(g_pLocalPlayer->weapon, eoffsets.AttributeList + i * 12 + 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Misc::Misc() {
|
||||
v_bDbWeaponInfo = CreateConVar("u_misc_debug_weapon", "0", "Debug info: Weapon");
|
||||
v_bSemiAuto = CreateConVar("u_misc_semiauto", "0", "Force semi-auto");
|
||||
v_bNoZoom = CreateConVar("u_nozoom", "0", "No-Zoom");
|
||||
v_bNoFlinch = CreateConVar("u_noflinch", "0", "No-Flinch");
|
||||
v_strName = CreateConVar("u_name", "", "Crash the game if changed");
|
||||
c_DumpItemAttributes = CreateConCommand("u_dump_item_attribs", CC_DumpAttribs, "Dump active weapon attributes");
|
||||
c_SayLine = CreateConCommand("u_say_lines", CC_SayLines, "Uses ^ as a newline character");
|
||||
c_Shutdown = CreateConCommand("u_shutdown", CC_Shutdown, "Stops the hack");
|
||||
c_AddFriend = CreateConCommand("u_addfriend", CC_AddFriend, "Adds a friend");
|
||||
@ -218,47 +227,18 @@ int sa_switch = 0;
|
||||
|
||||
|
||||
bool Misc::CreateMove(void*, float, CUserCmd* cmd) {
|
||||
if (v_bSemiAuto->GetBool()) {
|
||||
if (cmd->buttons & IN_ATTACK) {
|
||||
if (sa_switch > 5) {
|
||||
cmd->buttons = cmd->buttons &~ IN_ATTACK;
|
||||
}
|
||||
sa_switch++;
|
||||
} else {
|
||||
sa_switch = 0;
|
||||
}
|
||||
}
|
||||
if (v_bNoZoom->GetBool()) {
|
||||
if (g_pLocalPlayer->entity) {
|
||||
bool zoomed = (g_pLocalPlayer->cond_0 & cond::zoomed);
|
||||
if (zoomed) {
|
||||
SetEntityValue(g_pLocalPlayer->entity, eoffsets.iCond, g_pLocalPlayer->cond_0 &~ cond::zoomed);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*if (v_strName->m_StringLength) {
|
||||
logging::Info("Creating NetMsg!");
|
||||
NET_SetConVar setname("name", v_strName->GetString());
|
||||
INetChannel* ch = (INetChannel*)interfaces::engineClient->GetNetChannelInfo();
|
||||
setname.SetNetChannel(ch);
|
||||
logging::Info("Sending!");
|
||||
ch->SendNetMsg(*(INetMessage*)&setname);
|
||||
}*/
|
||||
return true;
|
||||
}
|
||||
|
||||
void Misc::PaintTraverse(void*, unsigned int, bool, bool) {
|
||||
if (v_bNoZoom->GetBool()) {
|
||||
if (g_pLocalPlayer->entity) {
|
||||
bool zoomed = (g_pLocalPlayer->cond_0 & cond::zoomed);
|
||||
if (zoomed) {
|
||||
SetEntityValue(g_pLocalPlayer->entity, eoffsets.iCond, g_pLocalPlayer->cond_0 &~ cond::zoomed);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (v_bNoFlinch->GetBool()) {
|
||||
static Vector oldPunchAngles = Vector();
|
||||
Vector punchAngles = GetEntityValue<Vector>(g_pLocalPlayer->entity, eoffsets.vecPunchAngle);
|
||||
QAngle viewAngles;
|
||||
interfaces::engineClient->GetViewAngles(viewAngles);
|
||||
viewAngles -= VectorToQAngle(punchAngles - oldPunchAngles);
|
||||
oldPunchAngles = punchAngles;
|
||||
interfaces::engineClient->SetViewAngles(viewAngles);
|
||||
}
|
||||
|
||||
|
||||
if (!v_bDbWeaponInfo->GetBool())return;
|
||||
/*if (!interfaces::input->IsButtonDown(ButtonCode_t::KEY_F)) {
|
||||
|
@ -18,12 +18,9 @@ public:
|
||||
DECLARE_HACK_METHODS();
|
||||
Misc();
|
||||
//ConVar* v_bNoShootUntilCanHeadshot;
|
||||
|
||||
ConVar* v_bNoFlinch;
|
||||
ConVar* v_bNoZoom;
|
||||
|
||||
ConVar* v_bDbWeaponInfo;
|
||||
ConVar* v_bSemiAuto;
|
||||
ConVar* v_strName;
|
||||
ConCommand* c_DumpItemAttributes;
|
||||
ConCommand* c_SayLine;
|
||||
ConCommand* c_Shutdown;
|
||||
ConCommand* c_AddFriend;
|
||||
|
@ -731,13 +731,15 @@ void RunEnginePrediction(IClientEntity* ent, CUserCmd *ucmd) {
|
||||
typedef void(*FinishTrackPredictionErrorsFn)(IClientEntity *);
|
||||
|
||||
// get the vtable
|
||||
void **predictionVtable = (void **)interfaces::prediction;
|
||||
void **predictionVtable = *(void ***)interfaces::prediction;
|
||||
logging::Info("predictionVtable 0x%08x", predictionVtable);
|
||||
// get the functions
|
||||
SetupMoveFn oSetupMove = (SetupMoveFn) predictionVtable[19];
|
||||
FinishMoveFn oFinishMove = (FinishMoveFn) predictionVtable[20];
|
||||
|
||||
// get the vtable
|
||||
void **gameMovementVtable = (void **)interfaces::gamemovement;
|
||||
void **gameMovementVtable = *(void ***)interfaces::gamemovement;
|
||||
logging::Info("gameMovementVtable 0x%08x", gameMovementVtable);
|
||||
// get the functions
|
||||
ProcessMovementFn oProcessMovement = (ProcessMovementFn) gameMovementVtable[2];
|
||||
StartTrackPredictionErrorsFn oStartTrackPredictionErrors = (StartTrackPredictionErrorsFn) gameMovementVtable[3];
|
||||
@ -746,6 +748,7 @@ void RunEnginePrediction(IClientEntity* ent, CUserCmd *ucmd) {
|
||||
// use this as movedata (should be big enough - otherwise the stack will die!)
|
||||
unsigned char moveData[2048];
|
||||
CMoveData *pMoveData = (CMoveData *)&(moveData[0]);
|
||||
logging::Info("pMoveData 0x%08x", pMoveData);
|
||||
|
||||
// back up globals
|
||||
float frameTime = interfaces::gvars->frametime;
|
||||
@ -766,12 +769,16 @@ void RunEnginePrediction(IClientEntity* ent, CUserCmd *ucmd) {
|
||||
|
||||
oStartTrackPredictionErrors(ent);
|
||||
|
||||
logging::Info("StartTrackPredictionErrors(ent)");
|
||||
oSetupMove(ent, ucmd, NULL, pMoveData);
|
||||
logging::Info("oSetupMove");
|
||||
oProcessMovement(ent, pMoveData);
|
||||
logging::Info("oProcessMovement");
|
||||
oFinishMove(ent, ucmd, pMoveData);
|
||||
|
||||
oFinishTrackPredictionErrors(ent);
|
||||
logging::Info("oFinishMove");
|
||||
|
||||
oFinishTrackPredictionErrors(ent);
|
||||
logging::Info("oFinishTrackPredictionErrors");
|
||||
// reset the current command
|
||||
SetEntityValue<void *>(ent, 0x105C, NULL);
|
||||
|
||||
|
@ -14,9 +14,15 @@
|
||||
unsigned int hooks::offCreateMove = 22;
|
||||
unsigned int hooks::offPaintTraverse = 42;
|
||||
unsigned int hooks::offOverrideView = 17;
|
||||
unsigned int hooks::offFrameStageNotify = 35;
|
||||
unsigned int hooks::offCanPacket = 30;
|
||||
|
||||
// This thing had been copypasted from somewhere, maybe from F1Public.
|
||||
|
||||
bool hooks::IsHooked(void* inst) {
|
||||
return hooks::GetVMT(inst, 0)[-2] == (void*)VMTHook::GUARD;
|
||||
}
|
||||
|
||||
unsigned int hooks::CountMethods(void** vmt) {
|
||||
unsigned int i = -1;
|
||||
do ++i; while (vmt[i]);
|
||||
@ -61,6 +67,7 @@ void hooks::VMTHook::Apply() {
|
||||
}
|
||||
|
||||
// TODO rename these
|
||||
hooks::VMTHook* hooks::hkCreateMove = 0;
|
||||
hooks::VMTHook* hooks::hkPaintTraverse = 0;
|
||||
|
||||
hooks::VMTHook* hooks::hkClientMode = 0;
|
||||
hooks::VMTHook* hooks::hkPanel = 0;
|
||||
hooks::VMTHook* hooks::hkClient = 0;
|
||||
hooks::VMTHook* hooks::hkNetChannel = 0;
|
||||
|
@ -15,6 +15,7 @@ namespace hooks {
|
||||
|
||||
unsigned int CountMethods(void** vmt);
|
||||
void**& GetVMT(void* inst, unsigned int offset);
|
||||
bool IsHooked(void* inst);
|
||||
|
||||
class VMTHook {
|
||||
public:
|
||||
@ -30,12 +31,16 @@ protected:
|
||||
void **array;
|
||||
};
|
||||
|
||||
extern VMTHook* hkPaintTraverse;
|
||||
extern VMTHook* hkCreateMove;
|
||||
extern VMTHook* hkPanel;
|
||||
extern VMTHook* hkClientMode;
|
||||
extern VMTHook* hkClient;
|
||||
extern VMTHook* hkNetChannel;
|
||||
|
||||
extern unsigned int offPaintTraverse;
|
||||
extern unsigned int offCreateMove;
|
||||
extern unsigned int offOverrideView;
|
||||
extern unsigned int offFrameStageNotify;
|
||||
extern unsigned int offCanPacket;
|
||||
|
||||
}
|
||||
|
||||
|
54
uran/src/netmessage.cpp
Normal file
54
uran/src/netmessage.cpp
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* netmessage.cpp
|
||||
*
|
||||
* Created on: Dec 3, 2016
|
||||
* Author: nullifiedcat
|
||||
*/
|
||||
|
||||
#include "netmessage.h"
|
||||
|
||||
bool NET_SetConVar::WriteToBuffer( bf_write &buffer )
|
||||
{
|
||||
buffer.WriteUBitLong( GetType(), 5 );
|
||||
|
||||
int numvars = m_ConVars.Count();
|
||||
|
||||
// Note how many we're sending
|
||||
buffer.WriteByte( numvars );
|
||||
|
||||
for (int i=0; i< numvars; i++ )
|
||||
{
|
||||
cvar_t * cvar = &m_ConVars[i];
|
||||
buffer.WriteString( cvar->name );
|
||||
buffer.WriteString( cvar->value );
|
||||
}
|
||||
|
||||
return !buffer.IsOverflowed();
|
||||
}
|
||||
|
||||
bool NET_SetConVar::ReadFromBuffer( bf_read &buffer )
|
||||
{
|
||||
int numvars = buffer.ReadByte();
|
||||
|
||||
m_ConVars.RemoveAll();
|
||||
|
||||
for (int i=0; i< numvars; i++ )
|
||||
{
|
||||
cvar_t cvar;
|
||||
buffer.ReadString( cvar.name, sizeof(cvar.name) );
|
||||
buffer.ReadString( cvar.value, sizeof(cvar.value) );
|
||||
m_ConVars.AddToTail( cvar );
|
||||
|
||||
}
|
||||
return !buffer.IsOverflowed();
|
||||
}
|
||||
|
||||
const char *NET_SetConVar::ToString(void) const
|
||||
{
|
||||
/*snprintf(s_text, sizeof(s_text), "%s: %i cvars, \"%s\"=\"%s\"",
|
||||
GetName(), m_ConVars.Count(),
|
||||
m_ConVars[0].name, m_ConVars[0].value );
|
||||
return s_text;*/
|
||||
return "(NULL)";
|
||||
}
|
||||
|
96
uran/src/netmessage.h
Normal file
96
uran/src/netmessage.h
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* netmessage.h
|
||||
*
|
||||
* Created on: Dec 3, 2016
|
||||
* Author: nullifiedcat
|
||||
*/
|
||||
|
||||
#ifndef NETMESSAGE_H_
|
||||
#define NETMESSAGE_H_
|
||||
|
||||
#include "fixsdk.h"
|
||||
#include <bitbuf.h>
|
||||
#include <utlvector.h>
|
||||
#include <inetchannel.h>
|
||||
#include <inetmessage.h>
|
||||
#include <inetmsghandler.h>
|
||||
|
||||
#define DECLARE_BASE_MESSAGE( msgtype ) \
|
||||
public: \
|
||||
bool ReadFromBuffer( bf_read &buffer ); \
|
||||
bool WriteToBuffer( bf_write &buffer ); \
|
||||
const char *ToString() const; \
|
||||
int GetType() const { return msgtype; } \
|
||||
const char *GetName() const { return #msgtype;}\
|
||||
|
||||
#define DECLARE_NET_MESSAGE( name ) \
|
||||
DECLARE_BASE_MESSAGE( net_##name ); \
|
||||
INetMessageHandler *m_pMessageHandler; \
|
||||
bool Process() { return false; }\
|
||||
|
||||
#define DECLARE_SVC_MESSAGE( name ) \
|
||||
DECLARE_BASE_MESSAGE( svc_##name ); \
|
||||
IServerMessageHandler *m_pMessageHandler;\
|
||||
bool Process() { return m_pMessageHandler->Process##name( this ); }\
|
||||
|
||||
#define DECLARE_CLC_MESSAGE( name ) \
|
||||
DECLARE_BASE_MESSAGE( clc_##name ); \
|
||||
IClientMessageHandler *m_pMessageHandler;\
|
||||
bool Process() { return m_pMessageHandler->Process##name( this ); }\
|
||||
|
||||
#define DECLARE_MM_MESSAGE( name ) \
|
||||
DECLARE_BASE_MESSAGE( mm_##name ); \
|
||||
IMatchmakingMessageHandler *m_pMessageHandler;\
|
||||
bool Process() { return m_pMessageHandler->Process##name( this ); }\
|
||||
|
||||
class CNetMessage : public INetMessage
|
||||
{
|
||||
public:
|
||||
CNetMessage() { m_bReliable = true;
|
||||
m_NetChannel = 0; }
|
||||
|
||||
virtual ~CNetMessage() {};
|
||||
|
||||
virtual int GetGroup() const { return INetChannelInfo::GENERIC; }
|
||||
INetChannel *GetNetChannel() const { return m_NetChannel; }
|
||||
|
||||
virtual void SetReliable( bool state) {m_bReliable = state;};
|
||||
virtual bool IsReliable() const { return m_bReliable; };
|
||||
virtual void SetNetChannel(INetChannel * netchan) { m_NetChannel = netchan; }
|
||||
virtual bool Process() { return false; }; // no handler set
|
||||
|
||||
protected:
|
||||
bool m_bReliable; // true if message should be send reliable
|
||||
INetChannel *m_NetChannel; // netchannel this message is from/for
|
||||
};
|
||||
|
||||
#define net_SetConVar 5
|
||||
#define MAX_OSPATH 256
|
||||
|
||||
class NET_SetConVar : public CNetMessage
|
||||
{
|
||||
DECLARE_NET_MESSAGE( SetConVar );
|
||||
|
||||
int GetGroup() const { return INetChannelInfo::STRINGCMD; }
|
||||
|
||||
NET_SetConVar() {}
|
||||
NET_SetConVar( const char * name, const char * value)
|
||||
{
|
||||
cvar_t cvar;
|
||||
strncpy( cvar.name, name, MAX_OSPATH );
|
||||
strncpy( cvar.value, value, MAX_OSPATH );
|
||||
m_ConVars.AddToTail( cvar );
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
typedef struct cvar_s
|
||||
{
|
||||
char name[MAX_OSPATH];
|
||||
char value[MAX_OSPATH];
|
||||
} cvar_t;
|
||||
|
||||
CUtlVector<cvar_t> m_ConVars;
|
||||
};
|
||||
|
||||
#endif /* NETMESSAGE_H_ */
|
Reference in New Issue
Block a user