Skip to content

Commit

Permalink
Handle validation of undocumented uxtheme.dll exported functions in A…
Browse files Browse the repository at this point in the history
…RM64 builds
  • Loading branch information
hmartinez82 authored and SyntevoAlex committed Feb 17, 2024
1 parent 36c3b19 commit f26f536
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/os_custom.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ BOOL Validate_AllowDarkModeForWindow(const BYTE* functionPtr)
return TRUE;
}

return FALSE;
#elif defined(_M_ARM64)
if (*(const DWORD*)(&functionPtr[0x18]) == 0xD29523C1) // mov x1,#0xA91E
{
return TRUE;
}

return FALSE;
#else
#error Unsupported processor type
Expand Down Expand Up @@ -128,6 +135,13 @@ BOOL Validate_AllowDarkModeForWindowWithTelemetryId(const BYTE* functionPtr)
return TRUE;
}

return FALSE;
#elif defined(_M_ARM64)
if (*(const DWORD*)(&functionPtr[0x18]) == 0xD29523C1) // mov x1,#0xA91E
{
return TRUE;
}

return FALSE;
#else
#error Unsupported processor type
Expand Down Expand Up @@ -219,6 +233,13 @@ BOOL Validate_SetPreferredAppMode(const BYTE* functionPtr)
(functionPtr[0x00] == 0x8B) && (functionPtr[0x01] == 0x05) && // mov eax,dword ptr [uxtheme!g_preferredAppMode]
(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
{
return TRUE;
}

return FALSE;
#else
#error Unsupported processor type
#endif
Expand Down

0 comments on commit f26f536

Please sign in to comment.