keys from last session are stored for the aes manager

This commit is contained in:
Asval 2019-06-12 01:37:03 +02:00
parent 77547e33d8
commit e171b3772a
10 changed files with 177 additions and 77 deletions

View File

@ -102,6 +102,7 @@
<HintPath>..\packages\jacobslusser.ScintillaNET.3.6.3\lib\net40\ScintillaNET.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
@ -118,6 +119,7 @@
<Compile Include="Converter\UnrealEngineDataToOGG.cs" />
<Compile Include="Custom\JsonExtensions.cs" />
<Compile Include="Custom\TypeAssistant.cs" />
<Compile Include="Methods\AESManager\AESManager.cs" />
<Compile Include="Methods\BackPAKs\DynamicPAKs.cs" />
<Compile Include="Methods\BackPAKs\Parser\AccessCodeParser.cs" />
<Compile Include="Methods\BackPAKs\Parser\AESKeyParser.cs" />

View File

@ -59,7 +59,6 @@
this.label2 = new System.Windows.Forms.Label();
this.FilterTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.AESKeyTextBox = new System.Windows.Forms.TextBox();
this.ExtractButton = new System.Windows.Forms.Button();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.treeView1 = new System.Windows.Forms.TreeView();
@ -71,6 +70,7 @@
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker();
this.AESKeyComboBox = new System.Windows.Forms.ComboBox();
this.statusStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.panel1.SuspendLayout();
@ -211,7 +211,7 @@
// searchToolStripMenuItem
//
this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
this.searchToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.searchToolStripMenuItem.Size = new System.Drawing.Size(109, 22);
this.searchToolStripMenuItem.Text = "Search";
this.searchToolStripMenuItem.Click += new System.EventHandler(this.searchToolStripMenuItem_Click);
//
@ -271,12 +271,12 @@
// panel1
//
this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244)))));
this.panel1.Controls.Add(this.AESKeyComboBox);
this.panel1.Controls.Add(this.StopButton);
this.panel1.Controls.Add(this.OpenImageButton);
this.panel1.Controls.Add(this.label2);
this.panel1.Controls.Add(this.FilterTextBox);
this.panel1.Controls.Add(this.label1);
this.panel1.Controls.Add(this.AESKeyTextBox);
this.panel1.Controls.Add(this.ExtractButton);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Location = new System.Drawing.Point(0, 657);
@ -333,21 +333,12 @@
//
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(436, 7);
this.label1.Location = new System.Drawing.Point(424, 7);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(52, 13);
this.label1.TabIndex = 2;
this.label1.Text = "AES Key:";
//
// AESKeyTextBox
//
this.AESKeyTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.AESKeyTextBox.Location = new System.Drawing.Point(494, 4);
this.AESKeyTextBox.Name = "AESKeyTextBox";
this.AESKeyTextBox.Size = new System.Drawing.Size(442, 20);
this.AESKeyTextBox.TabIndex = 1;
this.AESKeyTextBox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
// ExtractButton
//
this.ExtractButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@ -469,6 +460,15 @@
this.backgroundWorker2.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker2_DoWork);
this.backgroundWorker2.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker2_RunWorkerCompleted);
//
// AESKeyComboBox
//
this.AESKeyComboBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.AESKeyComboBox.FormattingEnabled = true;
this.AESKeyComboBox.Location = new System.Drawing.Point(482, 4);
this.AESKeyComboBox.Name = "AESKeyComboBox";
this.AESKeyComboBox.Size = new System.Drawing.Size(454, 21);
this.AESKeyComboBox.TabIndex = 7;
//
// MainWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -522,7 +522,6 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button ExtractButton;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox AESKeyTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox FilterTextBox;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
@ -543,6 +542,7 @@
private System.ComponentModel.BackgroundWorker backgroundWorker2;
private System.Windows.Forms.ToolStripMenuItem filesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem;
private System.Windows.Forms.ComboBox AESKeyComboBox;
}
}

View File

