From c96799035d17522777035d0833ebbff789fad5fb Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Mon, 27 May 2024 21:45:10 -0700 Subject: [PATCH] Read some improperly named save data keys --- src/LibHac/Common/Keys/DefaultKeySet.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/LibHac/Common/Keys/DefaultKeySet.cs b/src/LibHac/Common/Keys/DefaultKeySet.cs index b20925c5..d23efa5e 100644 --- a/src/LibHac/Common/Keys/DefaultKeySet.cs +++ b/src/LibHac/Common/Keys/DefaultKeySet.cs @@ -186,6 +186,10 @@ internal static partial class DefaultKeySet keys.Add(new KeyInfo(250, Type.CommonSeed, "save_mac_kek_source", (set, _) => set.DeviceUniqueSaveMacKekSource)); keys.Add(new KeyInfo(251, Type.CommonSeed, "save_mac_key_source", 0, 2, (set, i) => set.DeviceUniqueSaveMacKeySources[i])); keys.Add(new KeyInfo(252, Type.DeviceDrvd, "save_mac_key", 0, 2, (set, i) => set.DeviceUniqueSaveMacKeys[i])); + + // Some old programs exported only the first set of save mac keys/sources without the _00 suffix in the key name. + // Support reading these keys for compatibility but not writing them. + keys.Add(new KeyInfo(-01, Type.CommonSeed, "save_mac_key", (set, _) => set.DeviceUniqueSaveMacKeys[0])); keys.Add(new KeyInfo(-01, Type.CommonSeed, "save_mac_key_source", (set, _) => set.DeviceUniqueSaveMacKeySources[0])); keys.Add(new KeyInfo(253, Type.CommonSeed, "save_mac_sd_card_kek_source", (set, _) => set.SeedUniqueSaveMacKekSource));