From 3654696d3528a69e35749ada991fe7bacdd017e3 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 20:11:33 +0000 Subject: [PATCH] Decompile fn_20387 (CheckConnectionRuntime) Batch #12555 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_20387 CheckConnectionRuntime: logic confirmed by peer review Peer-reviewed-by: Yommy, alisonrag, gordaoprogramas, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- .../Network/Connection/ConnectionRuntime.cpp | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/Source/Network/Connection/ConnectionRuntime.cpp b/Source/Network/Connection/ConnectionRuntime.cpp index 7626dfab..7b75d63a 100644 --- a/Source/Network/Connection/ConnectionRuntime.cpp +++ b/Source/Network/Connection/ConnectionRuntime.cpp @@ -8,10 +8,6 @@ namespace { // GLOBAL: gl_24390 HMODULE ws2Module; - - // STATIC: 0x016FDC94 - // GLOBAL: gl_24393 - HMODULE module; } // STATIC: 0x016FDC8C // GLOBAL: gl_24391 @@ -26,18 +22,17 @@ int(WSAAPI* g_connectionReceive)(SOCKET, char*, int, int); bool CheckConnectionRuntime() { const char* names[] = {"connect", "closesocket", "send", "select"}; HMODULE library = LoadLibraryA("ws2_32.dll"); - if (!library) { - return true; - } - - for (unsigned index = 0; index < 4; ++index) { - if (GetProcAddress(library, names[index]) != GetProcAddress(module, names[index])) { - FreeLibrary(library); - return false; + if (library) { + for (unsigned index = 0; index < 4; ++index) { + if (GetProcAddress(library, names[index]) != GetProcAddress(ws2Module, names[index])) { + FreeLibrary(library); + return false; + } } + + FreeLibrary(library); } - FreeLibrary(library); return true; } @@ -45,9 +40,9 @@ bool CheckConnectionRuntime() { // FUNCTION: fn_20408 bool InitializeConnections() { WSAStartup(MAKEWORD(1, 1), &wsaData); - module = LoadLibraryA("ws2_32.dll"); - g_connectionSend = reinterpret_cast(GetProcAddress(module, "send")); - g_connectionReceive = reinterpret_cast(GetProcAddress(module, "recv")); + ws2Module = LoadLibraryA("ws2_32.dll"); + g_connectionSend = reinterpret_cast(GetProcAddress(ws2Module, "send")); + g_connectionReceive = reinterpret_cast(GetProcAddress(ws2Module, "recv")); CheckConnectionRuntime(); return true;