Skip to content

Commit

Permalink
[REFACT] In load_delayed_imports: pass the real status
Browse files Browse the repository at this point in the history
  • Loading branch information
hasherezade committed Aug 12, 2022
1 parent 54e7d3f commit 3cd3cc8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libpeconv/src/delayed_imports_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ bool peconv::load_delayed_imports(BYTE* modulePtr, ULONGLONG moduleBase, t_funct
#ifdef _DEBUG
std::cout << "OK, table_size = " << table_size << std::endl;
#endif
bool is_ok = true;
size_t max_count = table_size / sizeof(IMAGE_DELAYLOAD_DESCRIPTOR);
for (size_t i = 0; i < max_count; i++) {
IMAGE_DELAYLOAD_DESCRIPTOR *desc = &first_desc[i];
Expand All @@ -141,18 +142,18 @@ bool peconv::load_delayed_imports(BYTE* modulePtr, ULONGLONG moduleBase, t_funct
#endif
if (is_64bit) {
#ifdef _WIN64
parse_delayed_desc<ULONGLONG,IMAGE_THUNK_DATA64>(modulePtr, module_size, moduleBase, dll_name, IMAGE_ORDINAL_FLAG64, desc, func_resolver);
is_ok = parse_delayed_desc<ULONGLONG,IMAGE_THUNK_DATA64>(modulePtr, module_size, moduleBase, dll_name, IMAGE_ORDINAL_FLAG64, desc, func_resolver);
#else
return false;
#endif
}
else {
#ifndef _WIN64
parse_delayed_desc<DWORD, IMAGE_THUNK_DATA32>(modulePtr, module_size, moduleBase, dll_name, IMAGE_ORDINAL_FLAG32, desc, func_resolver);
is_ok = parse_delayed_desc<DWORD, IMAGE_THUNK_DATA32>(modulePtr, module_size, moduleBase, dll_name, IMAGE_ORDINAL_FLAG32, desc, func_resolver);
#else
return false;
#endif
}
}
return true;
return is_ok;
}

0 comments on commit 3cd3cc8

Please sign in to comment.