From ad22cf5051cab71530b49f2595185cfd2ba51464 Mon Sep 17 00:00:00 2001 From: brian218 Date: Thu, 8 Jun 2023 23:00:00 +0800 Subject: [PATCH] unself.cpp: Always reset the old SELF header information before loading --- rpcs3/Crypto/unself.cpp | 4 ++-- rpcs3/Emu/System.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rpcs3/Crypto/unself.cpp b/rpcs3/Crypto/unself.cpp index f118ea1a27..16cbf0cb1c 100644 --- a/rpcs3/Crypto/unself.cpp +++ b/rpcs3/Crypto/unself.cpp @@ -871,7 +871,7 @@ bool SELFDecrypter::LoadHeaders(bool isElf32, SelfAdditionalInfo* out_info) if (out_info) { - out_info->valid = false; + *out_info = {}; } // Check SCE magic. @@ -1411,7 +1411,7 @@ fs::file decrypt_self(fs::file elf_or_self, u8* klic_key, SelfAdditionalInfo* ou { if (out_info) { - out_info->valid = false; + *out_info = {}; } if (!elf_or_self) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index df73f1ff91..7b09fd8a18 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -3460,7 +3460,7 @@ utils::serial* Emulator::DeserialManager() const bool Emulator::IsVsh() { - return g_ps3_process_info.self_info.prog_id_hdr.program_authority_id >> 52 == 0x107; // Not only VSH but also most CoreOS LV2 SELFs need the special treatment + return g_ps3_process_info.self_info.valid && (g_ps3_process_info.self_info.prog_id_hdr.program_authority_id >> 52 == 0x107); // Not only VSH but also most CoreOS LV2 SELFs need the special treatment } bool Emulator::IsValidSfb(const std::string& path)