32-bit hotpatching question

Alexandre Ganea alexandre.ganea at ubisoft.com
Sat Jun 6 08:31:35 CDT 2020


Hello,

While implementing the MSVC /hotpatch flag into LLVM clang-cl, we were wondering how hotpatching is achieved in Wine for 32-bit x86 targets?
Previous versions of MSVC up to VS2013 were emitting "8F FF MOV edi, edi". However since VS2015, a two-byte nop "66 90 XCHG ax, ax" is emitted, as suggested by Intel documentation.
Charles suggested here: https://reviews.llvm.org/D81301#2077964 that Wine might be relying on the magic "8F FF" to patch the Win32 APIs. However how is that possible since (I assume) recent Windows do not contain that magic sequence, rather a two-byte nop.
In essence the question is, if MSVC /hotpatch or GCC __ms_hook_prologue__ was supported in LLVM, would it be fine if it generated "66 90 XCHG ax, ax"?

Thanks in advance!
Alex.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20200606/eb7f4050/attachment-0001.htm>


More information about the wine-devel mailing list