From ae23222ba8bb4e386df56fa77fc35215a53c89a9 Mon Sep 17 00:00:00 2001 From: Adrian <78108584+AdrianCassar@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:10:43 +0000 Subject: [PATCH] [Emulator] Validate module is an executable before launching --- src/xenia/emulator.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/xenia/emulator.cc b/src/xenia/emulator.cc index 81a4ae1b7..adb58570f 100644 --- a/src/xenia/emulator.cc +++ b/src/xenia/emulator.cc @@ -1372,6 +1372,12 @@ X_STATUS Emulator::CompleteLaunch(const std::filesystem::path& path, return X_STATUS_NOT_FOUND; } + if (!module->is_executable()) { + kernel_state_->UnloadUserModule(module, false); + XELOGE("Failed to load user module {}", path); + return X_STATUS_NOT_SUPPORTED; + } + X_RESULT result = kernel_state_->ApplyTitleUpdate(module); if (XFAILED(result)) { XELOGE("Failed to apply title update! Cannot run module {}", path);