diff --git a/src/LibHac.Nand/Nand.cs b/src/LibHac.Nand/Nand.cs index 23334077..5ef87f82 100644 --- a/src/LibHac.Nand/Nand.cs +++ b/src/LibHac.Nand/Nand.cs @@ -24,7 +24,7 @@ namespace LibHac.Nand GuidPartitionInfo[] partitions = disc.Partitions.Select(x => (GuidPartitionInfo)x).ToArray(); ProdInfo = partitions.FirstOrDefault(x => x.Name == "PRODINFO"); ProdInfoF = partitions.FirstOrDefault(x => x.Name == "PRODINFOF"); - Package2 = new GuidPartitionInfo[] + Package2 = new[] { partitions.FirstOrDefault(x => x.Name == "BCPKG2-1-Normal-Main"), partitions.FirstOrDefault(x => x.Name == "BCPKG2-2-Normal-Sub"), diff --git a/src/LibHac/Keyset.cs b/src/LibHac/Keyset.cs index a82a3fae..9dbdb078 100644 --- a/src/LibHac/Keyset.cs +++ b/src/LibHac/Keyset.cs @@ -213,9 +213,9 @@ namespace LibHac { for (int i = UsedKeyblobCount; i < 0x20; i++) { - if (TsecRootKeys[i].IsEmpty() || MasterKekSources[i].IsEmpty()) continue; + if (TsecRootKeys[i - UsedKeyblobCount].IsEmpty() || MasterKekSources[i].IsEmpty()) continue; - Crypto.DecryptEcb(TsecRootKeys[i], MasterKekSources[i], MasterKeks[i], 0x10); + Crypto.DecryptEcb(TsecRootKeys[i - UsedKeyblobCount], MasterKekSources[i], MasterKeks[i], 0x10); } } @@ -570,9 +570,7 @@ namespace LibHac new KeyValue("ssl_rsa_kek", 0x10, 120, set => set.SslRsaKek), new KeyValue("xci_header_key", 0x10, 130, set => set.XciHeaderKey), - new KeyValue("header_key", 0x20, 220, set => set.HeaderKey), - - new KeyValue("tsec_root_key", 0x10, -1, set => set.TsecRootKeys[6]) + new KeyValue("header_key", 0x20, 220, set => set.HeaderKey) }; for (int slot = 0; slot < 0x20; slot++)