From b6b6effef3d5debdf22d082649cde453cba176fb Mon Sep 17 00:00:00 2001 From: N0VAN0M4LY <224130499+N0VAN0M4LY@users.noreply.github.com> Date: Wed, 25 Nov 2026 05:04:28 +0800 Subject: [PATCH] fix(native): preserve stock socket export ordinals Keep the original ordinals for functions imported by number so Windows can resolve the socket library imports during startup. --- native/wto-net/src/wto_ws.def | 63 ++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/native/wto-net/src/wto_ws.def b/native/wto-net/src/wto_ws.def index 88ff191..54a4f6f 100644 --- a/native/wto-net/src/wto_ws.def +++ b/native/wto-net/src/wto_ws.def @@ -1,14 +1,15 @@ ; wto_ws.dll exports: every function aces.exe 2.61.0.37 imports from WS2_32.dll, forwarded to the ; system ws2_32.dll (whose resolution and connection functions the DLL hooks, dll_main.c). +; 31 of them are imported by ordinal, so they keep ws2_32's ordinals (@n). ; Regenerate from the executable's import table when the game version changes. LIBRARY wto_ws EXPORTS - WSACleanup=ws2_32.WSACleanup + WSACleanup=ws2_32.WSACleanup @116 WSACloseEvent=ws2_32.WSACloseEvent WSACreateEvent=ws2_32.WSACreateEvent WSAEnumNetworkEvents=ws2_32.WSAEnumNetworkEvents WSAEventSelect=ws2_32.WSAEventSelect - WSAGetLastError=ws2_32.WSAGetLastError + WSAGetLastError=ws2_32.WSAGetLastError @111 WSAIoctl=ws2_32.WSAIoctl WSARecv=ws2_32.WSARecv WSARecvFrom=ws2_32.WSARecvFrom @@ -16,39 +17,39 @@ EXPORTS WSASend=ws2_32.WSASend WSASendTo=ws2_32.WSASendTo WSASetEvent=ws2_32.WSASetEvent - WSASetLastError=ws2_32.WSASetLastError + WSASetLastError=ws2_32.WSASetLastError @112 WSASocketA=ws2_32.WSASocketA - WSAStartup=ws2_32.WSAStartup + WSAStartup=ws2_32.WSAStartup @115 WSAWaitForMultipleEvents=ws2_32.WSAWaitForMultipleEvents - __WSAFDIsSet=ws2_32.__WSAFDIsSet - accept=ws2_32.accept - bind=ws2_32.bind - closesocket=ws2_32.closesocket - connect=ws2_32.connect + __WSAFDIsSet=ws2_32.__WSAFDIsSet @151 + accept=ws2_32.accept @1 + bind=ws2_32.bind @2 + closesocket=ws2_32.closesocket @3 + connect=ws2_32.connect @4 freeaddrinfo=ws2_32.freeaddrinfo getaddrinfo=ws2_32.getaddrinfo - gethostbyname=ws2_32.gethostbyname - gethostname=ws2_32.gethostname + gethostbyname=ws2_32.gethostbyname @52 + gethostname=ws2_32.gethostname @57 getnameinfo=ws2_32.getnameinfo - getpeername=ws2_32.getpeername - getservbyname=ws2_32.getservbyname - getsockname=ws2_32.getsockname - getsockopt=ws2_32.getsockopt - htonl=ws2_32.htonl - htons=ws2_32.htons - inet_addr=ws2_32.inet_addr - inet_ntoa=ws2_32.inet_ntoa + getpeername=ws2_32.getpeername @5 + getservbyname=ws2_32.getservbyname @55 + getsockname=ws2_32.getsockname @6 + getsockopt=ws2_32.getsockopt @7 + htonl=ws2_32.htonl @8 + htons=ws2_32.htons @9 + inet_addr=ws2_32.inet_addr @11 + inet_ntoa=ws2_32.inet_ntoa @12 inet_ntop=ws2_32.inet_ntop inet_pton=ws2_32.inet_pton - ioctlsocket=ws2_32.ioctlsocket - listen=ws2_32.listen - ntohl=ws2_32.ntohl - ntohs=ws2_32.ntohs - recv=ws2_32.recv - recvfrom=ws2_32.recvfrom - select=ws2_32.select - send=ws2_32.send - sendto=ws2_32.sendto - setsockopt=ws2_32.setsockopt - shutdown=ws2_32.shutdown - socket=ws2_32.socket + ioctlsocket=ws2_32.ioctlsocket @10 + listen=ws2_32.listen @13 + ntohl=ws2_32.ntohl @14 + ntohs=ws2_32.ntohs @15 + recv=ws2_32.recv @16 + recvfrom=ws2_32.recvfrom @17 + select=ws2_32.select @18 + send=ws2_32.send @19 + sendto=ws2_32.sendto @20 + setsockopt=ws2_32.setsockopt @21 + shutdown=ws2_32.shutdown @22 + socket=ws2_32.socket @23