All: Preliminary ARM64 support

This commit is contained in:
Amrsatrio
2024-07-11 09:31:06 +07:00
parent 016214a381
commit 992b3a60cd
23 changed files with 1169 additions and 256 deletions
+17 -1
View File
@@ -1177,14 +1177,30 @@ HRESULT PatchUnifiedTilePinUnpinProvider(HMODULE hModule)
MODULEINFO mi;
RETURN_IF_WIN32_BOOL_FALSE(GetModuleInformation(GetCurrentProcess(), hModule, &mi, sizeof(mi)));
#if defined(_M_X64)
// 40 55 53 56 57 41 54 41 55 41 56 41 57 48 8D 6C 24 ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 FF 49 8B ?? 4D 8B ?? 48 8B ?? 4C 8B ?? 4C 89 4D
// Ref: WindowsInternal::Shell::UnifiedTile::Private::UnifiedTilePinUnpinVerbProvider::GetVerbs()
PBYTE match = (PBYTE)FindPattern(
hModule,
mi.SizeOfImage,
"\x40\x55\x53\x56\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8D\x6C\x24\x00\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00\x48\x33\xC4\x48\x89\x45\xFF\x49\x8B\x00\x4D\x8B\x00\x48\x8B\x00\x4C\x8B\x00\x4C\x89\x4D",
"xxxxxxxxxxxxxxxxx?xxx????xxx????xxxxxxxxx?xx?xx?xx?xxx"
);
#elif defined(_M_ARM64)
// E4 06 40 F9 E3 03 15 AA E2 0E 40 F9 E1 03 19 AA E0 03 16 AA ?? ?? ?? ?? E3 03 00 2A
// ^^^^^^^^^^^
// Ref: WindowsInternal::Shell::UnifiedTile::Private::UnifiedTilePinUnpinVerbProvider::GetVerbs()
PBYTE match = (PBYTE)FindPattern(
hModule,
mi.SizeOfImage,
"\xE4\x06\x40\xF9\xE3\x03\x15\xAA\xE2\x0E\x40\xF9\xE1\x03\x19\xAA\xE0\x03\x16\xAA\x00\x00\x00\x00\xE3\x03\x00\x2A",
"xxxxxxxxxxxxxxxxxxxx????xxxx"
);
if (match)
{
match += 20;
match = (PBYTE)ARM64_FollowBL((DWORD*)match);
}
#endif
int rv = -1;
if (match)