From acc0131e7735297c4a2339303813fb402f937049 Mon Sep 17 00:00:00 2001 From: Amrsatrio Date: Wed, 11 Oct 2023 15:16:42 +0700 Subject: [PATCH] All: Disabled hooks on processes other than Explorer Because anticheats really hate DLLs that inject to games, let alone DLLs that hook existing functions. This was made as an attempt to fix #2267. --- ExplorerPatcher/dllmain.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 81c3ceea7..3076329c6 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -10705,7 +10705,7 @@ DWORD Inject(BOOL bIsExplorer) Explorer_RefreshUI(99); #ifdef _WIN64 - // if (bIsExplorer) + if (bIsExplorerProcess) { funchook = funchook_create(); // printf("funchook create %d\n", funchook != 0); @@ -10890,10 +10890,13 @@ DWORD Inject(BOOL bIsExplorer) if (!bIsExplorer) { #ifdef _WIN64 - rv = funchook_install(funchook, 0); - if (rv != 0) + if (bIsExplorerProcess) { - printf("Failed to install hooks. rv = %d\n", rv); + rv = funchook_install(funchook, 0); + if (rv != 0) + { + printf("Failed to install hooks. rv = %d\n", rv); + } } #endif return 0;