From b9b3669798fab58fca86309a4ac652e97cd98116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 26 Jun 2025 13:23:15 +0200 Subject: [PATCH 1/2] Log the name of started modules --- Core/HLE/sceKernelModule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index fb2970a936..78f559d89a 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -2074,7 +2074,7 @@ static u32 sceKernelStartModule(u32 moduleId, u32 argsize, u32 argAddr, u32 retu module->nm.status = MODULE_STATUS_STARTING; module->waitingThreads.push_back(mwt); } - return hleLogInfo(Log::sceModule, ret); + return hleLogInfo(Log::sceModule, ret, "'%.*s'", (int)sizeof(module->nm.name), module->nm.name); } } From df23d178e5db318fe9d5d427146e81a262d9f36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 26 Jun 2025 14:25:04 +0200 Subject: [PATCH 2/2] Module loading: Also check plain ELF modules if they should be HLE:d. - Fixes #20568 --- Core/HLE/sceKernelModule.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Core/HLE/sceKernelModule.cpp b/Core/HLE/sceKernelModule.cpp index 78f559d89a..2efecb0285 100644 --- a/Core/HLE/sceKernelModule.cpp +++ b/Core/HLE/sceKernelModule.cpp @@ -1244,6 +1244,13 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load modinfo = (const PspModuleInfo *)Memory::GetPointerUnchecked(modinfoaddr); + // OK, even if it's an ELF module, it might be one we shouldn't fully load and execute! + // This is seen with mpeg.prx in Tony Hawk's Underground 2, see #20568. + if (ShouldHLEModule(modinfo->name)) { + // We load it, but at least we don't run any part of it. + module->isFake = true; + } + module->nm.nsegment = reader.GetNumSegments(); module->nm.attribute = modinfo->moduleAttrs; module->nm.version[0] = modinfo->moduleVersion & 0xFF;