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).
This commit is contained in:
ragnarok-clanker 2026-11-06 14:30:04 +00:00
commit 7172841e78

View file

@ -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);
}