@ -90,12 +90,10 @@ namespace FModel
//METHODS
private void AddPaKs(IEnumerable<string> thePaks, int index)
{
if (InvokeRequired)
Invoke(new Action(() =>
{
BeginInvoke(new Action<IEnumerable<string>, int>(AddPaKs), thePaks, index);
return;
}
loadOneToolStripMenuItem.DropDownItems.Add(Path.GetFileName(thePaks.ElementAt(index)));
loadOneToolStripMenuItem.DropDownItems.Add(Path.GetFileName(thePaks.ElementAt(index)));
}));
}
private void FillWithPaKs()
{
@ -123,12 +121,21 @@ namespace FModel
}
private void KeyCheck()
{
if (InvokeRequired)
Invoke(new Action(() =>
{
BeginInvoke(new Action(KeyCheck));
return;
}
AESKeyTextBox.Text = @"0x" + Settings.Default.AESKey;
try
{
foreach (string s in AESManager.deserialize())
{
if (!AESKeyComboBox.Items.Contains(@"0x" + s)) { AESKeyComboBox.Items.Add(@"0x" + s); }
AESKeyComboBox.SelectedIndex = AESKeyComboBox.FindStringExact(@"0x" + Settings.Default.AESKey);
}
}
catch (FileNotFoundException)
{
AESKeyComboBox.Text = @"0x" + Settings.Default.AESKey;
}
}));
}
//EVENTS
@ -139,6 +146,7 @@ namespace FModel
DLLImport.SetTreeViewTheme(treeView1.Handle);
_backupFileName = "\\FortniteGame_" + DateTime.Now.ToString("MMddyyyy") + ".txt";
AESManager.AESEntries = new List<AESEntry>();
// Copy user settings from previous application version if necessary
if (Settings.Default.UpdateSettings)
@ -440,8 +448,14 @@ namespace FModel
ThePak.AllpaksDictionary = new Dictionary<string, string>();
_diffToExtract = new Dictionary<string, string>();
ThePak.PaksMountPoint = new Dictionary<string, string>();
Settings.Default.AESKey = AESKeyTextBox.Text.Substring(2).ToUpper();
Settings.Default.Save();
Invoke(new Action(() =>
{
Settings.Default.AESKey = AESKeyComboBox.Text.Substring(2).ToUpper();
Settings.Default.Save();
AESManager.serialize(Settings.Default.AESKey);
KeyCheck();
}));
if (selectedPak != null)
{
@ -534,13 +548,23 @@ namespace FModel
string myContent = DynamicPAKs.GetEndpoint("https://fortnite-public-service-prod11.ol.epicgames.com/fortnite/api/storefront/v2/keychain", true);
if (myContent.Contains("\"errorCode\": \"errors.com.epicgames.common.authentication.authentication_failed\""))
{
AppendText("EPIC Authentication Failed.", Color.Red, true);
}
else
{
AppendText("Successfully Authenticated.", Color.Green, true);
_backupDynamicKeys = AesKeyParser.FromJson(myContent);
}
}
Settings.Default.AESKey = AESKeyTextBox.Text.Substring(2).ToUpper();
Settings.Default.Save();
Invoke(new Action(() =>
{
Settings.Default.AESKey = AESKeyComboBox.Text.Substring(2).ToUpper();
Settings.Default.Save();
AESManager.serialize(Settings.Default.AESKey);
KeyCheck();
}));
for (int i = 0; i < allYourPaKs.Length; i++)
{

View File

@ -130,43 +130,43 @@
<value>
AAEAAAD/////AQAAAA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AC/wFm
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/0MAAf8N9DEAAf8O9AEA
D/QhAAH0ARoKeQEaAXkB9AEAAfQNeQH0IQAB9AGZCXkBmQH0AXkB9AEAAfQNeQH0IAAB9AEbCnkBGwH0
AXkB9AEAAfQNeQH0IAAB9AEaCXkBmQL0AXkB9AEAAfQNeQH0IAAB9AGZCXkB8wL0AXkB9AEAAfQNeQH0
IAAC9AF5C/QBeQH0AQAB9A15AfQhAAH0AXkL9AF5AfQBAAH0DXkB9CEAAfQBeQv0AXkB9AEAAfQNeQH0
IQAB9AR5AfMH9AF5AfQBAAH0DXkB9CEABPQCmQf0AXkB9AEABfQCmQb0AXkB9CQAAfQBGgl5AfQFAAH0
ARoIeQH0JAAM9AUAAf8K9GAAAUIBTQE+BwABPgMAASgDAAFAAwABEAMAAQEBAAEBBQABgBcAA/8BAAT/
BAABwAEAAv8EAAGAAQABgAUAAYABAAGABQABgAEAAYAHAAGABwABgAcAAYAHAAGABQABgAEAAYAFAAGA
AQABgAUAAYABAAGABQABgAEAAYAFAAHwAQAB+AUAAfABAAH4BQAE/wQACw==
</value>
</data>
<metadata name="backgroundWorker1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

View File

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Xml.Serialization;
namespace FModel
{
static class AESManager
{
public static List<AESEntry> AESEntries { get; set; }
private static XmlSerializer serializer = new XmlSerializer(typeof(List<AESEntry>));
public static void serialize(string data)
{
ConfigurationUserLevel level = ConfigurationUserLevel.PerUserRoamingAndLocal;
Configuration configuration = ConfigurationManager.OpenExeConfiguration(level);
string configurationFilePath = configuration.FilePath.Substring(0, configuration.FilePath.LastIndexOf("\\"));
AESEntries.Add(new AESEntry()
{
theKey = data
});
string path = configurationFilePath + "\\AESManager.xml";
Directory.CreateDirectory(Path.GetDirectoryName(path));
using (var fileStream = new FileStream(path, FileMode.Create))
{
serializer.Serialize(fileStream, AESEntries);
}
}
public static string[] deserialize()
{
ConfigurationUserLevel level = ConfigurationUserLevel.PerUserRoamingAndLocal;
Configuration configuration = ConfigurationManager.OpenExeConfiguration(level);
string configurationFilePath = configuration.FilePath.Substring(0, configuration.FilePath.LastIndexOf("\\"));
string path = configurationFilePath + "\\AESManager.xml";
List<AESEntry> outputList;
using (var fileStream = new FileStream(path, FileMode.Open))
{
outputList = (List<AESEntry>)serializer.Deserialize(fileStream);
}
string[] toReturn = new string[outputList.Count];
for (int i = 0; i < toReturn.Length; i++)
{
toReturn[i] = outputList[i].theKey;
}
return toReturn;
}
}
}

View File

@ -4,6 +4,7 @@ using FModel.Parser.Items;
using FModel.Properties;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
@ -21,7 +22,7 @@ namespace FModel
/// <param name="featured"></param>
public static void GetItemIcon(ItemsIdParser theItem, bool featured = false)
{
if (featured == false)
if (!featured)
{
Checking.WasFeatured = false;
SearchAthIteDefIcon(theItem);
@ -207,11 +208,11 @@ namespace FModel
/// <param name="catName"></param>
private static void GetFeaturedItemIcon(ItemsIdParser theItem, string catName)
{
if (ThePak.AllpaksDictionary.ContainsKey(catName))
{
ThePak.CurrentUsedItem = catName;
ThePak.CurrentUsedItem = catName;
string catalogFilePath;
string catalogFilePath;
try
{
if (ThePak.CurrentUsedPakGuid != null && ThePak.CurrentUsedPakGuid != "0-0-0-0")
{
catalogFilePath = JohnWick.ExtractAsset(ThePak.CurrentUsedPak, catName);
@ -263,7 +264,10 @@ namespace FModel
}
}
}
else { GetItemIcon(theItem); }
catch (KeyNotFoundException)
{
GetItemIcon(theItem);
}
}
/// <summary>

View File

@ -8,9 +8,6 @@
{
switch (selectedLanguage)
{
case "English":
myLocRes = getMyLocRes("en");
break;
case "French":
myLocRes = getMyLocRes("fr");
break;

View File

@ -22,7 +22,7 @@ namespace FModel
byte[] bytes = File.ReadAllBytes(filepath);
string pattern = @"^[a-zA-Z0-9 ]+$";
string pattern = @"^[a-zA-Z0-9()'\-.&!+, ]";
Regex regex = new Regex(pattern);
foreach (byte b in bytes) // Iterate throught all the bytes of the file
@ -42,7 +42,7 @@ namespace FModel
bool found = false;
foreach (string str in weirdStrings)
{
if (str.Length > 2)
if (str.Length >= 2)
{
if (found) { myNamespacesList.Add(str); break; }
@ -55,11 +55,14 @@ namespace FModel
|| str == "Glider"
|| str == "Contrail"
|| str == "Emote"
|| str == "Emoticon"
|| str == "Toy"
|| str == "Music")
{
int index = listBeforeData.IndexOf(str);
//Console.WriteLine("DName: " + listBeforeData[index - 3]);
myNamespacesList.Add(listBeforeData[index - 3]);
myNamespacesList.Add(listBeforeData[index - 1]);

View File

@ -84,4 +84,18 @@ namespace FModel
throw new NotImplementedException();
}
}
public struct AESEntry : IEquatable<AESEntry>
{
internal AESEntry(string myKey)
{
theKey = myKey;
}
public string theKey { get; set; }
bool IEquatable<AESEntry>.Equals(AESEntry other)
{
throw new NotImplementedException();
}
}
}

View File

@ -87,8 +87,8 @@ I'd highly suggest you to use [UModel](https://github.com/gildor2/UModel) instea
- [ ] Icons translation
- [ ] 2FA support
- [ ] Export Queue
- [ ] AES Manager
- [ ] Nintendo Switch sound files
- [x] AES Manager
- [x] Display support for .locres files
- [x] Nintendo Switch PAKs
- [x] Multithreading