Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
This commit is contained in:
parent
35d2a8cb36
commit
a47d20f8be
890 changed files with 11796 additions and 16664 deletions
|
|
@ -1,50 +0,0 @@
|
|||
#include "Network/ConnectionRuntime.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
namespace {
|
||||
// STATIC: 0x016FDC94
|
||||
// GLOBAL: gl_24393
|
||||
HMODULE module;
|
||||
}
|
||||
// STATIC: 0x016FDC8C/0x016FDC90
|
||||
int(WSAAPI* g_connectionSend)(SOCKET, const char*, int, int);
|
||||
int(WSAAPI* g_connectionReceive)(SOCKET, char*, int, int);
|
||||
|
||||
// OFFSET: 0x00C7C400
|
||||
// FUNCTION: fn_20387
|
||||
bool CheckConnectionRuntime() {
|
||||
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)) {
|
||||
FreeLibrary(library);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
FreeLibrary(library);
|
||||
return true;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00C7D020
|
||||
// FUNCTION: fn_20408
|
||||
bool InitializeConnections() {
|
||||
WSADATA data;
|
||||
WSAStartup(0x101, &data);
|
||||
module = LoadLibraryA("ws2_32.dll");
|
||||
g_connectionSend = reinterpret_cast<decltype(g_connectionSend)>(GetProcAddress(module, "send"));
|
||||
g_connectionReceive = reinterpret_cast<decltype(g_connectionReceive)>(GetProcAddress(module, "recv"));
|
||||
CheckConnectionRuntime();
|
||||
// Original ignores WSAStartup/load/address/check outcomes and returns true.
|
||||
return true;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00C7C4B0
|
||||
// FUNCTION: fn_20388
|
||||
void ShutdownConnections() {
|
||||
WSACleanup();
|
||||
FreeLibrary(module);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue