implemented --decrypt
This commit is contained in:
parent
3f3bf6e9d8
commit
8ed592f08f
1 changed files with 25 additions and 0 deletions
25
Program.cs
25
Program.cs
|
@ -106,6 +106,7 @@ public static class Program
|
||||||
Encrypt();
|
Encrypt();
|
||||||
break;
|
break;
|
||||||
case "decrypt":
|
case "decrypt":
|
||||||
|
Decrypt();
|
||||||
break;
|
break;
|
||||||
case "setup":
|
case "setup":
|
||||||
throw new NotSupportedException();
|
throw new NotSupportedException();
|
||||||
|
@ -188,4 +189,28 @@ public static class Program
|
||||||
if (Verbose) Console.WriteLine("Encrypted {0}: {1}", account.AccountName, success);
|
if (Verbose) Console.WriteLine("Encrypted {0}: {1}", account.AccountName, success);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void Decrypt()
|
||||||
|
{
|
||||||
|
if (Verbose) Console.WriteLine("Opening manifest...");
|
||||||
|
Manifest = Manifest.GetManifest(true);
|
||||||
|
if (Verbose) Console.WriteLine("Reading accounts from manifest...");
|
||||||
|
if (Manifest.Encrypted)
|
||||||
|
{
|
||||||
|
string passkey = Manifest.PromptForPassKey();
|
||||||
|
SteamGuardAccounts = Manifest.GetAllAccounts(passkey);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Verbose) Console.WriteLine("Decryption not required.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < SteamGuardAccounts.Length; i++)
|
||||||
|
{
|
||||||
|
var account = SteamGuardAccounts[i];
|
||||||
|
bool success = Manifest.SaveAccount(account, false);
|
||||||
|
if (Verbose) Console.WriteLine("Decrypted {0}: {1}", account.AccountName, success);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue