diff --git a/SteamTarget/OverlayHookFunction.h b/SteamTarget/OverlayHookFunction.h index 8b877e3..fa1b737 100644 --- a/SteamTarget/OverlayHookFunction.h +++ b/SteamTarget/OverlayHookFunction.h @@ -32,8 +32,8 @@ namespace overlay_hook //excute overrriden instructions __asm { - push esi - mov byte ptr ds : [esi + 0x28], 1 + push eax + mov byte ptr ds : [edi + 0x38], 1 } //our hook code... @@ -56,8 +56,8 @@ namespace overlay_hook { //excute overrriden instructions __asm { - mov dword ptr ds : [esi + 0x24], 0 - mov byte ptr ds : [esi + 0x28], 0 + push eax + mov byte ptr ds : [edi + 0x38] , 0 } //our hook code... diff --git a/SteamTarget/SteamTarget.cpp b/SteamTarget/SteamTarget.cpp index 5b2f4d2..c852000 100644 --- a/SteamTarget/SteamTarget.cpp +++ b/SteamTarget/SteamTarget.cpp @@ -54,7 +54,6 @@ void SteamTarget::init() SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS); readIni(); target_overlay_.init(!enable_overlay_, enable_overlay_only_config_, max_fps_); - initOverlayEvents(); if (!use_desktop_conf_) fgwinhook::patchForegroundWindow(); controller_thread_ = std::make_unique(update_rate_); @@ -66,6 +65,9 @@ void SteamTarget::init() if (launch_game_) launchApplication(); + initOverlayEvents(); + + sys_tray_icon_.setIcon(QIcon(":/SteamTarget/Resources/GloSC_Icon.png")); tray_icon_menu_.addAction("Quit"); sys_tray_icon_.setContextMenu(&tray_icon_menu_); @@ -170,22 +172,9 @@ void SteamTarget::initOverlayEvents() if (addressOpen != 0) { - DWORD addressClosed = 0; - - for (DWORD i = 0; i < 1024; i++) //search next signature relativ to "addressOpened" - { - bool found = true; - for (DWORD j = 0; j < std::string(overlay_closed_func_mask).length(); j++) - found &= - overlay_closed_func_mask[j] == '?' || - overlay_closed_func_sig[j] == *reinterpret_cast(addressOpen + j + i); - - if (found) - { - addressClosed = addressOpen + i; - break; - } - } + DWORD addressClosed = hook_commons::FindPattern(overlay_module_name, + overlay_closed_func_sig, + overlay_closed_func_mask); if (addressClosed != 0) { diff --git a/SteamTarget/SteamTarget.h b/SteamTarget/SteamTarget.h index 0216902..8cf5ead 100644 --- a/SteamTarget/SteamTarget.h +++ b/SteamTarget/SteamTarget.h @@ -95,11 +95,11 @@ private: #else constexpr static const char* overlay_module_name = "GameOverlayRenderer.dll"; - constexpr static const char* overlay_open_func_sig = "\x56\xC6\x46\x28\x01"; + constexpr static const char* overlay_open_func_sig = "\x50\xC6\x47\x38\x01"; constexpr static const char* overlay_open_func_mask = "xxxxx"; - constexpr static const char* overlay_closed_func_sig = "\xC7\x46\x24\x00\x00\x00\x00\xC6\x46\x28\x00"; - constexpr static const char* overlay_closed_func_mask = "xxxxxxxxxxx"; + constexpr static const char* overlay_closed_func_sig = "\x50\xC6\x47\x38\x00"; + constexpr static const char* overlay_closed_func_mask = "xxxxx"; #endif