From 7172841e7838083d21329175ade2bed7164be0f5 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 6 Nov 2026 14:30:04 +0000 Subject: [PATCH] Decompile fn_18124 (LoadLibraryFunctions) Batch #13205 by spider: 0 byte-identical, 1 confirmed by peer review. - fn_18124 LoadLibraryFunctions: logic confirmed by peer review Peer-reviewed-by: Tanke, Toshiro, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Utility/ProcessSecurity.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Source/Utility/ProcessSecurity.cpp b/Source/Utility/ProcessSecurity.cpp index b03f2c45..bc91e5c8 100644 --- a/Source/Utility/ProcessSecurity.cpp +++ b/Source/Utility/ProcessSecurity.cpp @@ -36,26 +36,25 @@ int RemoveProtectionTools() { // OFFSET: 0x00AEACD0 // FUNCTION: fn_18124 int LoadLibraryFunctions(HMODULE* module, const char* name, int count, ...) { + std::va_list arguments; + va_start(arguments, count); *module = LoadLibraryA(name); if (*module != nullptr) { - std::va_list arguments; - va_start(arguments, count); - int index = 0; - for (; index < count; ++index) { + for (int index = 0; index < count; ++index) { FARPROC* output = va_arg(arguments, FARPROC*); const char* symbol = va_arg(arguments, const char*); *output = GetProcAddress(*module, symbol); if (*output == nullptr) { - break; + goto failure; } } va_end(arguments); - if (index >= count) { - return 1; - } + return 1; } +failure: + va_end(arguments); if (*module != nullptr) { FreeLibrary(*module); }