From 5c7f42e9d1f08a491a9ae4c4f25b4b4ffce3e706 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Sun, 19 Jul 2015 10:55:12 -0700 Subject: [PATCH] Fix for unknown kernel modules. --- src/xenia/cpu/xex_module.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/xenia/cpu/xex_module.cc b/src/xenia/cpu/xex_module.cc index 712f6fa53..b507e0a07 100644 --- a/src/xenia/cpu/xex_module.cc +++ b/src/xenia/cpu/xex_module.cc @@ -339,12 +339,11 @@ bool XexModule::SetupLibraryImports(const char* name, if (kernel_resolver) { kernel_export = kernel_resolver->GetExportByOrdinal(name, ordinal); - } else { + } else if (user_module) { user_export_addr = user_module->GetProcAddressByOrdinal(ordinal); } // Import not resolved? - assert_not_zero(kernel_export || user_export_addr); if (!kernel_export && !user_export_addr) { XELOGW( "WARNING: an import variable was not resolved! (library: %s, import " @@ -358,7 +357,7 @@ bool XexModule::SetupLibraryImports(const char* name, import_name.AppendFormat("__imp__"); if (kernel_export) { import_name.AppendFormat("%s", kernel_export->name); - } else if (user_export_addr) { + } else { import_name.AppendFormat("%s_%.3X", libbasename.c_str(), ordinal); } @@ -396,7 +395,7 @@ bool XexModule::SetupLibraryImports(const char* name, // Thunk. if (kernel_export) { import_name.AppendFormat("%s", kernel_export->name); - } else if (user_export_addr) { + } else { import_name.AppendFormat("__%s_%.3X", libbasename.c_str(), ordinal); }