diff options
Diffstat (limited to 'LibTSforge/Modifiers')
| -rw-r--r-- | LibTSforge/Modifiers/KeyChangeLockDelete.cs | 3 | ||||
| -rw-r--r-- | LibTSforge/Modifiers/RearmReset.cs | 13 | ||||
| -rw-r--r-- | LibTSforge/Modifiers/TamperedFlagsDelete.cs | 17 |
3 files changed, 24 insertions, 9 deletions
diff --git a/LibTSforge/Modifiers/KeyChangeLockDelete.cs b/LibTSforge/Modifiers/KeyChangeLockDelete.cs index 5150a41..3883d3c 100644 --- a/LibTSforge/Modifiers/KeyChangeLockDelete.cs +++ b/LibTSforge/Modifiers/KeyChangeLockDelete.cs @@ -5,11 +5,14 @@ namespace LibTSforge.Modifiers using LibTSforge.PhysicalStore; using LibTSforge.SPP; using LibTSforge; + using System; public static class KeyChangeLockDelete { public static void Delete(PSVersion version, bool production) { + if (version == PSVersion.Vista) throw new NotSupportedException("This feature is not supported on Windows Vista/Server 2008."); + SPPUtils.KillSPP(version); Logger.WriteLine("Writing TrustedStore data..."); using (IPhysicalStore store = SPPUtils.GetStore(version, production)) diff --git a/LibTSforge/Modifiers/RearmReset.cs b/LibTSforge/Modifiers/RearmReset.cs index a17c005..4b611b6 100644 --- a/LibTSforge/Modifiers/RearmReset.cs +++ b/LibTSforge/Modifiers/RearmReset.cs @@ -2,6 +2,7 @@ namespace LibTSforge.Modifiers { using System; using System.Collections.Generic; + using System.Data; using System.Linq; using LibTSforge.PhysicalStore; using LibTSforge.SPP; @@ -18,7 +19,11 @@ namespace LibTSforge.Modifiers { List<PSBlock> blocks; - if (version == PSVersion.Win7) + if (version == PSVersion.Vista) + { + blocks = store.FindBlocks("740D70D8-6448-4b2f-9063-4A7A463600C5").ToList(); + } + else if (version == PSVersion.Win7) { blocks = store.FindBlocks(0xA0000).ToList(); } @@ -29,7 +34,11 @@ namespace LibTSforge.Modifiers foreach (PSBlock block in blocks) { - if (version == PSVersion.Win7) + if (version == PSVersion.Vista) + { + store.DeleteBlock(block.KeyAsStr, block.ValueAsStr); + } + else if (version == PSVersion.Win7) { store.SetBlock(block.KeyAsStr, block.ValueAsInt, new byte[8]); } diff --git a/LibTSforge/Modifiers/TamperedFlagsDelete.cs b/LibTSforge/Modifiers/TamperedFlagsDelete.cs index 55ba1ec..ecd9267 100644 --- a/LibTSforge/Modifiers/TamperedFlagsDelete.cs +++ b/LibTSforge/Modifiers/TamperedFlagsDelete.cs @@ -15,21 +15,24 @@ namespace LibTSforge.Modifiers using (IPhysicalStore store = SPPUtils.GetStore(version, production)) { - if (version != PSVersion.Win7) + if (version == PSVersion.Vista) { - string recreatedFlag = "__##USERSEP-RESERVED##__$$RECREATED-FLAG$$"; - string recoveredFlag = "__##USERSEP-RESERVED##__$$RECOVERED-FLAG$$"; - - DeleteFlag(store, recreatedFlag); - DeleteFlag(store, recoveredFlag); + DeleteFlag(store, "6BE8425B-E3CF-4e86-A6AF-5863E3DCB606"); } - else + else if (version == PSVersion.Win7) { SetFlag(store, 0xA0001); } + else + { + DeleteFlag(store, "__##USERSEP-RESERVED##__$$RECREATED-FLAG$$"); + DeleteFlag(store, "__##USERSEP-RESERVED##__$$RECOVERED-FLAG$$"); + } Logger.WriteLine("Successfully cleared the tamper state."); } + + SPPUtils.RestartSPP(version); } private static void DeleteFlag(IPhysicalStore store, string flag) |
