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:
parent
baf4c83c2f
commit
7172841e78
1 changed files with 7 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue