Don't attempt to LLE the full contents of sys_modules when param.sfo is missing (#4632)

This commit is contained in:
kalaposfos13 2026-06-27 15:57:54 +02:00 committed by GitHub
parent 463fe06dce
commit bd741ec57f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -190,21 +190,23 @@ s32 loadModuleInternal(s32 index, s32 argc, const void* argv, s32* res_out) {
// Now we need to check if the requested library is allowed to LLE.
// First, we allow all modules from game-specific sys_modules
const auto& sys_module_path = EmulatorSettings.GetSysModulesDir();
const auto& game_specific_module_path =
sys_module_path / game_info->GameSerial() / mod_name;
if (std::filesystem::exists(game_specific_module_path)) {
// The requested module is present in the game-specific sys_modules, load it.
LOG_INFO(Loader, "Loading {} from game serial file {}", mod_name,
game_info->GameSerial());
s32 handle =
linker->LoadAndStartModule(game_specific_module_path, argc, argv, &start_result);
ASSERT_MSG(handle >= 0, "Failed to load module {}", mod_name);
mod.handle = handle;
mod.is_loaded++;
if (res_out != nullptr) {
*res_out = start_result;
if (!game_info->GameSerial().empty()) {
const auto& game_specific_module_path =
sys_module_path / game_info->GameSerial() / mod_name;
if (std::filesystem::exists(game_specific_module_path)) {
// The requested module is present in the game-specific sys_modules, load it.
LOG_INFO(Loader, "Loading {} from game serial file {}", mod_name,
game_info->GameSerial());
s32 handle = linker->LoadAndStartModule(game_specific_module_path, argc, argv,
&start_result);
ASSERT_MSG(handle >= 0, "Failed to load module {}", mod_name);
mod.handle = handle;
mod.is_loaded++;
if (res_out != nullptr) {
*res_out = start_result;
}
return ORBIS_OK;
}
return ORBIS_OK;
}
// We need to check a few things here.