From 8ed592f08fb72ee365db950876280e8969b0c00e Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Mon, 22 Aug 2016 22:16:47 -0400 Subject: [PATCH] implemented --decrypt --- Program.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Program.cs b/Program.cs index 5cd21bf..74e621b 100644 --- a/Program.cs +++ b/Program.cs @@ -106,6 +106,7 @@ public static class Program Encrypt(); break; case "decrypt": + Decrypt(); break; case "setup": throw new NotSupportedException(); @@ -188,4 +189,28 @@ public static class Program 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); + } + } }