From ed62d9669095b9b2eb48d9b7a24cb898c7228b5c Mon Sep 17 00:00:00 2001 From: zweej <73849614+zweeej@users.noreply.github.com> Date: Mon, 16 Aug 2021 02:01:21 +0200 Subject: [PATCH] SetSlowMotion Fix #2 --- src/Components/Modules/Slowmotion.cpp | 37 ++++++++++++++++++--------- src/Components/Modules/Slowmotion.hpp | 5 ++-- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/src/Components/Modules/Slowmotion.cpp b/src/Components/Modules/Slowmotion.cpp index 026340b7..096459c1 100644 --- a/src/Components/Modules/Slowmotion.cpp +++ b/src/Components/Modules/Slowmotion.cpp @@ -3,22 +3,35 @@ namespace Components { int SlowMotion::Delay = 0; - DWORD applySlowMotionHookLoc = 0x60B2D0; - void SlowMotion::ApplySlowMotionStub(int timePassed) + void SlowMotion::ApplySlowMotion(int timePassed) { if (SlowMotion::Delay <= 0) { - __asm - { - push timePassed - call applySlowMotionHookLoc - add esp, 4h - } + Utils::Hook::Call(0x60B2D0)(timePassed); } else + { SlowMotion::Delay -= timePassed; + } } + + __declspec(naked) void SlowMotion::ApplySlowMotionStub() + { + __asm + { + pushad + push[esp + 18h] + + call SlowMotion::ApplySlowMotion + + add esp, 4 + popad + + retn + } + } + void SlowMotion::SetSlowMotion() { int duration = 1000; @@ -63,10 +76,10 @@ namespace Components void SlowMotion::DrawConnectionInterruptedStub(int /*a1*/) { -// if (!*reinterpret_cast(0x1AD8ED0) && !*reinterpret_cast(0x1AD8EEC) && !*reinterpret_cast(0x1AD78F8)) -// { -// Utils::Hook::Call(0x454A70)(a1); -// } + // if (!*reinterpret_cast(0x1AD8ED0) && !*reinterpret_cast(0x1AD8EEC) && !*reinterpret_cast(0x1AD78F8)) + // { + // Utils::Hook::Call(0x454A70)(a1); + // } } SlowMotion::SlowMotion() diff --git a/src/Components/Modules/Slowmotion.hpp b/src/Components/Modules/Slowmotion.hpp index faad9843..9e90b090 100644 --- a/src/Components/Modules/Slowmotion.hpp +++ b/src/Components/Modules/Slowmotion.hpp @@ -14,8 +14,9 @@ namespace Components static int Delay; static void SetSlowMotion(); - static void ApplySlowMotionStub(int timePassed); + static void ApplySlowMotion(int timePassed); + static void ApplySlowMotionStub(); static void DrawConnectionInterruptedStub(int a1); }; -} \ No newline at end of file +}