From 4f92df89187f7726b55d8707f29a6bb1be026c28 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Mon, 2 Feb 2015 22:31:46 -0800 Subject: [PATCH] XexGetModuleHandle(nullptr,) support. --- src/xenia/kernel/xboxkrnl_modules.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/xboxkrnl_modules.cc b/src/xenia/kernel/xboxkrnl_modules.cc index b7fdb6eda..aff15fa4b 100644 --- a/src/xenia/kernel/xboxkrnl_modules.cc +++ b/src/xenia/kernel/xboxkrnl_modules.cc @@ -156,7 +156,12 @@ SHIM_CALL XexGetModuleHandle_shim(PPCContext* ppc_state, KernelState* state) { XELOGD("XexGetModuleHandle(%s, %.8X)", module_name, module_handle_ptr); - XModule* module = state->GetModule(module_name); + XModule* module = nullptr; + if (!module_name) { + module = state->GetExecutableModule(); + } else { + module = state->GetModule(module_name); + } if (!module) { SHIM_SET_RETURN_32(X_ERROR_NOT_FOUND); return;