Fixed an issue with TSforge caused by updated pkeyconfig on 22631.5840. Thanks to WitherOrNot for the fix.

This commit is contained in:
WindowsAddict 2025-09-10 01:44:23 +05:30
parent a8f6d051a6
commit caffa62abe
2 changed files with 80 additions and 62 deletions

View File

@ -6322,7 +6322,7 @@ using System.Xml.Linq;
}
#endif
// Common.cs
// LibTSforge/Common.cs
namespace LibTSforge
{
using System;
@ -6564,7 +6564,7 @@ namespace LibTSforge
}
// SPP/PKeyConfig.cs
// LibTSforge/SPP/PKeyConfig.cs
namespace LibTSforge.SPP
{
using System;
@ -6590,7 +6590,7 @@ namespace LibTSforge.SPP
public bool Contains(int n)
{
return Start <= n && End <= n;
return Start <= n && n <= End;
}
}
@ -6720,10 +6720,19 @@ namespace LibTSforge.SPP
string refActIdStr = configNode.SelectSingleNode("./p:ActConfigId", nsmgr).InnerText;
Guid refActId = new Guid(refActIdStr);
int group = int.Parse(configNode.SelectSingleNode("./p:RefGroupId", nsmgr).InnerText);
List<KeyRange> keyRanges = ranges[refActIdStr];
List<KeyRange> keyRanges;
ranges.TryGetValue(refActIdStr, out keyRanges);
if (keyRanges == null)
{
continue;
}
if (keyRanges.Count > 0 && !Products.ContainsKey(refActId))
{
PKeyAlgorithm algorithm;
algorithms.TryGetValue(group, out algorithm);
ProductConfig productConfig = new ProductConfig
{
GroupId = group,
@ -6731,7 +6740,7 @@ namespace LibTSforge.SPP
Description = configNode.SelectSingleNode("./p:ProductDescription", nsmgr).InnerText,
Channel = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText,
Randomized = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText.ToLower() == "true",
Algorithm = algorithms[group],
Algorithm = algorithm,
Ranges = keyRanges,
ActivationId = refActId
};
@ -6781,7 +6790,7 @@ namespace LibTSforge.SPP
}
// SPP/ProductKey.cs
// LibTSforge/SPP/ProductKey.cs
namespace LibTSforge.SPP
{
using System;
@ -7097,7 +7106,7 @@ namespace LibTSforge.SPP
}
// SPP/SLAPI.cs
// LibTSforge/SPP/SLAPI.cs
namespace LibTSforge.SPP
{
using System;
@ -7510,7 +7519,7 @@ namespace LibTSforge.SPP
}
// SPP/SPPUtils.cs
// LibTSforge/SPP/SPPUtils.cs
namespace LibTSforge.SPP
{
using Microsoft.Win32;
@ -7847,7 +7856,7 @@ namespace LibTSforge.SPP
}
// SPP/SPSys.cs
// LibTSforge/SPP/SPSys.cs
namespace LibTSforge.SPP
{
using Microsoft.Win32.SafeHandles;
@ -7894,7 +7903,7 @@ namespace LibTSforge.SPP
}
// Crypto/CryptoUtils.cs
// LibTSforge/Crypto/CryptoUtils.cs
namespace LibTSforge.Crypto
{
using System;
@ -8029,7 +8038,7 @@ namespace LibTSforge.Crypto
}
// Crypto/Keys.cs
// LibTSforge/Crypto/Keys.cs
namespace LibTSforge.Crypto
{
public static class Keys
@ -8119,7 +8128,7 @@ namespace LibTSforge.Crypto
}
// Crypto/PhysStoreCrypto.cs
// LibTSforge/Crypto/PhysStoreCrypto.cs
namespace LibTSforge.Crypto
{
using System;
@ -8204,7 +8213,7 @@ namespace LibTSforge.Crypto
}
// Modifiers/GenPKeyInstall.cs
// LibTSforge/Modifiers/GenPKeyInstall.cs
namespace LibTSforge.Modifiers
{
using System;
@ -8415,7 +8424,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/GracePeriodReset.cs
// LibTSforge/Modifiers/GracePeriodReset.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@ -8448,7 +8457,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/KeyChangeLockDelete.cs
// LibTSforge/Modifiers/KeyChangeLockDelete.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@ -8488,7 +8497,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/KMSHostCharge.cs
// LibTSforge/Modifiers/KMSHostCharge.cs
namespace LibTSforge.Modifiers
{
using System;
@ -8649,7 +8658,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/RearmReset.cs
// LibTSforge/Modifiers/RearmReset.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@ -8705,7 +8714,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/SetIIDParams.cs
// LibTSforge/Modifiers/SetIIDParams.cs
namespace LibTSforge.Modifiers
{
using PhysicalStore;
@ -8774,7 +8783,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/TamperedFlagsDelete.cs
// LibTSforge/Modifiers/TamperedFlagsDelete.cs
namespace LibTSforge.Modifiers
{
using System.Linq;
@ -8824,7 +8833,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/UniqueIdDelete.cs
// LibTSforge/Modifiers/UniqueIdDelete.cs
namespace LibTSforge.Modifiers
{
using System;
@ -8883,7 +8892,7 @@ namespace LibTSforge.Modifiers
}
// Activators/KMS4K.cs
// LibTSforge/Activators/KMS4K.cs
namespace LibTSforge.Activators
{
using System;
@ -9094,7 +9103,7 @@ namespace LibTSforge.Activators
}
// Activators/ZeroCID.cs
// LibTSforge/Activators/ZeroCID.cs
namespace LibTSforge.Activators
{
using System;
@ -9283,7 +9292,7 @@ namespace LibTSforge.Activators
}
// TokenStore/Common.cs
// LibTSforge/TokenStore/Common.cs
namespace LibTSforge.TokenStore
{
using System.Collections.Generic;
@ -9353,7 +9362,7 @@ namespace LibTSforge.TokenStore
}
// TokenStore/ITokenStore.cs
// LibTSforge/TokenStore/ITokenStore.cs
namespace LibTSforge.TokenStore
{
using System;
@ -9373,7 +9382,7 @@ namespace LibTSforge.TokenStore
}
// TokenStore/TokenStoreModern.cs
// LibTSforge/TokenStore/TokenStoreModern.cs
namespace LibTSforge.TokenStore
{
using System;
@ -9659,7 +9668,7 @@ namespace LibTSforge.TokenStore
}
// PhysicalStore/Common.cs
// LibTSforge/PhysicalStore/Common.cs
namespace LibTSforge.PhysicalStore
{
using System.Runtime.InteropServices;
@ -9690,7 +9699,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/IPhysicalStore.cs
// LibTSforge/PhysicalStore/IPhysicalStore.cs
namespace LibTSforge.PhysicalStore
{
using System;
@ -9785,7 +9794,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreModern.cs
// LibTSforge/PhysicalStore/PhysicalStoreModern.cs
namespace LibTSforge.PhysicalStore
{
using System;
@ -10203,7 +10212,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreVista.cs
// LibTSforge/PhysicalStore/PhysicalStoreVista.cs
namespace LibTSforge.PhysicalStore
{
using System;
@ -10562,7 +10571,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreWin7.cs
// LibTSforge/PhysicalStore/PhysicalStoreWin7.cs
namespace LibTSforge.PhysicalStore
{
using System;
@ -10939,7 +10948,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/VariableBag.cs
// LibTSforge/PhysicalStore/VariableBag.cs
namespace LibTSforge.PhysicalStore
{
using System;

View File

@ -3954,7 +3954,7 @@ using System.Xml.Linq;
}
#endif
// Common.cs
// LibTSforge/Common.cs
namespace LibTSforge
{
using System;
@ -4196,7 +4196,7 @@ namespace LibTSforge
}
// SPP/PKeyConfig.cs
// LibTSforge/SPP/PKeyConfig.cs
namespace LibTSforge.SPP
{
using System;
@ -4222,7 +4222,7 @@ namespace LibTSforge.SPP
public bool Contains(int n)
{
return Start <= n && End <= n;
return Start <= n && n <= End;
}
}
@ -4352,10 +4352,19 @@ namespace LibTSforge.SPP
string refActIdStr = configNode.SelectSingleNode("./p:ActConfigId", nsmgr).InnerText;
Guid refActId = new Guid(refActIdStr);
int group = int.Parse(configNode.SelectSingleNode("./p:RefGroupId", nsmgr).InnerText);
List<KeyRange> keyRanges = ranges[refActIdStr];
List<KeyRange> keyRanges;
ranges.TryGetValue(refActIdStr, out keyRanges);
if (keyRanges == null)
{
continue;
}
if (keyRanges.Count > 0 && !Products.ContainsKey(refActId))
{
PKeyAlgorithm algorithm;
algorithms.TryGetValue(group, out algorithm);
ProductConfig productConfig = new ProductConfig
{
GroupId = group,
@ -4363,7 +4372,7 @@ namespace LibTSforge.SPP
Description = configNode.SelectSingleNode("./p:ProductDescription", nsmgr).InnerText,
Channel = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText,
Randomized = configNode.SelectSingleNode("./p:ProductKeyType", nsmgr).InnerText.ToLower() == "true",
Algorithm = algorithms[group],
Algorithm = algorithm,
Ranges = keyRanges,
ActivationId = refActId
};
@ -4413,7 +4422,7 @@ namespace LibTSforge.SPP
}
// SPP/ProductKey.cs
// LibTSforge/SPP/ProductKey.cs
namespace LibTSforge.SPP
{
using System;
@ -4729,7 +4738,7 @@ namespace LibTSforge.SPP
}
// SPP/SLAPI.cs
// LibTSforge/SPP/SLAPI.cs
namespace LibTSforge.SPP
{
using System;
@ -5142,7 +5151,7 @@ namespace LibTSforge.SPP
}
// SPP/SPPUtils.cs
// LibTSforge/SPP/SPPUtils.cs
namespace LibTSforge.SPP
{
using Microsoft.Win32;
@ -5479,7 +5488,7 @@ namespace LibTSforge.SPP
}
// SPP/SPSys.cs
// LibTSforge/SPP/SPSys.cs
namespace LibTSforge.SPP
{
using Microsoft.Win32.SafeHandles;
@ -5526,7 +5535,7 @@ namespace LibTSforge.SPP
}
// Crypto/CryptoUtils.cs
// LibTSforge/Crypto/CryptoUtils.cs
namespace LibTSforge.Crypto
{
using System;
@ -5661,7 +5670,7 @@ namespace LibTSforge.Crypto
}
// Crypto/Keys.cs
// LibTSforge/Crypto/Keys.cs
namespace LibTSforge.Crypto
{
public static class Keys
@ -5751,7 +5760,7 @@ namespace LibTSforge.Crypto
}
// Crypto/PhysStoreCrypto.cs
// LibTSforge/Crypto/PhysStoreCrypto.cs
namespace LibTSforge.Crypto
{
using System;
@ -5836,7 +5845,7 @@ namespace LibTSforge.Crypto
}
// Modifiers/GenPKeyInstall.cs
// LibTSforge/Modifiers/GenPKeyInstall.cs
namespace LibTSforge.Modifiers
{
using System;
@ -6047,7 +6056,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/GracePeriodReset.cs
// LibTSforge/Modifiers/GracePeriodReset.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@ -6080,7 +6089,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/KeyChangeLockDelete.cs
// LibTSforge/Modifiers/KeyChangeLockDelete.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@ -6120,7 +6129,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/KMSHostCharge.cs
// LibTSforge/Modifiers/KMSHostCharge.cs
namespace LibTSforge.Modifiers
{
using System;
@ -6281,7 +6290,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/RearmReset.cs
// LibTSforge/Modifiers/RearmReset.cs
namespace LibTSforge.Modifiers
{
using System.Collections.Generic;
@ -6337,7 +6346,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/SetIIDParams.cs
// LibTSforge/Modifiers/SetIIDParams.cs
namespace LibTSforge.Modifiers
{
using PhysicalStore;
@ -6406,7 +6415,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/TamperedFlagsDelete.cs
// LibTSforge/Modifiers/TamperedFlagsDelete.cs
namespace LibTSforge.Modifiers
{
using System.Linq;
@ -6456,7 +6465,7 @@ namespace LibTSforge.Modifiers
}
// Modifiers/UniqueIdDelete.cs
// LibTSforge/Modifiers/UniqueIdDelete.cs
namespace LibTSforge.Modifiers
{
using System;
@ -6515,7 +6524,7 @@ namespace LibTSforge.Modifiers
}
// Activators/KMS4K.cs
// LibTSforge/Activators/KMS4K.cs
namespace LibTSforge.Activators
{
using System;
@ -6726,7 +6735,7 @@ namespace LibTSforge.Activators
}
// Activators/ZeroCID.cs
// LibTSforge/Activators/ZeroCID.cs
namespace LibTSforge.Activators
{
using System;
@ -6915,7 +6924,7 @@ namespace LibTSforge.Activators
}
// TokenStore/Common.cs
// LibTSforge/TokenStore/Common.cs
namespace LibTSforge.TokenStore
{
using System.Collections.Generic;
@ -6985,7 +6994,7 @@ namespace LibTSforge.TokenStore
}
// TokenStore/ITokenStore.cs
// LibTSforge/TokenStore/ITokenStore.cs
namespace LibTSforge.TokenStore
{
using System;
@ -7005,7 +7014,7 @@ namespace LibTSforge.TokenStore
}
// TokenStore/TokenStoreModern.cs
// LibTSforge/TokenStore/TokenStoreModern.cs
namespace LibTSforge.TokenStore
{
using System;
@ -7291,7 +7300,7 @@ namespace LibTSforge.TokenStore
}
// PhysicalStore/Common.cs
// LibTSforge/PhysicalStore/Common.cs
namespace LibTSforge.PhysicalStore
{
using System.Runtime.InteropServices;
@ -7322,7 +7331,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/IPhysicalStore.cs
// LibTSforge/PhysicalStore/IPhysicalStore.cs
namespace LibTSforge.PhysicalStore
{
using System;
@ -7417,7 +7426,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreModern.cs
// LibTSforge/PhysicalStore/PhysicalStoreModern.cs
namespace LibTSforge.PhysicalStore
{
using System;
@ -7835,7 +7844,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreVista.cs
// LibTSforge/PhysicalStore/PhysicalStoreVista.cs
namespace LibTSforge.PhysicalStore
{
using System;
@ -8194,7 +8203,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/PhysicalStoreWin7.cs
// LibTSforge/PhysicalStore/PhysicalStoreWin7.cs
namespace LibTSforge.PhysicalStore
{
using System;
@ -8571,7 +8580,7 @@ namespace LibTSforge.PhysicalStore
}
// PhysicalStore/VariableBag.cs
// LibTSforge/PhysicalStore/VariableBag.cs
namespace LibTSforge.PhysicalStore
{
using System;