diff options
| author | Wither OrNot | 2025-04-04 04:21:07 +0000 |
|---|---|---|
| committer | Wither OrNot | 2025-04-04 04:21:07 +0000 |
| commit | e86f43a2864585f8430e01849a04a51bc46c1908 (patch) | |
| tree | 43eeaa50c16d57b52d67f22f1f512b1a95f942de | |
| parent | aa0801c643729177454fc329f092456afb86f3ab (diff) | |
| download | TSforge-e86f43a2864585f8430e01849a04a51bc46c1908.zip | |
hack fix for arm64 in absence of better solutions
| -rw-r--r-- | LibTSforge/SPP/ProductKey.cs | 9 | ||||
| -rw-r--r-- | LibTSforge/SPP/SPPUtils.cs | 16 |
2 files changed, 15 insertions, 10 deletions
diff --git a/LibTSforge/SPP/ProductKey.cs b/LibTSforge/SPP/ProductKey.cs index b5fca9a..ce454d8 100644 --- a/LibTSforge/SPP/ProductKey.cs +++ b/LibTSforge/SPP/ProductKey.cs @@ -32,6 +32,11 @@ namespace LibTSforge.SPP get { return BitConverter.GetBytes(klow).Concat(BitConverter.GetBytes(khigh)).ToArray(); } } + public ProductKey() + { + + } + public ProductKey(int serial, ulong security, bool upgrade, PKeyAlgorithm algorithm, ProductConfig config, KeyRange range) { Group = config.GroupId; @@ -254,7 +259,9 @@ namespace LibTSforge.SPP int serialLow = Serial % 1000000; BinaryWriter writer = new BinaryWriter(new MemoryStream()); - writer.Write(new Guid("B8731595-A2F6-430B-A799-FBFFB81A8D73").ToByteArray()); + string algoId = Algorithm == PKeyAlgorithm.PKEY2005 ? "B8731595-A2F6-430B-A799-FBFFB81A8D73" : "660672EF-7809-4CFD-8D54-41B7FB738988"; + + writer.Write(new Guid(algoId).ToByteArray()); writer.Write(Group); writer.Write(serialHigh); writer.Write(serialLow); diff --git a/LibTSforge/SPP/SPPUtils.cs b/LibTSforge/SPP/SPPUtils.cs index a0b3a77..ad3840d 100644 --- a/LibTSforge/SPP/SPPUtils.cs +++ b/LibTSforge/SPP/SPPUtils.cs @@ -113,7 +113,7 @@ namespace LibTSforge.SPP } catch (InvalidOperationException ex) { - Logger.WriteLine("Warning: Starting slsvc failed, retrying. Details:" + ex.Message); + Logger.WriteLine("Warning: Starting slsvc failed, retrying. Details: " + ex.Message); System.Threading.Thread.Sleep(500); continue; } @@ -161,11 +161,10 @@ namespace LibTSforge.SPP default: return Path.Combine( Environment.ExpandEnvironmentVariables( - (string)RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, Environment.MachineName) - .OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SoftwareProtectionPlatform") - .GetValue( + (string)Registry.GetValue( + @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform", "TokenStore", - string.Empty + @"C:\Windows\System32\spp\store\2.0" ) ), "data.dat" @@ -190,11 +189,10 @@ namespace LibTSforge.SPP default: return Path.Combine( Environment.ExpandEnvironmentVariables( - (string)RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, Environment.MachineName) - .OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\SoftwareProtectionPlatform") - .GetValue( + (string)Registry.GetValue( + @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SoftwareProtectionPlatform", "TokenStore", - string.Empty + @"C:\Windows\System32\spp\store\2.0" ) ), "tokens.dat" |
