fix vista kms4k, add reset support

This commit is contained in:
2025-03-02 19:02:36 -05:00
parent 6d759899d8
commit f2ad15e5a2
6 changed files with 42 additions and 16 deletions

View File

@ -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]);
}