From d92aee6684b9d2847068194ac5fa663cfb0b5357 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 4 Nov 2026 23:04:03 +0000 Subject: [PATCH] Decompile 2 functions in Source/Network/Connection/ConnectionRuntime.cpp Batch #10531 by cremane: 0 byte-identical, 2 confirmed by peer review. - fn_20408 InitializeConnections: logic confirmed by peer review - fn_20387 CheckConnectionRuntime: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Yommy, dori, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Network/Connection/ConnectionRuntime.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/Network/Connection/ConnectionRuntime.cpp b/Source/Network/Connection/ConnectionRuntime.cpp index 842137c2..e2ae3538 100644 --- a/Source/Network/Connection/ConnectionRuntime.cpp +++ b/Source/Network/Connection/ConnectionRuntime.cpp @@ -3,6 +3,9 @@ #include namespace { + // GLOBAL: gl_24389 + WSADATA wsaData; + // STATIC: 0x016FDC94 // GLOBAL: gl_24393 HMODULE module; @@ -18,15 +21,14 @@ int(WSAAPI* g_connectionReceive)(SOCKET, char*, int, int); // OFFSET: 0x00C7C400 // FUNCTION: fn_20387 bool CheckConnectionRuntime() { + const char* names[] = {"connect", "closesocket", "send", "select"}; HMODULE library = LoadLibraryA("ws2_32.dll"); if (!library) { return true; } - static const char* names[] = {"connect", "closesocket", "send", "select"}; - - for (const char* name : names) { - if (GetProcAddress(library, name) != GetProcAddress(module, name)) { + for (unsigned index = 0; index < 4; ++index) { + if (GetProcAddress(library, names[index]) != GetProcAddress(module, names[index])) { FreeLibrary(library); return false; } @@ -39,8 +41,7 @@ bool CheckConnectionRuntime() { // OFFSET: 0x00C7D020 // FUNCTION: fn_20408 bool InitializeConnections() { - WSADATA data; - WSAStartup(MAKEWORD(1, 1), &data); + WSAStartup(MAKEWORD(1, 1), &wsaData); module = LoadLibraryA("ws2_32.dll"); g_connectionSend = reinterpret_cast(GetProcAddress(module, "send")); g_connectionReceive = reinterpret_cast(GetProcAddress(module, "recv"));