[Bug 30001] iw4mp (Call of Duty MW2 mod) loader crashes due to iphlpapi.dll GetAdaptersAddresses not hotpatchable (DECLSPEC_HOTPATCH missing)

wine-bugs at winehq.org wine-bugs at winehq.org
Thu Mar 8 16:12:12 CST 2012


Stefan Dösinger <stefan at codeweavers.com> changed:

           What    |Removed                     |Added
                 CC|                            |stefan at codeweavers.com

--- Comment #3 from Stefan Dösinger <stefan at codeweavers.com> 2012-03-08 16:12:12 CST ---
A random note about that hotpatching thing: When I implemented this feature in
gcc I was lazy and only implemented the 5 bytes after the function start.
However, Microsoft's documentation says that 5 bytes right before the function
should be kept free(nops or int 3s). The MS idea is to replace the 2 byte nop
right at the start of the function(mov %edi, %edi) with a relative jump into
those 5 bytes, and put the far jump into those 5 bytes. Interestingly all games
replace the first 5 bytes behind the function entrypoint instead of following
Microsoft's intention.

The main reason why I didn't implement those 5 nop bytes was that I'd have to
change gcc's alignment code, making this a trickier task than the part inside
the function.

Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.

More information about the wine-bugs mailing list