TSforge/LibTSforge/Modifiers/GracePeriodReset.cs
WitherOrNot 6d759899d8 Add partial support (zcid, rtmr, non-functional kms4k) for vista
Co-authored-by: InvoxiPlayGames <22731889+InvoxiPlayGames@users.noreply.github.com>
2025-03-01 02:06:21 -05:00

32 lines
947 B
C#

namespace LibTSforge.Modifiers
{
using System;
using System.Collections.Generic;
using System.Linq;
using LibTSforge.PhysicalStore;
using LibTSforge.SPP;
public static class GracePeriodReset
{
public static void Reset(PSVersion version, bool production)
{
SPPUtils.KillSPP(version);
Logger.WriteLine("Writing TrustedStore data...");
using (IPhysicalStore store = SPPUtils.GetStore(version, production))
{
string value = "msft:sl/timer";
List<PSBlock> blocks = store.FindBlocks(value).ToList();
foreach (PSBlock block in blocks)
{
store.DeleteBlock(block.KeyAsStr, block.ValueAsStr);
}
}
SPPUtils.RestartSPP(version);
Logger.WriteLine("Successfully reset all grace and evaluation period timers.");
}
}
}