@@ -1364,17 +1364,21 @@ void ForceEnableXamlSounds(HMODULE hWindowsUIXaml)
13641364#elif defined(_M_ARM64 )
13651365 // 08 ?? ?? B9 1F 09 00 71 ?? ?? ?? 54 ?? 00 00 35 ?? ?? ?? ??
13661366 // ^^^^^^^^^^^ BL -> MOV W0, #1
1367- PBYTE match = FindPattern_4_ (
1367+ // BL:
1368+ // P: 0b100101_00000000000000000000000000 = 94000000 = 00 00 00 94
1369+ // M: 0b111111_00000000000000000000000000 = FC000000 = 00 00 00 FC
1370+ PBYTE match = FindPatternBitMask_4_ (
13681371 pWindowsUIXamlText ,
13691372 cbWindowsUIXamlText ,
1370- "\x08\x00\x00\xB9\x1F\x09\x00\x71\x00\x00\x00\x54\x00\x00\x00\x35" ,
1371- "x??xxxxx???x?xxx"
1373+ "\x08\x00\x00\xB9\x1F\x09\x00\x71\x00\x00\x00\x54\x00\x00\x00\x35\x00\x00\x00\x94" ,
1374+ "\xFF\x00\x00\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\xFF\x00\xFF\xFF\xFF\x00\x00\x00\xFC" ,
1375+ 20
13721376 );
13731377 if (match )
13741378 {
13751379 match += 16 ;
1376- DWORD currentInsn = * (DWORD * )match ;
1377- DWORD newInsn = ARM64_IsBL (currentInsn ) ? 0x52800020 : 0 ; // MOV W0, #1
1380+ // DWORD currentInsn = *(DWORD*)match;
1381+ DWORD newInsn = /* ARM64_IsBL(currentInsn) ?*/ 0x52800020 /* : 0*/ ; // MOV W0, #1
13781382 if (newInsn )
13791383 {
13801384 DWORD flOldProtect = 0 ;
@@ -9931,6 +9935,7 @@ static void PatchAppResolver()
99319935 match += 5 + * (int * )(match + 1 );
99329936 }
99339937#elif defined(_M_ARM64 )
9938+ // Nickel+
99349939 // 7F 23 03 D5 FD 7B BC A9 F3 53 01 A9 F5 5B 02 A9 F7 1B 00 F9 FD 03 00 91 ?? ?? ?? ?? FF 43 01 D1 F7 03 00 91 30 00 80 92 F0 1A 00 F9 ?? 03 01 AA ?? 03 02 AA FF ?? 00 F9
99359940 // ----------- PACIBSP, don't scan for this because it's everywhere
99369941 PBYTE match = FindPattern_4_ (
@@ -9943,6 +9948,22 @@ static void PatchAppResolver()
99439948 {
99449949 match -= 4 ;
99459950 }
9951+ else
9952+ {
9953+ // Cobalt
9954+ // 7F 23 03 D5 FD 7B BC A9 F3 53 01 A9 F5 5B 02 A9 F7 1B 00 F9 F9 1F 00 F9 FD 03 00 91 ?? ?? ?? ?? FF 43 01 D1 F7 03 00 91 30 00 80 92 F0 1A 00 F9 ?? 03 01 AA ?? 03 02 AA FF ?? 00 F9
9955+ // ----------- PACIBSP, don't scan for this because it's everywhere
9956+ match = (PBYTE )FindPattern_4_ (
9957+ pAppResolverText ,
9958+ cbAppResolverText ,
9959+ "\xFD\x7B\xBC\xA9\xF3\x53\x01\xA9\xF5\x5B\x02\xA9\xF7\x1B\x00\xF9\xF9\x1F\x00\xF9\xFD\x03\x00\x91\x00\x00\x00\x00\xFF\x43\x01\xD1\xF7\x03\x00\x91\x30\x00\x80\x92\xF0\x1A\x00\xF9\x00\x03\x01\xAA\x00\x03\x02\xAA\xFF\x00\x00\xF9" ,
9960+ "xxxxxxxxxxxxxxxxxxxxxxxx????xxxxxxxxxxxxxxxx?xxx?xxxx?xx"
9961+ );
9962+ if (match )
9963+ {
9964+ match -= 4 ;
9965+ }
9966+ }
99469967#endif
99479968 if (match )
99489969 {
@@ -11990,18 +12011,18 @@ static BOOL StartMenu_FixContextMenuXbfHijackMethod()
1199012011 return FALSE;
1199112012
1199212013#if defined(_M_X64 )
11993- // 49 89 43 C8 E8 ?? ?? ?? ?? 85 C0
11994- // ^^^^^^^^^^^
12014+ // 48 8B 45 ?? 49 89 43 C8 E8 ?? ?? ?? ?? 85 C0
12015+ // ^^^^^^^^^^^
1199512016 // Ref: CCoreServices::LoadXamlResource()
1199612017 PBYTE match = FindPattern (
1199712018 pWindowsUIXamlText ,
1199812019 cbWindowsUIXamlText ,
11999- "\x49\x89\x43\xC8\xE8\x00\x00\x00\x00\x85\xC0" ,
12000- "xxxxx????xx"
12020+ "\x48\x8B\x45\x00\ x49\x89\x43\xC8\xE8\x00\x00\x00\x00\x85\xC0" ,
12021+ "xxx? xxxxx????xx"
1200112022 );
1200212023 if (match )
1200312024 {
12004- match += 4 ;
12025+ match += 8 ;
1200512026 match += 5 + * (int * )(match + 1 );
1200612027 }
1200712028 else
@@ -12023,14 +12044,14 @@ static BOOL StartMenu_FixContextMenuXbfHijackMethod()
1202312044 }
1202412045 }
1202512046#elif defined(_M_ARM64 )
12026- // E1 0B 40 F9 05 00 80 D2 04 00 80 D2 E3 03 ?? AA E2 03 ?? AA E0 03 ?? AA ?? ?? ?? 97
12047+ // E1 0B 40 F9 05 00 80 D2 04 00 80 D2 E3 03 ?? AA E2 03 ?? AA E0 03 ?? AA ?? ?? ?? ?? ?? 03 00 2A
1202712048 // ^^^^^^^^^^^
1202812049 // Ref: CoreServices_TryGetApplicationResource()
1202912050 PBYTE match = FindPattern_4_ (
1203012051 pWindowsUIXamlText ,
1203112052 cbWindowsUIXamlText ,
12032- "\xE1\x0B\x40\xF9\x05\x00\x80\xD2\x04\x00\x80\xD2\xE3\x03\x00\xAA\xE2\x03\x00\xAA\xE0\x03\x00\xAA\x00\x00\x00\x97 " ,
12033- "xxxxxxxxxxxxxx?xxx?xxx?x???x "
12053+ "\xE1\x0B\x40\xF9\x05\x00\x80\xD2\x04\x00\x80\xD2\xE3\x03\x00\xAA\xE2\x03\x00\xAA\xE0\x03\x00\xAA\x00\x00\x00\x00\x00\x03\x00\x2A " ,
12054+ "xxxxxxxxxxxxxx?xxx?xxx?x?????xxx "
1203412055 );
1203512056 if (match )
1203612057 {
0 commit comments