Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[win32][arm64] Support Dark Theme on newer Windows builds #1172

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,17 @@ BOOL Validate_SetPreferredAppMode(const BYTE* functionPtr)
(functionPtr[0x06] == 0x87) && (functionPtr[0x07] == 0x0D) && // xchg ecx,dword ptr [uxtheme!g_preferredAppMode]
(functionPtr[0x0C] == 0xC3); // ret
#elif defined(_M_ARM64)
if (*(const DWORD*)(&functionPtr[0x1C]) == 0x912F6100) // add x0,x8,#0xBD8
const DWORD ldr = *(const DWORD*)(&functionPtr[0x14]);
const DWORD add = *(const DWORD*)(&functionPtr[0x1C]);

if ((ldr & 0xFFC003FF) == 0xB9400113 && // ldr, w19,[x8, arg0]
*(const DWORD*)(&functionPtr[0x18]) == 0x2A0003E1 && // mov w1,w0
(add & 0xFFC003FF) == 0x91000100 && // add x0,x8,arg1
*(const DWORD*)(&functionPtr[0x24]) == 0x2A1303E0) // mov w0,w19
{
return TRUE;
const DWORD arg0 = ((ldr & 0x003FFC00) >> 10) * 4;
const DWORD arg1 = ((add & 0x003FFC00) >> 10);
return arg0 == arg1;
}

return FALSE;
Expand Down