Carried this a while in Hangover now
From: André Zwing nerv@dawncrow.de
--- dlls/wow64/syscall.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/wow64/syscall.c b/dlls/wow64/syscall.c index 06dd9822a08..23f8915aa64 100644 --- a/dlls/wow64/syscall.c +++ b/dlls/wow64/syscall.c @@ -639,6 +639,7 @@ NTSTATUS WINAPI wow64_NtWow64IsProcessorFeaturePresent( UINT *args ) */ static DWORD get_syscall_num( const BYTE *syscall ) { + WORD *arm_syscall = (WORD *)((ULONG_PTR)syscall & ~1); DWORD id = ~0u;
if (!syscall) return id; @@ -650,9 +651,9 @@ static DWORD get_syscall_num( const BYTE *syscall ) break;
case IMAGE_FILE_MACHINE_ARMNT: - if (*(WORD *)syscall == 0xb40f) + if (*arm_syscall == 0xb40f) { - DWORD inst = *(DWORD *)((WORD *)syscall + 1); + DWORD inst = *(DWORD *)(arm_syscall + 1); id = ((inst << 1) & 0x0800) + ((inst << 12) & 0xf000) + ((inst >> 20) & 0x0700) + ((inst >> 16) & 0x00ff); }