From a9ae8163d3b89db2f68df32bafa6a9d170ed2e4b Mon Sep 17 00:00:00 2001 From: Garoxas Date: Fri, 21 Sep 2018 11:14:52 +0700 Subject: [PATCH] fallback if MasterKey revision not supported by hactool --- XCI_Explorer/MainForm.cs | 9 ++++++++- XCI_Explorer/Util.cs | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/XCI_Explorer/MainForm.cs b/XCI_Explorer/MainForm.cs index 9574dd4..8c912ca 100644 --- a/XCI_Explorer/MainForm.cs +++ b/XCI_Explorer/MainForm.cs @@ -501,7 +501,14 @@ namespace XCI_Explorer { TB_SDKVer.Text = strArray[1].Trim(); } else if (strArray[0] == "Master Key Revision") { - TB_MKeyRev.Text = "MasterKey" + strArray[1].Trim(); + string MasterKey = strArray[1].Trim(); + if (MasterKey.Contains("Unknown")) { + int keyblob; + if (int.TryParse(new string(MasterKey.TakeWhile(Char.IsDigit).ToArray()), out keyblob)) { + MasterKey = Util.GetMkey((byte)(keyblob + 1)).Replace("MasterKey", ""); + } + } + TB_MKeyRev.Text = "MasterKey" + MasterKey; break; } } diff --git a/XCI_Explorer/Util.cs b/XCI_Explorer/Util.cs index 60b7d80..d919015 100644 --- a/XCI_Explorer/Util.cs +++ b/XCI_Explorer/Util.cs @@ -33,9 +33,9 @@ namespace XCI_Explorer { case 4: return "MasterKey3 (4.0.0-4.1.0)"; case 5: - return "MasterKey4 (5.0.0+)"; + return "MasterKey4 (5.0.0-5.1.0)"; case 6: - return "MasterKey5 (?)"; + return "MasterKey5 (6.0.0)"; case 7: return "MasterKey6 (?)"; case 8: