[Emulator] Validate module is an executable before launching

This commit is contained in:
Adrian 2025-01-16 20:10:43 +00:00 committed by Radosław Gliński
parent d99d053408
commit ae23222ba8
1 changed files with 6 additions and 0 deletions

View File

@ -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);