Skip to content

Commit

Permalink
All: Disabled hooks on processes other than Explorer
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Amrsatrio committed Oct 11, 2023
1 parent 8412bd6 commit acc0131
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ExplorerPatcher/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit acc0131

Please sign in to comment.