diff --git a/src/Components/Modules/Dedicated.cpp b/src/Components/Modules/Dedicated.cpp index 78208c7c..8d7a8dbc 100644 --- a/src/Components/Modules/Dedicated.cpp +++ b/src/Components/Modules/Dedicated.cpp @@ -26,7 +26,7 @@ namespace Components memcpy((void*)0x66E1CB0, &fastfiles, sizeof(fastfiles)); Game::LoadInitialFF(); - Utils::Hook::Call(0x4F84C0); + Utils::Hook::Call(0x4F84C0)(); } void Dedicated::MapRotate() @@ -129,7 +129,7 @@ namespace Components callback(); } - Utils::Hook::Call(0x5A8E80); + Utils::Hook::Call(0x5A8E80)(); } Dedicated::Dedicated() diff --git a/src/Components/Modules/Playlist.cpp b/src/Components/Modules/Playlist.cpp index 26ddd2b4..8c45e2d9 100644 --- a/src/Components/Modules/Playlist.cpp +++ b/src/Components/Modules/Playlist.cpp @@ -27,14 +27,8 @@ namespace Components DWORD Playlist::StorePlaylistStub(const char** buffer) { Playlist::CurrentPlaylistBuffer = *buffer; - //return Utils::Hook::Call(0x4C0350); - __asm - { - push buffer - mov eax, 4C0350h - call eax - add esp, 4h - } + + return Utils::Hook::Call(0x4C0350)(buffer); } void Playlist::PlaylistRequest(Network::Address address, std::string data) diff --git a/src/Utils/Hooking.hpp b/src/Utils/Hooking.hpp index f65730fb..e7e7d6e4 100644 --- a/src/Utils/Hooking.hpp +++ b/src/Utils/Hooking.hpp @@ -23,13 +23,9 @@ namespace Utils void* GetAddress(); void Quick(); - template static T Call(DWORD function) + template static std::function Call(DWORD function) { - __asm - { - mov eax, function - call eax - } + return std::function((T*)function); } static void SetString(void* place, const char* string, size_t length);