VERY experimental Nintendo Switch 2 emulator
C++
partition_data_manager: Eliminate magic value
Lioncashc4f913026498
diff --git a/src/core/crypto/partition_data_manager.cpp b/src/core/crypto/partition_data_manager.cppindex b31a815607..c5c073e70b 100644--- a/src/core/crypto/partition_data_manager.cpp+++ b/src/core/crypto/partition_data_manager.cpp@@ -349,8 +349,8 @@ static bool AttemptDecrypt(const std::array<u8, 16>& key, Package2Header& headerPackage2Header temp = header;AESCipher<Key128> cipher(key, Mode::CTR);cipher.SetIV(header.header_ctr);- cipher.Transcode(&temp.header_ctr, sizeof(Package2Header) - 0x100, &temp.header_ctr,- Op::Decrypt);+ cipher.Transcode(&temp.header_ctr, sizeof(Package2Header) - sizeof(Package2Header::signature),+ &temp.header_ctr, Op::Decrypt);if (temp.magic == Common::MakeMagic('P', 'K', '2', '1')) {header = temp;return true;