From c10b353fc972190a1e972239acda139b76d1d5a4 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Mon, 22 Aug 2016 13:50:43 -0400 Subject: [PATCH] Changed how mafiles are read --- Manifest.cs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Manifest.cs b/Manifest.cs index 734c0b5..c4e80fe 100644 --- a/Manifest.cs +++ b/Manifest.cs @@ -224,14 +224,27 @@ public class Manifest List accounts = new List(); foreach (var entry in this.Entries) { - string fileText = File.ReadAllText(Path.Combine(Program.SteamGuardPath, entry.Filename)); + string fileText = ""; + Stream stream = null; + FileStream fileStream = File.OpenRead(Path.Combine(Program.SteamGuardPath, entry.Filename)); + if (this.Encrypted) { - throw new NotSupportedException("Encrypted maFiles are not supported at this time."); //string decryptedText = FileEncryptor.DecryptData(passKey, entry.Salt, entry.IV, fileText); - //if (decryptedText == null) return new SteamGuardAccount[0]; - //fileText = decryptedText; } + else + { + stream = fileStream; + } + + byte[] b = new byte[1024]; + StringBuilder sb = new StringBuilder(); + while (stream.Read(b,0,b.Length) > 0) + { + sb.Append(Encoding.UTF8.GetString(b)); + } + stream.Close(); + fileText = sb.ToString(); var account = JsonConvert.DeserializeObject(fileText); if (account == null) continue;