summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWither OrNot2025-04-07 22:12:53 +0000
committerWither OrNot2025-04-07 22:12:53 +0000
commit91e85088480b4734a9d7302cc980be761f68161b (patch)
tree7d1ed49da8cb5ac406b51bfd202dc8c3ccebf014
parent103981762f471dc2d2e33c1556b9013b1ab77425 (diff)
downloadTSforge-91e85088480b4734a9d7302cc980be761f68161b.zip
stylistic fixes
-rw-r--r--LibTSforge/Activators/AVMA4K.cs3
-rw-r--r--LibTSforge/Modifiers/SetIIDParams.cs1
-rw-r--r--LibTSforge/PhysicalStore/Common.cs4
-rw-r--r--LibTSforge/SPP/ProductKey.cs27
-rw-r--r--LibTSforge/SPP/SPPUtils.cs2
5 files changed, 16 insertions, 21 deletions
diff --git a/LibTSforge/Activators/AVMA4K.cs b/LibTSforge/Activators/AVMA4K.cs
index 51b546a..236b727 100644
--- a/LibTSforge/Activators/AVMA4K.cs
+++ b/LibTSforge/Activators/AVMA4K.cs
@@ -50,8 +50,7 @@ namespace LibTSforge.Activators
ulong time1 = (ulong)(creationTime + tickCount + deltaTime);
ulong crcBindTime = (ulong)DateTime.UtcNow.ToFileTime();
ulong timerTime = crcBindTime / 10000;
- ulong expiry = Constants.TimerMax;
- expiry /= 10000;
+ ulong expiry = Constants.TimerMax / 10000;
VariableBag avmaBinding = new VariableBag(version);
diff --git a/LibTSforge/Modifiers/SetIIDParams.cs b/LibTSforge/Modifiers/SetIIDParams.cs
index 2f34a7d..3d54b9d 100644
--- a/LibTSforge/Modifiers/SetIIDParams.cs
+++ b/LibTSforge/Modifiers/SetIIDParams.cs
@@ -4,6 +4,7 @@ namespace LibTSforge.Modifiers
using SPP;
using System.IO;
using System;
+
public static class SetIIDParams
{
public static void SetParams(PSVersion version, bool production, Guid actId, PKeyAlgorithm algorithm, int group, int serial, ulong security)
diff --git a/LibTSforge/PhysicalStore/Common.cs b/LibTSforge/PhysicalStore/Common.cs
index aef77f8..d0ad4fe 100644
--- a/LibTSforge/PhysicalStore/Common.cs
+++ b/LibTSforge/PhysicalStore/Common.cs
@@ -4,9 +4,9 @@ namespace LibTSforge.PhysicalStore
public enum BlockType : uint
{
- NONE, // unused
+ NONE,
NAMED,
- ATTRIBUTE, //unused
+ ATTRIBUTE,
TIMER
}
diff --git a/LibTSforge/SPP/ProductKey.cs b/LibTSforge/SPP/ProductKey.cs
index f4cf15a..03eb729 100644
--- a/LibTSforge/SPP/ProductKey.cs
+++ b/LibTSforge/SPP/ProductKey.cs
@@ -18,16 +18,16 @@ namespace LibTSforge.SPP
public ulong Security;
public bool Upgrade;
public PKeyAlgorithm Algorithm;
- private readonly string EulaType;
- private readonly string PartNumber;
+ public readonly string EulaType;
+ public readonly string PartNumber;
public readonly string Edition;
public readonly string Channel;
- private readonly Guid ActivationId;
+ public readonly Guid ActivationId;
private string mpc;
private string pid2;
- private byte[] KeyBytes
+ public byte[] KeyBytes
{
get { return BitConverter.GetBytes(klow).Concat(BitConverter.GetBytes(khigh)).ToArray(); }
}
@@ -91,16 +91,6 @@ namespace LibTSforge.SPP
return new Guid(CryptoUtils.SHA256Hash(pkb.Serialize()).Take(16).ToArray());
}
- private string GetDefaultMPC()
- {
- int build = Environment.OSVersion.Version.Build;
- string defaultMPC = build >= 10240 ? "03612" :
- build >= 9600 ? "06401" :
- build >= 9200 ? "05426" :
- "55041";
- return defaultMPC;
- }
-
public string GetMPC()
{
if (mpc != null)
@@ -108,7 +98,12 @@ namespace LibTSforge.SPP
return mpc;
}
- mpc = GetDefaultMPC();
+ int build = Environment.OSVersion.Version.Build;
+
+ mpc = build >= 10240 ? "03612" :
+ build >= 9600 ? "06401" :
+ build >= 9200 ? "05426" :
+ "55041";
// setup.cfg doesn't exist in Windows 8+
string setupcfg = string.Format(@"{0}\oobe\{1}", Environment.SystemDirectory, "setup.cfg");
@@ -205,7 +200,7 @@ namespace LibTSforge.SPP
return writer.GetBytes();
}
- private string GetExtendedPid()
+ public string GetExtendedPid()
{
string mpc = GetMPC();
int serialHigh = Serial / 1000000;
diff --git a/LibTSforge/SPP/SPPUtils.cs b/LibTSforge/SPP/SPPUtils.cs
index 062e5ca..fc4967b 100644
--- a/LibTSforge/SPP/SPPUtils.cs
+++ b/LibTSforge/SPP/SPPUtils.cs
@@ -148,7 +148,7 @@ namespace LibTSforge.SPP
throw new FileNotFoundException("Failed to autodetect key type, specify physical store key with /prod or /test arguments.");
}
- private static string GetPSPath(PSVersion version)
+ public static string GetPSPath(PSVersion version)
{
switch (version)
{