Skip to content

Commit 0da82d3

Browse files
committed
ElfLoader: Don't scan for functions in zero-length sections
We end up scanning a crazy range from 0 to 0xFFFFFFFFC, which causes problems. Happens in WWE: Smackdown Vs Raw 2009 during initial load.
1 parent 90ea424 commit 0da82d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Core/HLE/sceKernelModule.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,10 @@ static PSPModule *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 load
14121412
// Note: scan end is inclusive.
14131413
u32 end = start + reader.GetSectionSize(id) - 4;
14141414
u32 len = end + 4 - start;
1415+
if (len == 0) {
1416+
// Seen in WWE: Smackdown vs Raw 2009. See #17435.
1417+
continue;
1418+
}
14151419
if (!Memory::IsValidRange(start, len)) {
14161420
ERROR_LOG(LOADER, "Bad section %08x (len %08x) of section %d", start, len, id);
14171421
continue;

0 commit comments

Comments
 (0)