miscellaneous fixes

This commit is contained in:
Wither OrNot 2025-04-03 18:22:33 -04:00
parent 84a0c754a3
commit 17a7c90245
5 changed files with 12 additions and 6 deletions

View File

@ -8,7 +8,7 @@ namespace LibTSforge.Activators
{ {
public static void Activate(PSVersion version, bool production, Guid actId) public static void Activate(PSVersion version, bool production, Guid actId)
{ {
if (version != PSVersion.WinModern) if (version != PSVersion.WinModern && version != PSVersion.WinBlue)
{ {
throw new NotSupportedException("AVMA licenses are not available for this product."); throw new NotSupportedException("AVMA licenses are not available for this product.");
} }

View File

@ -183,6 +183,12 @@ namespace LibTSforge
public static class Utils public static class Utils
{ {
[DllImport("kernel32.dll")]
public static extern uint GetSystemDefaultLCID();
[DllImport("kernel32.dll")]
public static extern bool Wow64EnableWow64FsRedirection(bool Wow64FsEnableRedirection);
public static string DecodeString(byte[] data) public static string DecodeString(byte[] data)
{ {
return Encoding.Unicode.GetString(data).Trim('\0'); return Encoding.Unicode.GetString(data).Trim('\0');
@ -193,9 +199,6 @@ namespace LibTSforge
return Encoding.Unicode.GetBytes(str + '\0'); return Encoding.Unicode.GetBytes(str + '\0');
} }
[DllImport("kernel32.dll")]
public static extern uint GetSystemDefaultLCID();
public static uint CRC32(byte[] data) public static uint CRC32(byte[] data)
{ {
const uint polynomial = 0x04C11DB7; const uint polynomial = 0x04C11DB7;

View File

@ -33,7 +33,7 @@ namespace LibTSforge.SPP
bool stopped = false; bool stopped = false;
for (int i = 0; stopped == false && i < 360; i++) for (int i = 0; stopped == false && i < 1080; i++)
{ {
try try
{ {

View File

@ -30,6 +30,7 @@ namespace LibTSforge.TokenStore
BinaryReader reader = new BinaryReader(TokensFile); BinaryReader reader = new BinaryReader(TokensFile);
do do
{ {
reader.ReadUInt32();
nextBlock = reader.ReadUInt32(); nextBlock = reader.ReadUInt32();
for (int i = 0; i < ENTRIES_PER_BLOCK; i++) for (int i = 0; i < ENTRIES_PER_BLOCK; i++)

View File

@ -35,6 +35,8 @@ namespace TSforgeCLI
{ {
Logger.WriteLine("TSforge (c) MASSGRAVE 2025"); Logger.WriteLine("TSforge (c) MASSGRAVE 2025");
Utils.Wow64EnableWow64FsRedirection(false);
try try
{ {
if (args.Length == 0) if (args.Length == 0)