From fff19e75fdfa35923122206edc63d6f53a66af3f Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 2 Aug 2018 12:38:29 -0700 Subject: [PATCH] Fix XBOX security sector format --- DICUI/Utilities/DumpEnvironment.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/DICUI/Utilities/DumpEnvironment.cs b/DICUI/Utilities/DumpEnvironment.cs index e9108847..cfce585e 100644 --- a/DICUI/Utilities/DumpEnvironment.cs +++ b/DICUI/Utilities/DumpEnvironment.cs @@ -1282,12 +1282,18 @@ namespace DICUI.Utilities while (!sr.ReadLine().Trim().StartsWith("Number of security sector ranges:")) ; // Now that we're at the ranges, read each line in and concatenate - // TODO: Make this output like the old method (startlba-endlba) - string line = sr.ReadLine(); - while (!line.Trim().StartsWith("========== Unlock 2 state(wxripper) ==========")) + string line = sr.ReadLine().Trim(); + Regex r = new Regex(@"Layer [01]\s*Unknown:.*, startLBA:\s*(\d+), endLBA:\s*(\d+)"); + while (!line.StartsWith("========== Unlock 2 state(wxripper) ==========")) { - ss += line + "\n"; - line = sr.ReadLine(); + // If we have a recognized line format, parse it + if (line.StartsWith("Layer ")) + { + var match = r.Match(line); + ss += $"{match.Groups[1]}-{match.Groups[2]}\n"; + } + + line = sr.ReadLine().Trim(); } // Fast forward to the aux hashes