format + 2 more hooks
This commit is contained in:
parent
6303ca8b6b
commit
9285fdc28e
5
include/hooks.hpp
Executable file → Normal file
5
include/hooks.hpp
Executable file → Normal file
@ -37,10 +37,10 @@ public:
|
|||||||
~VMTHook();
|
~VMTHook();
|
||||||
void Set(ptr_t inst, uint32_t offset = 0);
|
void Set(ptr_t inst, uint32_t offset = 0);
|
||||||
void Release();
|
void Release();
|
||||||
template<typename T>
|
template <typename T>
|
||||||
inline void HookMethod(T func, uint32_t idx, T *backup)
|
inline void HookMethod(T func, uint32_t idx, T *backup)
|
||||||
{
|
{
|
||||||
HookMethod(ptr_t(func), idx, (ptr_t *)(backup));
|
HookMethod(ptr_t(func), idx, (ptr_t *) (backup));
|
||||||
}
|
}
|
||||||
void HookMethod(ptr_t func, uint32_t idx, ptr_t *backup);
|
void HookMethod(ptr_t func, uint32_t idx, ptr_t *backup);
|
||||||
void *GetMethod(uint32_t idx) const;
|
void *GetMethod(uint32_t idx) const;
|
||||||
@ -69,4 +69,5 @@ extern VMTHook steamfriends;
|
|||||||
extern VMTHook materialsystem;
|
extern VMTHook materialsystem;
|
||||||
extern VMTHook enginevgui;
|
extern VMTHook enginevgui;
|
||||||
extern VMTHook vstd;
|
extern VMTHook vstd;
|
||||||
|
extern VMTHook eventmanager2;
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
Copyright (c) 2018 nullworks. All rights reserved.
|
Copyright (c) 2018 nullworks. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
@ -14,17 +13,27 @@ union SDL_Event;
|
|||||||
struct SDL_Window;
|
struct SDL_Window;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DECLARE_HOOKED_METHOD(name, rtype, ...) \
|
#define DECLARE_HOOKED_METHOD(name, rtype, ...) \
|
||||||
namespace types { using name = rtype(*)(__VA_ARGS__); } \
|
namespace types \
|
||||||
namespace methods { rtype name(__VA_ARGS__); } \
|
{ \
|
||||||
namespace original { extern types::name name; }
|
using name = rtype (*)(__VA_ARGS__); \
|
||||||
|
} \
|
||||||
|
namespace methods \
|
||||||
|
{ \
|
||||||
|
rtype name(__VA_ARGS__); \
|
||||||
|
} \
|
||||||
|
namespace original \
|
||||||
|
{ \
|
||||||
|
extern types::name name; \
|
||||||
|
}
|
||||||
|
|
||||||
#define DEFINE_HOOKED_METHOD(name, rtype, ...) \
|
#define DEFINE_HOOKED_METHOD(name, rtype, ...) \
|
||||||
types::name original::name{ nullptr }; \
|
types::name original::name{ nullptr }; \
|
||||||
rtype name(__VA_ARGS__)
|
rtype name(__VA_ARGS__)
|
||||||
|
|
||||||
#define HOOK_ARGS(name) \
|
#define HOOK_ARGS(name) \
|
||||||
hooked_methods::methods::name, offsets::name(), &hooked_methods::original::name
|
hooked_methods::methods::name, offsets::name(), \
|
||||||
|
&hooked_methods::original::name
|
||||||
|
|
||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
@ -36,40 +45,48 @@ DECLARE_HOOKED_METHOD(LevelShutdown, void, void *);
|
|||||||
DECLARE_HOOKED_METHOD(FireGameEvent, void, void *, IGameEvent *);
|
DECLARE_HOOKED_METHOD(FireGameEvent, void, void *, IGameEvent *);
|
||||||
// IBaseClient
|
// IBaseClient
|
||||||
DECLARE_HOOKED_METHOD(DispatchUserMessage, bool, void *, int, bf_read &);
|
DECLARE_HOOKED_METHOD(DispatchUserMessage, bool, void *, int, bf_read &);
|
||||||
DECLARE_HOOKED_METHOD(IN_KeyEvent, int, void *, int, ButtonCode_t, const char *);
|
DECLARE_HOOKED_METHOD(IN_KeyEvent, int, void *, int, ButtonCode_t,
|
||||||
|
const char *);
|
||||||
// IInput
|
// IInput
|
||||||
DECLARE_HOOKED_METHOD(GetUserCmd, CUserCmd *, IInput *, int);
|
DECLARE_HOOKED_METHOD(GetUserCmd, CUserCmd *, IInput *, int);
|
||||||
// INetChannel
|
// INetChannel
|
||||||
DECLARE_HOOKED_METHOD(SendNetMsg, bool, INetChannel *, INetMessage &, bool, bool);
|
DECLARE_HOOKED_METHOD(SendNetMsg, bool, INetChannel *, INetMessage &, bool,
|
||||||
|
bool);
|
||||||
DECLARE_HOOKED_METHOD(CanPacket, bool, INetChannel *);
|
DECLARE_HOOKED_METHOD(CanPacket, bool, INetChannel *);
|
||||||
DECLARE_HOOKED_METHOD(Shutdown, void, INetChannel *, const char *);
|
DECLARE_HOOKED_METHOD(Shutdown, void, INetChannel *, const char *);
|
||||||
// ISteamFriends
|
// ISteamFriends
|
||||||
DECLARE_HOOKED_METHOD(GetFriendPersonaName, const char *, ISteamFriends *, CSteamID);
|
DECLARE_HOOKED_METHOD(GetFriendPersonaName, const char *, ISteamFriends *,
|
||||||
|
CSteamID);
|
||||||
// IEngineVGui
|
// IEngineVGui
|
||||||
DECLARE_HOOKED_METHOD(Paint, void, IEngineVGui *, PaintMode_t);
|
DECLARE_HOOKED_METHOD(Paint, void, IEngineVGui *, PaintMode_t);
|
||||||
|
// IGameEventManager2
|
||||||
|
DECLARE_HOOKED_METHOD(FireEvent, bool, IGameEventManager2 *, IGameEvent *,
|
||||||
|
bool);
|
||||||
|
DECLARE_HOOKED_METHOD(FireEventClientSide, bool, IGameEventManager2 *,
|
||||||
|
IGameEvent *);
|
||||||
|
|
||||||
#if ENABLE_VISUALS
|
#if ENABLE_VISUALS
|
||||||
// ClientMode
|
// ClientMode
|
||||||
DECLARE_HOOKED_METHOD(OverrideView, void, void *, CViewSetup *);
|
DECLARE_HOOKED_METHOD(OverrideView, void, void *, CViewSetup *);
|
||||||
// IVModelRender
|
// IVModelRender
|
||||||
DECLARE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *, const DrawModelState_t &,
|
DECLARE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *,
|
||||||
const ModelRenderInfo_t &, matrix3x4_t *);
|
const DrawModelState_t &, const ModelRenderInfo_t &,
|
||||||
|
matrix3x4_t *);
|
||||||
// IStudioRender
|
// IStudioRender
|
||||||
DECLARE_HOOKED_METHOD(BeginFrame, void, IStudioRender *);
|
DECLARE_HOOKED_METHOD(BeginFrame, void, IStudioRender *);
|
||||||
// IBaseClient
|
// IBaseClient
|
||||||
DECLARE_HOOKED_METHOD(FrameStageNotify, void, void *, ClientFrameStage_t);
|
DECLARE_HOOKED_METHOD(FrameStageNotify, void, void *, ClientFrameStage_t);
|
||||||
// vgui::IPanel
|
// vgui::IPanel
|
||||||
DECLARE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *, unsigned int, bool, bool);
|
DECLARE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *, unsigned int, bool,
|
||||||
|
bool);
|
||||||
// SDL
|
// SDL
|
||||||
DECLARE_HOOKED_METHOD(SDL_GL_SwapWindow, void, SDL_Window *);
|
DECLARE_HOOKED_METHOD(SDL_GL_SwapWindow, void, SDL_Window *);
|
||||||
DECLARE_HOOKED_METHOD(SDL_PollEvent, int, SDL_Event *);
|
DECLARE_HOOKED_METHOD(SDL_PollEvent, int, SDL_Event *);
|
||||||
// IUniformRandomStream
|
// IUniformRandomStream
|
||||||
DECLARE_HOOKED_METHOD(RandomInt, int, IUniformRandomStream *, int, int);
|
DECLARE_HOOKED_METHOD(RandomInt, int, IUniformRandomStream *, int, int);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// wontfix.club
|
// wontfix.club
|
||||||
#if 0
|
#if 0
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include "MiscTemporary.hpp"
|
#include "MiscTemporary.hpp"
|
||||||
|
|
||||||
CatVar minigun_jump(CV_SWITCH, "minigun_jump", "0", "TF2C minigun jump",
|
CatVar minigun_jump(CV_SWITCH, "minigun_jump", "0", "TF2C minigun jump",
|
||||||
"Allows jumping while shooting with minigun");
|
"Allows jumping while shooting with minigun");
|
||||||
|
|
||||||
CatVar jointeam(CV_SWITCH, "fb_autoteam", "1",
|
CatVar jointeam(CV_SWITCH, "fb_autoteam", "1",
|
||||||
"Joins player team automatically (NYI)");
|
"Joins player team automatically (NYI)");
|
||||||
@ -15,15 +15,14 @@ CatVar joinclass(CV_STRING, "fb_autoclass", "spy",
|
|||||||
|
|
||||||
CatVar nolerp(CV_SWITCH, "nolerp", "0", "NoLerp mode (experimental)");
|
CatVar nolerp(CV_SWITCH, "nolerp", "0", "NoLerp mode (experimental)");
|
||||||
|
|
||||||
CatVar engine_pred(CV_SWITCH, "engine_prediction", "0",
|
CatVar engine_pred(CV_SWITCH, "engine_prediction", "0", "Engine Prediction");
|
||||||
"Engine Prediction");
|
|
||||||
CatVar debug_projectiles(CV_SWITCH, "debug_projectiles", "0",
|
CatVar debug_projectiles(CV_SWITCH, "debug_projectiles", "0",
|
||||||
"Debug Projectiles");
|
"Debug Projectiles");
|
||||||
|
|
||||||
CatVar fakelag_amount(CV_INT, "fakelag", "0", "Bad Fakelag");
|
CatVar fakelag_amount(CV_INT, "fakelag", "0", "Bad Fakelag");
|
||||||
CatVar serverlag_amount(
|
CatVar serverlag_amount(
|
||||||
CV_INT, "serverlag", "0", "serverlag",
|
CV_INT, "serverlag", "0", "serverlag",
|
||||||
"Lag the server by spamming this many voicecommands per tick");
|
"Lag the server by spamming this many voicecommands per tick");
|
||||||
CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto");
|
CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto");
|
||||||
CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers",
|
CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers",
|
||||||
"Crash servers by spamming signon net messages");
|
"Crash servers by spamming signon net messages");
|
||||||
|
71
src/hack.cpp
71
src/hack.cpp
@ -288,12 +288,7 @@ free(logname);*/
|
|||||||
InitNetVars();
|
InitNetVars();
|
||||||
g_pLocalPlayer = new LocalPlayer();
|
g_pLocalPlayer = new LocalPlayer();
|
||||||
g_pPlayerResource = new TFPlayerResource();
|
g_pPlayerResource = new TFPlayerResource();
|
||||||
#if ENABLE_VISUALS
|
|
||||||
hooks::panel.Set(g_IPanel);
|
|
||||||
hooks::panel.HookMethod(hooked_methods::methods::PaintTraverse,
|
|
||||||
offsets::PaintTraverse(), &hooked_methods::original::PaintTraverse);
|
|
||||||
hooks::panel.Apply();
|
|
||||||
#endif
|
|
||||||
uintptr_t *clientMode = 0;
|
uintptr_t *clientMode = 0;
|
||||||
// Bad way to get clientmode.
|
// Bad way to get clientmode.
|
||||||
// FIXME [MP]?
|
// FIXME [MP]?
|
||||||
@ -315,19 +310,47 @@ free(logname);*/
|
|||||||
hooks::clientmode4.Set((void *) (clientMode), 4);
|
hooks::clientmode4.Set((void *) (clientMode), 4);
|
||||||
hooks::clientmode4.HookMethod(HOOK_ARGS(FireGameEvent));
|
hooks::clientmode4.HookMethod(HOOK_ARGS(FireGameEvent));
|
||||||
hooks::clientmode4.Apply();
|
hooks::clientmode4.Apply();
|
||||||
hooks::client.Set(g_IBaseClient);
|
|
||||||
|
|
||||||
|
hooks::client.Set(g_IBaseClient);
|
||||||
|
hooks::client.HookMethod(HOOK_ARGS(DispatchUserMessage);
|
||||||
#if ENABLE_VISUALS
|
#if ENABLE_VISUALS
|
||||||
hooks::client.HookMethod(HOOK_ARGS(FrameStageNotify));
|
hooks::client.HookMethod(HOOK_ARGS(FrameStageNotify));
|
||||||
|
hooks::client.HookMethod(HOOK_ARGS(IN_KeyEvent));
|
||||||
#endif
|
#endif
|
||||||
hooks::client.HookMethod(HOOK_ARGS(DispatchUserMessage);
|
hooks::client.Apply();
|
||||||
|
|
||||||
#if ENABLE_VISUALS
|
#if ENABLE_VISUALS
|
||||||
hooks::vstd.Set((void *) g_pUniformStream);
|
hooks::vstd.Set((void *) g_pUniformStream);
|
||||||
hooks::vstd.HookMethod(HOOK_ARGS(RandomInt));
|
hooks::vstd.HookMethod(HOOK_ARGS(RandomInt));
|
||||||
hooks::vstd.Apply();
|
hooks::vstd.Apply();
|
||||||
|
|
||||||
|
hooks::panel.Set(g_IPanel);
|
||||||
|
hooks::panel.HookMethod(hooked_methods::methods::PaintTraverse,
|
||||||
|
offsets::PaintTraverse(), &hooked_methods::original::PaintTraverse);
|
||||||
|
hooks::panel.Apply();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
hooks::input.Set(g_IInput);
|
||||||
|
hooks::input.HookMethod(HOOK_ARGS(GetUserCmd));
|
||||||
|
hooks::input.Apply();
|
||||||
|
#if ENABLE_VISUALS
|
||||||
|
hooks::modelrender.Set(g_IVModelRender);
|
||||||
|
hooks::modelrender.HookMethod(HOOK_ARGS(DrawModelExecute));
|
||||||
|
hooks::modelrender.Apply();
|
||||||
|
#endif
|
||||||
|
hooks::enginevgui.Set(g_IEngineVGui);
|
||||||
|
hooks::enginevgui.HookMethod(HOOK_ARGS(Paint));
|
||||||
|
hooks::enginevgui.Apply();
|
||||||
|
|
||||||
|
hooks::eventmanager2.Set(g_IEventManager2);
|
||||||
|
hooks::eventmanager2.HookMethod(HOOK_ARGS(FireEvent));
|
||||||
|
hooks::eventmanager2.HookMethod(HOOK_ARGS(FireEventClientSide));
|
||||||
|
hooks::eventmanager2.Apply();
|
||||||
|
|
||||||
|
hooks::steamfriends.Set(g_ISteamFriends);
|
||||||
|
hooks::steamfriends.HookMethod(HOOK_ARGS(GetFriendPersonaName));
|
||||||
|
hooks::steamfriends.Apply();
|
||||||
|
|
||||||
#if ENABLE_NULL_GRAPHICS
|
#if ENABLE_NULL_GRAPHICS
|
||||||
g_IMaterialSystem->SetInStubMode(true);
|
g_IMaterialSystem->SetInStubMode(true);
|
||||||
IF_GAME(IsTF2())
|
IF_GAME(IsTF2())
|
||||||
@ -350,38 +373,6 @@ free(logname);*/
|
|||||||
// hooks::materialsystem.HookMethod();
|
// hooks::materialsystem.HookMethod();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if ENABLE_VISUALS
|
|
||||||
hooks::client.HookMethod(HOOK_ARGS(IN_KeyEvent));
|
|
||||||
#endif
|
|
||||||
hooks::client.Apply();
|
|
||||||
hooks::input.Set(g_IInput);
|
|
||||||
hooks::input.HookMethod(HOOK_ARGS(GetUserCmd));
|
|
||||||
hooks::input.Apply();
|
|
||||||
#ifndef HOOK_DME_DISABLED
|
|
||||||
#if ENABLE_VISUALS
|
|
||||||
hooks::modelrender.Set(g_IVModelRender);
|
|
||||||
hooks::modelrender.HookMethod(HOOK_ARGS(DrawModelExecute));
|
|
||||||
hooks::modelrender.Apply();
|
|
||||||
hooks::enginevgui.Set(g_IEngineVGui);
|
|
||||||
hooks::enginevgui.HookMethod(HOOK_ARGS(Paint));
|
|
||||||
hooks::enginevgui.Apply();
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
hooks::steamfriends.Set(g_ISteamFriends);
|
|
||||||
hooks::steamfriends.HookMethod(HOOK_ARGS(GetFriendPersonaName));
|
|
||||||
hooks::steamfriends.Apply();
|
|
||||||
// logging::Info("After hacking: %s", g_ISteamFriends->GetPersonaName());
|
|
||||||
// Sadly, it doesn't work as expected :(
|
|
||||||
/*hooks::hkBaseClientState = new hooks::VMTHook();
|
|
||||||
hooks::hkBaseClientState->Init((void*)g_IBaseClientState, 0);
|
|
||||||
hooks::hkBaseClientState->HookMethod((void*)GetClientName_hook,
|
|
||||||
hooks::offGetClientName); hooks::hkBaseClientState->Apply();*/
|
|
||||||
// hooks::hkBaseClientState8 = new hooks::VMTHook();
|
|
||||||
// hooks::hkBaseClientState8->Init((void*)g_IBaseClientState, 8);
|
|
||||||
// hooks::hkBaseClientState8->HookMethod((void*)ProcessSetConVar_hook,
|
|
||||||
// hooks::offProcessSetConVar);
|
|
||||||
// hooks::hkBaseClientState8->HookMethod((void*)ProcessGetCvarValue_hook,
|
|
||||||
// hooks::offProcessGetCvarValue); hooks::hkBaseClientState8->Apply();
|
|
||||||
|
|
||||||
// FIXME [MP]
|
// FIXME [MP]
|
||||||
hacks::shared::killsay::Init();
|
hacks::shared::killsay::Init();
|
||||||
|
5
src/hacks/Killstreak.cpp
Executable file → Normal file
5
src/hacks/Killstreak.cpp
Executable file → Normal file
@ -137,11 +137,6 @@ bool FireEventClientSide(IGameEventManager2 *manager, IGameEvent *event)
|
|||||||
|
|
||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
hook.Set(g_IEventManager2, 0);
|
|
||||||
// hook.HookMethod(FireEvent_hook, offsets::FireEvent());
|
|
||||||
hook.HookMethod((void *) FireEventClientSide,
|
|
||||||
offsets::FireEventClientSide());
|
|
||||||
hook.Apply();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ void VMTHook::HookMethod(ptr_t func, uint32_t idx, ptr_t *backup)
|
|||||||
"Hooking method %d of vtable 0x%08x, replacing 0x%08x with 0x%08x", idx,
|
"Hooking method %d of vtable 0x%08x, replacing 0x%08x with 0x%08x", idx,
|
||||||
vtable_original, GetMethod(idx), func);
|
vtable_original, GetMethod(idx), func);
|
||||||
if (backup)
|
if (backup)
|
||||||
*backup = vtable_hooked[2 + idx];
|
*backup = vtable_hooked[2 + idx];
|
||||||
vtable_hooked[2 + idx] = func;
|
vtable_hooked[2 + idx] = func;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,4 +109,5 @@ VMTHook clientmode4{};
|
|||||||
VMTHook materialsystem{};
|
VMTHook materialsystem{};
|
||||||
VMTHook enginevgui{};
|
VMTHook enginevgui{};
|
||||||
VMTHook vstd{};
|
VMTHook vstd{};
|
||||||
|
VMTHook eventmanager2{};
|
||||||
}
|
}
|
||||||
|
@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(CanPacket, bool, INetChannel *this_)
|
|||||||
{
|
{
|
||||||
return original::CanPacket(this_);
|
return original::CanPacket(this_);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,11 +15,11 @@
|
|||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUserCmd *cmd)
|
DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
||||||
|
CUserCmd *cmd)
|
||||||
{
|
{
|
||||||
return original::CreateMove(this_, input_sample_time, cmd);
|
return original::CreateMove(this_, input_sample_time, cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class CMoveData;
|
class CMoveData;
|
||||||
@ -107,7 +107,6 @@ void End() {
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd)
|
bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd)
|
||||||
{
|
{
|
||||||
uintptr_t **fp;
|
uintptr_t **fp;
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void * this_, int type, bf_read &buffer)
|
DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type,
|
||||||
|
bf_read &buffer)
|
||||||
{
|
{
|
||||||
return original::DispatchUserMessage(this_, type, buffer);
|
return original::DispatchUserMessage(this_, type, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
16
src/hooks/FireEvent.cpp
Normal file
16
src/hooks/FireEvent.cpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
Created by Jenny White on 29.04.18.
|
||||||
|
Copyright (c) 2018 nullworks. All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "HookedMethods.hpp"
|
||||||
|
|
||||||
|
namespace hooked_methods
|
||||||
|
{
|
||||||
|
|
||||||
|
DEFINE_HOOKED_METHOD(FireEvent, bool, IGameEventManager2 *this_,
|
||||||
|
IGameEvent *event, bool no_broadcast)
|
||||||
|
{
|
||||||
|
return original::FireEvent(this_, event, no_broadcast);
|
||||||
|
}
|
||||||
|
}
|
16
src/hooks/FireEventClientSide.cpp
Normal file
16
src/hooks/FireEventClientSide.cpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
Created by Jenny White on 29.04.18.
|
||||||
|
Copyright (c) 2018 nullworks. All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "HookedMethods.hpp"
|
||||||
|
|
||||||
|
namespace hooked_methods
|
||||||
|
{
|
||||||
|
|
||||||
|
DEFINE_HOOKED_METHOD(FireEventClientSide, bool, IGameEventManager2 *this_,
|
||||||
|
IGameEvent *event)
|
||||||
|
{
|
||||||
|
return original::FireEventClientSide(this_, event);
|
||||||
|
}
|
||||||
|
}
|
@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(FireGameEvent, void, void *this_, IGameEvent *event)
|
|||||||
{
|
{
|
||||||
return original::FireGameEvent(this_, event);
|
return original::FireGameEvent(this_, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -8,9 +8,9 @@
|
|||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
DEFINE_HOOKED_METHOD(GetFriendPersonaName, const char *, ISteamFriends *this_, CSteamID steam_id)
|
DEFINE_HOOKED_METHOD(GetFriendPersonaName, const char *, ISteamFriends *this_,
|
||||||
|
CSteamID steam_id)
|
||||||
{
|
{
|
||||||
return original::GetFriendPersonaName(this_, steam_id);
|
return original::GetFriendPersonaName(this_, steam_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(GetUserCmd, CUserCmd *, IInput *this_, int sequence_number)
|
|||||||
{
|
{
|
||||||
return original::GetUserCmd(this_, sequence_number);
|
return original::GetUserCmd(this_, sequence_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -8,9 +8,9 @@
|
|||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
DEFINE_HOOKED_METHOD(IN_KeyEvent, int, void *this_, int eventcode, ButtonCode_t keynum, const char *binding)
|
DEFINE_HOOKED_METHOD(IN_KeyEvent, int, void *this_, int eventcode,
|
||||||
|
ButtonCode_t keynum, const char *binding)
|
||||||
{
|
{
|
||||||
return original::IN_KeyEvent(this_, eventcode, keynum, binding);
|
return original::IN_KeyEvent(this_, eventcode, keynum, binding);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
|
|||||||
{
|
{
|
||||||
return original::LevelInit(this_, name);
|
return original::LevelInit(this_, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_)
|
|||||||
{
|
{
|
||||||
return original::LevelShutdown(this_);
|
return original::LevelShutdown(this_);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
1
src/hooks/Paint.cpp
Executable file → Normal file
1
src/hooks/Paint.cpp
Executable file → Normal file
@ -16,7 +16,6 @@ DEFINE_HOOKED_METHOD(Paint, void, IEngineVGui *this_, PaintMode_t mode)
|
|||||||
{
|
{
|
||||||
return original::Paint(this_, mode);
|
return original::Paint(this_, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static CatVar cursor_fix_experimental(CV_SWITCH, "experimental_cursor_fix", "1",
|
static CatVar cursor_fix_experimental(CV_SWITCH, "experimental_cursor_fix", "1",
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
DEFINE_HOOKED_METHOD(SendNetMsg, bool, INetChannel *this_, INetMessage &message, bool force_reliable, bool voice)
|
DEFINE_HOOKED_METHOD(SendNetMsg, bool, INetChannel *this_, INetMessage &message,
|
||||||
|
bool force_reliable, bool voice)
|
||||||
{
|
{
|
||||||
return original::SendNetMsg(this_, message, force_reliable, voice);
|
return original::SendNetMsg(this_, message, force_reliable, voice);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
|
|||||||
{
|
{
|
||||||
return original::Shutdown(this_, reason);
|
return original::Shutdown(this_, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(BeginFrame, void, IStudioRender *this_)
|
|||||||
{
|
{
|
||||||
return original::BeginFrame(this_);
|
return original::BeginFrame(this_);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -8,10 +8,10 @@
|
|||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
DEFINE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *this_, const DrawModelState_t &state,
|
DEFINE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *this_,
|
||||||
|
const DrawModelState_t &state,
|
||||||
const ModelRenderInfo_t &info, matrix3x4_t *bone)
|
const ModelRenderInfo_t &info, matrix3x4_t *bone)
|
||||||
{
|
{
|
||||||
return original::DrawModelExecute(this_, state, info, bone);
|
return original::DrawModelExecute(this_, state, info, bone);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -8,9 +8,9 @@
|
|||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
DEFINE_HOOKED_METHOD(FrameStageNotify, void, void *this_, ClientFrameStage_t stage)
|
DEFINE_HOOKED_METHOD(FrameStageNotify, void, void *this_,
|
||||||
|
ClientFrameStage_t stage)
|
||||||
{
|
{
|
||||||
return original::FrameStageNotify(this_, stage);
|
return original::FrameStageNotify(this_, stage);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(OverrideView, void, void *this_, CViewSetup *setup)
|
|||||||
{
|
{
|
||||||
return original::OverrideView(this_, setup);
|
return original::OverrideView(this_, setup);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -8,9 +8,9 @@
|
|||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_, unsigned int panel, bool force, bool allow_force)
|
DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_,
|
||||||
|
unsigned int panel, bool force, bool allow_force)
|
||||||
{
|
{
|
||||||
return original::PaintTraverse(this_, panel, force, allow_force);
|
return original::PaintTraverse(this_, panel, force, allow_force);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -8,9 +8,9 @@
|
|||||||
namespace hooked_methods
|
namespace hooked_methods
|
||||||
{
|
{
|
||||||
|
|
||||||
DEFINE_HOOKED_METHOD(RandomInt, int, IUniformRandomStream *this_, int min, int max)
|
DEFINE_HOOKED_METHOD(RandomInt, int, IUniformRandomStream *this_, int min,
|
||||||
|
int max)
|
||||||
{
|
{
|
||||||
return original::RandomInt(this_, min, max);
|
return original::RandomInt(this_, min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(SDL_GL_SwapWindow, void, SDL_Window *window)
|
|||||||
{
|
{
|
||||||
return original::SDL_GL_SwapWindow(window);
|
return original::SDL_GL_SwapWindow(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(SDL_PollEvent, int, SDL_Event *event)
|
|||||||
{
|
{
|
||||||
return original::SDL_PollEvent(event);
|
return original::SDL_PollEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
4
src/ipc.cpp
Executable file → Normal file
4
src/ipc.cpp
Executable file → Normal file
@ -261,8 +261,8 @@ void StoreClientData()
|
|||||||
user_data_s &data = peer->memory->peer_user_data[peer->client_id];
|
user_data_s &data = peer->memory->peer_user_data[peer->client_id];
|
||||||
data.friendid = g_ISteamUser->GetSteamID().GetAccountID();
|
data.friendid = g_ISteamUser->GetSteamID().GetAccountID();
|
||||||
data.ts_injected = time_injected;
|
data.ts_injected = time_injected;
|
||||||
strncpy(data.name, hooked_methods::methods::GetFriendPersonaName(g_ISteamFriends,
|
strncpy(data.name, hooked_methods::methods::GetFriendPersonaName(
|
||||||
g_ISteamUser->GetSteamID()),
|
g_ISteamFriends, g_ISteamUser->GetSteamID()),
|
||||||
sizeof(data.name));
|
sizeof(data.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,8 +46,8 @@ re::CTFPartyClient::MutLocalGroupCriteria(re::CTFPartyClient *client)
|
|||||||
{
|
{
|
||||||
typedef re::ITFGroupMatchCriteria *(*MutLocalGroupCriteria_t)(
|
typedef re::ITFGroupMatchCriteria *(*MutLocalGroupCriteria_t)(
|
||||||
re::CTFPartyClient *);
|
re::CTFPartyClient *);
|
||||||
static uintptr_t addr = gSignatures.GetClientSignature(
|
static uintptr_t addr =
|
||||||
"55 89 E5 8B 45 ? 8B 50 ? C6 80");
|
gSignatures.GetClientSignature("55 89 E5 8B 45 ? 8B 50 ? C6 80");
|
||||||
static MutLocalGroupCriteria_t MutLocalGroupCriteria_fn =
|
static MutLocalGroupCriteria_t MutLocalGroupCriteria_fn =
|
||||||
MutLocalGroupCriteria_t(addr);
|
MutLocalGroupCriteria_t(addr);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user