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
This commit is contained in:
sum2012
2025-11-06 22:17:35 +08:00
parent fee7b1d2a6
commit f80e489638
+1
View File
@@ -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