News for hackers. Stuff that matters.
Re:i386 in Ubuntu Won't Die by Dalewyn on Sunday August 27, 2023 @09:04AM (#37282326)
>will make having 32-bit system libs unnecessary, ... , not unlike how Windows handles syscalls in real WoW64.

WoW64 literally has an entire 32-bit equivalent to Windows's native 64-bit libraries and binaries.

Re:i386 in Ubuntu Won't Die by jchw on Sunday August 27, 2023 @09:23AM (#37282476)
I should've known better than to be vague here.

I'm talking about just syscalls. Windows differs from Linux in that Windows doesn't have backwards compatibility for the kernel ABI but the userspace ABI; all of the syscalls HAVE to be dispatched by NTDLL, because the syscall numbers are not stable between kernel versions anyway. (Not that this entirely stops crapware like anti-cheat from doing so, but nonetheless.)

From my point of view, the closest Wine equivalent of a "syscall" would be calling out to UNIX system libraries, so it does bear some similarities even if it's not quite the same.

I don't personally want to open WOW64 NTDLL in IDA because doing so would probably limit me from contributing to Wine, but my understanding is that WOW64 NTDLL is just thunks to Win64 NTDLL, using an intermediate library (one of the wow64*.dlls presumably?) to perform a Heaven's Gate call into the 64-bit NTDLL.

Re:i386 in Ubuntu Won't Die by AshamedCaptain on Sunday August 27, 2023 @09:57AM (#37282776)
Not even that is true anymore since some Windows games are now hardcoding system call numbers.
Re:i386 in Ubuntu Won't Die by yrro on Sunday August 27, 2023 @10:22AM (#37282994)
Why in god's name!?
Re:i386 in Ubuntu Won't Die by jchw on Sunday August 27, 2023 @11:01AM (#37283354)
It's mainly going to be anti-cheat and DRM trying to be tricky and mitigate hooks and obfuscate their behavior.
Re:i386 in Ubuntu Won't Die by sapphyrus on Sunday August 27, 2023 @10:28AM (#37283062)
WOW64 syscalls are indeed implemented using heaven's gate, the 32-bit ntdll calls into a "wow64cpu.dll" module, which does the long-mode transition and ends up calling into the 64-bit ntdll. Unfortunately manual syscalls are still possible (and widely used) on windows, either by hardcoding syscall IDs for common versions or performing very rudimentary "disassembling" of the ntdll syscall stubs.
Re:i386 in Ubuntu Won't Die by Dwedit on Sunday August 27, 2023 @10:30AM (#37283073)
Syscalls aren't just dispatched by NTDLL, they're also dispatched by "Win32u.dll". In earlier versions of Windows, "User32.dll" also makes system calls as well.
Re:i386 in Ubuntu Won't Die by jchw on Sunday August 27, 2023 @11:00AM (#37283345)
Okay, I genuinely did not know that User32.dll made syscalls directly. Interesting, and kind of bizarre.