From de0b8adc82cb1cf3f9979d888785bc248ff1ee14 Mon Sep 17 00:00:00 2001 From: zweej <73849614+zweeej@users.noreply.github.com> Date: Sun, 15 Aug 2021 00:10:42 +0200 Subject: [PATCH 1/2] slowmofix --- src/Components/Modules/Slowmotion.cpp | 31 ++++++++------------------- src/Components/Modules/Slowmotion.hpp | 5 ++--- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/src/Components/Modules/Slowmotion.cpp b/src/Components/Modules/Slowmotion.cpp index 7a1bce89..026340b7 100644 --- a/src/Components/Modules/Slowmotion.cpp +++ b/src/Components/Modules/Slowmotion.cpp @@ -3,35 +3,22 @@ namespace Components { int SlowMotion::Delay = 0; + DWORD applySlowMotionHookLoc = 0x60B2D0; - void SlowMotion::ApplySlowMotion(int timePassed) + void SlowMotion::ApplySlowMotionStub(int timePassed) { if (SlowMotion::Delay <= 0) { - Utils::Hook::Call(0x60B2D0)(timePassed); + __asm + { + push timePassed + call applySlowMotionHookLoc + add esp, 4h + } } else - { SlowMotion::Delay -= timePassed; - } } - - __declspec(naked) void SlowMotion::ApplySlowMotionStub() - { - __asm - { - pushad - push [esp + 20h] - - call SlowMotion::ApplySlowMotion - - pop ecx - popad - - retn - } - } - void SlowMotion::SetSlowMotion() { int duration = 1000; @@ -91,4 +78,4 @@ namespace Components Utils::Hook(0x4A54ED, SlowMotion::DrawConnectionInterruptedStub, HOOK_CALL).install()->quick(); Utils::Hook(0x4A54FB, SlowMotion::DrawConnectionInterruptedStub, HOOK_CALL).install()->quick(); } -} +} \ No newline at end of file diff --git a/src/Components/Modules/Slowmotion.hpp b/src/Components/Modules/Slowmotion.hpp index 9e90b090..faad9843 100644 --- a/src/Components/Modules/Slowmotion.hpp +++ b/src/Components/Modules/Slowmotion.hpp @@ -14,9 +14,8 @@ namespace Components static int Delay; static void SetSlowMotion(); - static void ApplySlowMotion(int timePassed); - static void ApplySlowMotionStub(); + static void ApplySlowMotionStub(int timePassed); static void DrawConnectionInterruptedStub(int a1); }; -} +} \ No newline at end of file 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 2/2] 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 +}