Fix overlayHooks

pull/89/head
Peter Repukat 5 years ago
parent 62ad8c5361
commit 06d5a6d34b

@ -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...

@ -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<VirtualControllerThread>(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<char*>(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)
{

@ -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

Loading…
Cancel
Save