Fix error message on import hook fail (#957)

This commit is contained in:
kizer 2022-08-18 15:47:38 +09:00 committed by GitHub
parent 38e3a8e7f5
commit e9147387c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -140,7 +140,7 @@ void* utils::loaded_module::get_imported_function_pointer(const char* pcszDllNam
if (void* ppImportTableItem{}; find_imported_function_pointer(pcszDllName, pcszFunctionName, hintOrOrdinal, ppImportTableItem)) if (void* ppImportTableItem{}; find_imported_function_pointer(pcszDllName, pcszFunctionName, hintOrOrdinal, ppImportTableItem))
return ppImportTableItem; return ppImportTableItem;
throw std::runtime_error("Failed to find import for kernel32!OpenProcess."); throw std::runtime_error(std::format("Failed to find import for {}!{} ({}).", pcszDllName, pcszFunctionName ? pcszFunctionName : "<unnamed>", hintOrOrdinal));
} }
utils::loaded_module utils::loaded_module::current_process() { utils::loaded_module utils::loaded_module::current_process() {