Skip to content

Commit 8b4d8db

Browse files
committed
Fix immersive menu disabling on ARM64
1 parent 80b5d73 commit 8b4d8db

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

ExplorerPatcher/dllmain.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2430,12 +2430,28 @@ static void HookImmersiveMenuFunctions(
24302430
MODULEINFO mi;
24312431
GetModuleInformation(GetCurrentProcess(), module, &mi, sizeof(MODULEINFO));
24322432

2433+
#if defined(_M_X64)
24332434
// 40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ? 48 33 C4 48 89 85 ? ? ? ? 4C 8B B5 ? ? ? ? 41 8B C1
2434-
PBYTE match = FindPattern(
2435+
PBYTE match = (PBYTE)FindPattern(
24352436
mi.lpBaseOfDll, mi.SizeOfImage,
24362437
"\x40\x55\x53\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\xAC\x24\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00\x48\x33\xC4\x48\x89\x85\x00\x00\x00\x00\x4C\x8B\xB5\x00\x00\x00\x00\x41\x8B\xC1",
24372438
"xxxxxxxxxxxxxxxxx????xxx????xxx????xxxxxx????xxx????xxx"
24382439
);
2440+
#elif defined(_M_ARM64)
2441+
// 40 F9 43 03 1C 32 E4 03 15 AA ?? ?? FF 97
2442+
// ^^^^^^^^^^^
2443+
// Ref: ImmersiveContextMenuHelper::ApplyOwnerDrawToMenu()
2444+
PBYTE match = (PBYTE)FindPattern(
2445+
mi.lpBaseOfDll, mi.SizeOfImage,
2446+
"\x40\xF9\x43\x03\x1C\x32\xE4\x03\x15\xAA\x00\x00\xFF\x97",
2447+
"xxxxxxxxxx??xx"
2448+
);
2449+
if (match)
2450+
{
2451+
match += 10;
2452+
match = (PBYTE)ARM64_FollowBL((DWORD*)match);
2453+
}
2454+
#endif
24392455
if (match)
24402456
{
24412457
*applyFunc = match;

0 commit comments

Comments
 (0)