From 0d59561bee4cf7db10d53a8aa58952ae65e856b5 Mon Sep 17 00:00:00 2001 From: Wither OrNot Date: Thu, 13 Feb 2025 09:49:35 -0500 Subject: Initial commit Co-authored-by: neko <109633131+nekoppai@users.noreply.github.com> Co-authored-by: Lyssa <75037904+thecatontheceiling@users.noreply.github.com> Co-authored-by: abbodi1406 <33669284+abbodi1406@users.noreply.github.com> --- LibTSforge/Modifiers/KeyChangeLockDelete.cs | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 LibTSforge/Modifiers/KeyChangeLockDelete.cs (limited to 'LibTSforge/Modifiers/KeyChangeLockDelete.cs') diff --git a/LibTSforge/Modifiers/KeyChangeLockDelete.cs b/LibTSforge/Modifiers/KeyChangeLockDelete.cs new file mode 100644 index 0000000..e3f32c4 --- /dev/null +++ b/LibTSforge/Modifiers/KeyChangeLockDelete.cs @@ -0,0 +1,33 @@ +namespace LibTSforge.Modifiers +{ + using System.Collections.Generic; + using System.Linq; + using LibTSforge.PhysicalStore; + using LibTSforge; + public static class KeyChangeLockDelete + { + public static void Delete(PSVersion version, bool production) + { + Utils.KillSPP(); + Logger.WriteLine("Writing TrustedStore data..."); + using (IPhysicalStore store = Utils.GetStore(version, production)) + { + List values = new List + { + "msft:spp/timebased/AB", + "msft:spp/timebased/CD" + }; + List blocks = new List(); + foreach (string value in values) + { + blocks.AddRange(store.FindBlocks(value).ToList()); + } + foreach (PSBlock block in blocks) + { + store.DeleteBlock(block.KeyAsStr, block.ValueAsStr); + } + } + Logger.WriteLine("Successfully removed the key change lock."); + } + } +} -- cgit v1.2.3