diff --git a/include/hooks.hpp b/include/hooks.hpp old mode 100755 new mode 100644 index 286aa2b1..ccbe0b17 --- a/include/hooks.hpp +++ b/include/hooks.hpp @@ -37,10 +37,10 @@ public: ~VMTHook(); void Set(ptr_t inst, uint32_t offset = 0); void Release(); - template + template 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 *GetMethod(uint32_t idx) const; @@ -69,4 +69,5 @@ extern VMTHook steamfriends; extern VMTHook materialsystem; extern VMTHook enginevgui; extern VMTHook vstd; +extern VMTHook eventmanager2; } diff --git a/include/hooks/HookedMethods.hpp b/include/hooks/HookedMethods.hpp index 21ad0440..d48c41c2 100644 --- a/include/hooks/HookedMethods.hpp +++ b/include/hooks/HookedMethods.hpp @@ -4,7 +4,6 @@ Copyright (c) 2018 nullworks. All rights reserved. */ - #pragma once #include "common.hpp" @@ -14,17 +13,27 @@ union SDL_Event; struct SDL_Window; #endif -#define DECLARE_HOOKED_METHOD(name, rtype, ...) \ - namespace types { using name = rtype(*)(__VA_ARGS__); } \ - namespace methods { rtype name(__VA_ARGS__); } \ - namespace original { extern types::name name; } +#define DECLARE_HOOKED_METHOD(name, rtype, ...) \ + namespace types \ + { \ + using name = rtype (*)(__VA_ARGS__); \ + } \ + namespace methods \ + { \ + rtype name(__VA_ARGS__); \ + } \ + namespace original \ + { \ + extern types::name name; \ + } -#define DEFINE_HOOKED_METHOD(name, rtype, ...) \ - types::name original::name{ nullptr }; \ +#define DEFINE_HOOKED_METHOD(name, rtype, ...) \ + types::name original::name{ nullptr }; \ rtype name(__VA_ARGS__) -#define HOOK_ARGS(name) \ - hooked_methods::methods::name, offsets::name(), &hooked_methods::original::name +#define HOOK_ARGS(name) \ + hooked_methods::methods::name, offsets::name(), \ + &hooked_methods::original::name namespace hooked_methods { @@ -36,40 +45,48 @@ DECLARE_HOOKED_METHOD(LevelShutdown, void, void *); DECLARE_HOOKED_METHOD(FireGameEvent, void, void *, IGameEvent *); // IBaseClient 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 DECLARE_HOOKED_METHOD(GetUserCmd, CUserCmd *, IInput *, int); // 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(Shutdown, void, INetChannel *, const char *); // ISteamFriends -DECLARE_HOOKED_METHOD(GetFriendPersonaName, const char *, ISteamFriends *, CSteamID); +DECLARE_HOOKED_METHOD(GetFriendPersonaName, const char *, ISteamFriends *, + CSteamID); // IEngineVGui 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 // ClientMode DECLARE_HOOKED_METHOD(OverrideView, void, void *, CViewSetup *); // IVModelRender -DECLARE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *, const DrawModelState_t &, -const ModelRenderInfo_t &, matrix3x4_t *); +DECLARE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *, + const DrawModelState_t &, const ModelRenderInfo_t &, + matrix3x4_t *); // IStudioRender DECLARE_HOOKED_METHOD(BeginFrame, void, IStudioRender *); // IBaseClient DECLARE_HOOKED_METHOD(FrameStageNotify, void, void *, ClientFrameStage_t); // 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 DECLARE_HOOKED_METHOD(SDL_GL_SwapWindow, void, SDL_Window *); DECLARE_HOOKED_METHOD(SDL_PollEvent, int, SDL_Event *); // IUniformRandomStream DECLARE_HOOKED_METHOD(RandomInt, int, IUniformRandomStream *, int, int); #endif - } - // TODO // wontfix.club #if 0 diff --git a/src/MiscTemporary.cpp b/src/MiscTemporary.cpp index b04eebc0..d8ab9f7c 100644 --- a/src/MiscTemporary.cpp +++ b/src/MiscTemporary.cpp @@ -6,7 +6,7 @@ #include "MiscTemporary.hpp" 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", "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 engine_pred(CV_SWITCH, "engine_prediction", "0", - "Engine Prediction"); +CatVar engine_pred(CV_SWITCH, "engine_prediction", "0", "Engine Prediction"); CatVar debug_projectiles(CV_SWITCH, "debug_projectiles", "0", - "Debug Projectiles"); + "Debug Projectiles"); CatVar fakelag_amount(CV_INT, "fakelag", "0", "Bad Fakelag"); CatVar serverlag_amount( - CV_INT, "serverlag", "0", "serverlag", - "Lag the server by spamming this many voicecommands per tick"); + CV_INT, "serverlag", "0", "serverlag", + "Lag the server by spamming this many voicecommands per tick"); CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto"); CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers", "Crash servers by spamming signon net messages"); diff --git a/src/hack.cpp b/src/hack.cpp index d45ff24a..e01bd4e8 100644 --- a/src/hack.cpp +++ b/src/hack.cpp @@ -288,12 +288,7 @@ free(logname);*/ InitNetVars(); g_pLocalPlayer = new LocalPlayer(); 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; // Bad way to get clientmode. // FIXME [MP]? @@ -315,19 +310,47 @@ free(logname);*/ hooks::clientmode4.Set((void *) (clientMode), 4); hooks::clientmode4.HookMethod(HOOK_ARGS(FireGameEvent)); hooks::clientmode4.Apply(); - hooks::client.Set(g_IBaseClient); + hooks::client.Set(g_IBaseClient); + hooks::client.HookMethod(HOOK_ARGS(DispatchUserMessage); #if ENABLE_VISUALS hooks::client.HookMethod(HOOK_ARGS(FrameStageNotify)); + hooks::client.HookMethod(HOOK_ARGS(IN_KeyEvent)); #endif - hooks::client.HookMethod(HOOK_ARGS(DispatchUserMessage); + hooks::client.Apply(); #if ENABLE_VISUALS hooks::vstd.Set((void *) g_pUniformStream); hooks::vstd.HookMethod(HOOK_ARGS(RandomInt)); 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 + 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 g_IMaterialSystem->SetInStubMode(true); IF_GAME(IsTF2()) @@ -350,38 +373,6 @@ free(logname);*/ // hooks::materialsystem.HookMethod(); } #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] hacks::shared::killsay::Init(); diff --git a/src/hacks/Killstreak.cpp b/src/hacks/Killstreak.cpp old mode 100755 new mode 100644 index bba4a810..0419f27b --- a/src/hacks/Killstreak.cpp +++ b/src/hacks/Killstreak.cpp @@ -137,11 +137,6 @@ bool FireEventClientSide(IGameEventManager2 *manager, IGameEvent *event) void init() { - hook.Set(g_IEventManager2, 0); - // hook.HookMethod(FireEvent_hook, offsets::FireEvent()); - hook.HookMethod((void *) FireEventClientSide, - offsets::FireEventClientSide()); - hook.Apply(); } } } diff --git a/src/hooks.cpp b/src/hooks.cpp index 6a4bac7c..058e06fa 100644 --- a/src/hooks.cpp +++ b/src/hooks.cpp @@ -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, vtable_original, GetMethod(idx), func); if (backup) - *backup = vtable_hooked[2 + idx]; + *backup = vtable_hooked[2 + idx]; vtable_hooked[2 + idx] = func; } @@ -109,4 +109,5 @@ VMTHook clientmode4{}; VMTHook materialsystem{}; VMTHook enginevgui{}; VMTHook vstd{}; +VMTHook eventmanager2{}; } diff --git a/src/hooks/CanPacket.cpp b/src/hooks/CanPacket.cpp index 868fb75d..a9a8f529 100644 --- a/src/hooks/CanPacket.cpp +++ b/src/hooks/CanPacket.cpp @@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(CanPacket, bool, INetChannel *this_) { return original::CanPacket(this_); } - } diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 4fc3d73b..5e9be36d 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -15,11 +15,11 @@ 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); } - } class CMoveData; @@ -107,7 +107,6 @@ void End() { }*/ } - bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd) { uintptr_t **fp; diff --git a/src/hooks/DispatchUserMessage.cpp b/src/hooks/DispatchUserMessage.cpp index e80dfc86..6791bc86 100644 --- a/src/hooks/DispatchUserMessage.cpp +++ b/src/hooks/DispatchUserMessage.cpp @@ -8,9 +8,9 @@ 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); } - } \ No newline at end of file diff --git a/src/hooks/FireEvent.cpp b/src/hooks/FireEvent.cpp new file mode 100644 index 00000000..73cf86e4 --- /dev/null +++ b/src/hooks/FireEvent.cpp @@ -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); +} +} \ No newline at end of file diff --git a/src/hooks/FireEventClientSide.cpp b/src/hooks/FireEventClientSide.cpp new file mode 100644 index 00000000..e7646693 --- /dev/null +++ b/src/hooks/FireEventClientSide.cpp @@ -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); +} +} \ No newline at end of file diff --git a/src/hooks/FireGameEvent.cpp b/src/hooks/FireGameEvent.cpp index 7d2ce057..e9366428 100644 --- a/src/hooks/FireGameEvent.cpp +++ b/src/hooks/FireGameEvent.cpp @@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(FireGameEvent, void, void *this_, IGameEvent *event) { return original::FireGameEvent(this_, event); } - } \ No newline at end of file diff --git a/src/hooks/GetFriendPersonaName.cpp b/src/hooks/GetFriendPersonaName.cpp index c373ab24..62f195c0 100644 --- a/src/hooks/GetFriendPersonaName.cpp +++ b/src/hooks/GetFriendPersonaName.cpp @@ -8,9 +8,9 @@ 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); } - } \ No newline at end of file diff --git a/src/hooks/GetUserCmd.cpp b/src/hooks/GetUserCmd.cpp index cbb7c4f3..6b5fb42d 100644 --- a/src/hooks/GetUserCmd.cpp +++ b/src/hooks/GetUserCmd.cpp @@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(GetUserCmd, CUserCmd *, IInput *this_, int sequence_number) { return original::GetUserCmd(this_, sequence_number); } - } \ No newline at end of file diff --git a/src/hooks/IN_KeyEvent.cpp b/src/hooks/IN_KeyEvent.cpp index fc8a11c8..924d6b3a 100644 --- a/src/hooks/IN_KeyEvent.cpp +++ b/src/hooks/IN_KeyEvent.cpp @@ -8,9 +8,9 @@ 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); } - } \ No newline at end of file diff --git a/src/hooks/LevelInit.cpp b/src/hooks/LevelInit.cpp index a84cc107..036ae46d 100644 --- a/src/hooks/LevelInit.cpp +++ b/src/hooks/LevelInit.cpp @@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name) { return original::LevelInit(this_, name); } - } \ No newline at end of file diff --git a/src/hooks/LevelShutdown.cpp b/src/hooks/LevelShutdown.cpp index c7278dcf..47c40630 100644 --- a/src/hooks/LevelShutdown.cpp +++ b/src/hooks/LevelShutdown.cpp @@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_) { return original::LevelShutdown(this_); } - } \ No newline at end of file diff --git a/src/hooks/Paint.cpp b/src/hooks/Paint.cpp old mode 100755 new mode 100644 index 107fd018..9b0835af --- a/src/hooks/Paint.cpp +++ b/src/hooks/Paint.cpp @@ -16,7 +16,6 @@ DEFINE_HOOKED_METHOD(Paint, void, IEngineVGui *this_, PaintMode_t mode) { return original::Paint(this_, mode); } - } static CatVar cursor_fix_experimental(CV_SWITCH, "experimental_cursor_fix", "1", diff --git a/src/hooks/SendNetMsg.cpp b/src/hooks/SendNetMsg.cpp index bd8c181a..6b20cd37 100644 --- a/src/hooks/SendNetMsg.cpp +++ b/src/hooks/SendNetMsg.cpp @@ -8,9 +8,9 @@ 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); } - } \ No newline at end of file diff --git a/src/hooks/Shutdown.cpp b/src/hooks/Shutdown.cpp index 4115dca0..91567046 100644 --- a/src/hooks/Shutdown.cpp +++ b/src/hooks/Shutdown.cpp @@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason) { return original::Shutdown(this_, reason); } - } \ No newline at end of file diff --git a/src/hooks/visual/BeginFrame.cpp b/src/hooks/visual/BeginFrame.cpp index 2029d4a1..48a53e12 100644 --- a/src/hooks/visual/BeginFrame.cpp +++ b/src/hooks/visual/BeginFrame.cpp @@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(BeginFrame, void, IStudioRender *this_) { return original::BeginFrame(this_); } - } \ No newline at end of file diff --git a/src/hooks/visual/DrawModelExecute.cpp b/src/hooks/visual/DrawModelExecute.cpp index 30712bee..a61ed269 100644 --- a/src/hooks/visual/DrawModelExecute.cpp +++ b/src/hooks/visual/DrawModelExecute.cpp @@ -8,10 +8,10 @@ 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) { return original::DrawModelExecute(this_, state, info, bone); } - } \ No newline at end of file diff --git a/src/hooks/visual/FrameStageNotify.cpp b/src/hooks/visual/FrameStageNotify.cpp index fdd3e5b3..523e96b1 100644 --- a/src/hooks/visual/FrameStageNotify.cpp +++ b/src/hooks/visual/FrameStageNotify.cpp @@ -8,9 +8,9 @@ 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); } - } \ No newline at end of file diff --git a/src/hooks/visual/OverrideView.cpp b/src/hooks/visual/OverrideView.cpp index 030ad0a5..75923128 100644 --- a/src/hooks/visual/OverrideView.cpp +++ b/src/hooks/visual/OverrideView.cpp @@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(OverrideView, void, void *this_, CViewSetup *setup) { return original::OverrideView(this_, setup); } - } \ No newline at end of file diff --git a/src/hooks/visual/PaintTraverse.cpp b/src/hooks/visual/PaintTraverse.cpp index 45d59134..58fe2708 100644 --- a/src/hooks/visual/PaintTraverse.cpp +++ b/src/hooks/visual/PaintTraverse.cpp @@ -8,9 +8,9 @@ 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); } - } \ No newline at end of file diff --git a/src/hooks/visual/RandomInt.cpp b/src/hooks/visual/RandomInt.cpp index 8a18d8a7..49bb186a 100644 --- a/src/hooks/visual/RandomInt.cpp +++ b/src/hooks/visual/RandomInt.cpp @@ -8,9 +8,9 @@ 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); } - } \ No newline at end of file diff --git a/src/hooks/visual/SDL_GL_SwapWindow.cpp b/src/hooks/visual/SDL_GL_SwapWindow.cpp index 145023a3..38220e99 100644 --- a/src/hooks/visual/SDL_GL_SwapWindow.cpp +++ b/src/hooks/visual/SDL_GL_SwapWindow.cpp @@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(SDL_GL_SwapWindow, void, SDL_Window *window) { return original::SDL_GL_SwapWindow(window); } - } \ No newline at end of file diff --git a/src/hooks/visual/SDL_PollEvent.cpp b/src/hooks/visual/SDL_PollEvent.cpp index 75d3cef6..1dd95b8b 100644 --- a/src/hooks/visual/SDL_PollEvent.cpp +++ b/src/hooks/visual/SDL_PollEvent.cpp @@ -12,5 +12,4 @@ DEFINE_HOOKED_METHOD(SDL_PollEvent, int, SDL_Event *event) { return original::SDL_PollEvent(event); } - } \ No newline at end of file diff --git a/src/ipc.cpp b/src/ipc.cpp old mode 100755 new mode 100644 index c89abf2f..72cd6953 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -261,8 +261,8 @@ void StoreClientData() user_data_s &data = peer->memory->peer_user_data[peer->client_id]; data.friendid = g_ISteamUser->GetSteamID().GetAccountID(); data.ts_injected = time_injected; - strncpy(data.name, hooked_methods::methods::GetFriendPersonaName(g_ISteamFriends, - g_ISteamUser->GetSteamID()), + strncpy(data.name, hooked_methods::methods::GetFriendPersonaName( + g_ISteamFriends, g_ISteamUser->GetSteamID()), sizeof(data.name)); } diff --git a/src/reclasses/CTFPartyClient.cpp b/src/reclasses/CTFPartyClient.cpp index 4078e5fd..951bdac3 100644 --- a/src/reclasses/CTFPartyClient.cpp +++ b/src/reclasses/CTFPartyClient.cpp @@ -46,8 +46,8 @@ re::CTFPartyClient::MutLocalGroupCriteria(re::CTFPartyClient *client) { typedef re::ITFGroupMatchCriteria *(*MutLocalGroupCriteria_t)( re::CTFPartyClient *); - static uintptr_t addr = gSignatures.GetClientSignature( - "55 89 E5 8B 45 ? 8B 50 ? C6 80"); + static uintptr_t addr = + gSignatures.GetClientSignature("55 89 E5 8B 45 ? 8B 50 ? C6 80"); static MutLocalGroupCriteria_t MutLocalGroupCriteria_fn = MutLocalGroupCriteria_t(addr);