On Tue Jan 28 09:50:41 2025 +0000, Jacek Caban wrote:
It might be more flexible to avoid restricting `machine` to `IMAGE_FILE_MACHINE_ARM64` and instead check for something like `machine != current_machine`. This would allow a 64-bit loader to use the new wow for x86 emulation while still using the old wow for 32-bit ARM.
As we have a `machine == current_machine` early return above on line 514, the whole rest of the function essentially is operating under `machine != current_machine` already.
Of course I don't mind extending how this works, but I'm not hands-on familiar with the whole new-wow64 and in particular x86/x86_64 emulation cases, so I'd prefer to leave that to someone else; I've mostly tried to mirror what is done for x86 old wow64 here.