summaryrefslogtreecommitdiff
path: root/LibTSforge/SPP/ProductKey.cs
diff options
context:
space:
mode:
Diffstat (limited to 'LibTSforge/SPP/ProductKey.cs')
-rw-r--r--LibTSforge/SPP/ProductKey.cs26
1 files changed, 13 insertions, 13 deletions
diff --git a/LibTSforge/SPP/ProductKey.cs b/LibTSforge/SPP/ProductKey.cs
index ae48893..f4cf15a 100644
--- a/LibTSforge/SPP/ProductKey.cs
+++ b/LibTSforge/SPP/ProductKey.cs
@@ -3,8 +3,8 @@ namespace LibTSforge.SPP
using System;
using System.IO;
using System.Linq;
- using LibTSforge.Crypto;
- using LibTSforge.PhysicalStore;
+ using Crypto;
+ using PhysicalStore;
public class ProductKey
{
@@ -18,16 +18,16 @@ namespace LibTSforge.SPP
public ulong Security;
public bool Upgrade;
public PKeyAlgorithm Algorithm;
- public string EulaType;
- public string PartNumber;
- public string Edition;
- public string Channel;
- public Guid ActivationId;
+ private readonly string EulaType;
+ private readonly string PartNumber;
+ public readonly string Edition;
+ public readonly string Channel;
+ private readonly Guid ActivationId;
private string mpc;
private string pid2;
- public byte[] KeyBytes
+ private byte[] KeyBytes
{
get { return BitConverter.GetBytes(klow).Concat(BitConverter.GetBytes(khigh)).ToArray(); }
}
@@ -66,7 +66,7 @@ namespace LibTSforge.SPP
public Guid GetPkeyId()
{
VariableBag pkb = new VariableBag(PSVersion.WinModern);
- pkb.Blocks.AddRange(new CRCBlockModern[]
+ pkb.Blocks.AddRange(new[]
{
new CRCBlockModern
{
@@ -91,7 +91,7 @@ namespace LibTSforge.SPP
return new Guid(CryptoUtils.SHA256Hash(pkb.Serialize()).Take(16).ToArray());
}
- public string GetDefaultMPC()
+ private string GetDefaultMPC()
{
int build = Environment.OSVersion.Version.Build;
string defaultMPC = build >= 10240 ? "03612" :
@@ -111,7 +111,7 @@ namespace LibTSforge.SPP
mpc = GetDefaultMPC();
// setup.cfg doesn't exist in Windows 8+
- string setupcfg = string.Format("{0}\\oobe\\{1}", Environment.SystemDirectory, "setup.cfg");
+ string setupcfg = string.Format(@"{0}\oobe\{1}", Environment.SystemDirectory, "setup.cfg");
if (!File.Exists(setupcfg) || Edition.Contains(";"))
{
@@ -205,7 +205,7 @@ namespace LibTSforge.SPP
return writer.GetBytes();
}
- public string GetExtendedPid()
+ private string GetExtendedPid()
{
string mpc = GetMPC();
int serialHigh = Serial / 1000000;
@@ -249,7 +249,7 @@ namespace LibTSforge.SPP
{
if (version == PSVersion.Win7)
{
- ulong shortauth = ((ulong)Group << 41) | ((ulong)Security << 31) | ((ulong)Serial << 1) | (Upgrade ? (ulong)1 : 0);
+ ulong shortauth = ((ulong)Group << 41) | (Security << 31) | ((ulong)Serial << 1) | (Upgrade ? (ulong)1 : 0);
return BitConverter.GetBytes(shortauth);
}