From f80e489638871710d79708457f04e7d9dc19ae82 Mon Sep 17 00:00:00 2001 From: sum2012 Date: Thu, 6 Nov 2025 22:17:35 +0800 Subject: [PATCH] Fix pgd_offset By miniMax AI while debuging scemp4 .When PGD decryption failed for .edat files, the pgd_offset variable was not being reset to 0. This caused subsequent file reads to access the wrong file position --- Core/HLE/sceIo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index e9805cd5c5..85ba58936e 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -2588,6 +2588,7 @@ int __IoIoctl(u32 id, u32 cmd, u32 indataPtr, u32 inlen, u32 outdataPtr, u32 out f->pgdInfo = pgd_open(kirk, pgd_header, 2, key_ptr); if (!f->pgdInfo) { f->npdrm = false; + f->pgd_offset = 0; // Reset PGD offset so file can be read as regular file pspFileSystem.SeekFile(f->handle, (s32)0, FILEMOVE_BEGIN); if (memcmp(pgd_header, pgd_magic, 4) == 0) { // File is PGD file, but key mismatch