dynamic paks are now loaded when doing Load All PAKs + updated logo

This commit is contained in:
Asval 2019-07-13 19:59:14 +02:00
parent 7368b2a9ca
commit 327aec7a75
22 changed files with 8733 additions and 5488 deletions

View File

@ -271,6 +271,9 @@
<Content Include="DLLs\csharp-wick.dll" />
<Content Include="DLLs\ScintillaNET FindReplaceDialog.dll" />
<Content Include="FModel.ico" />
<None Include="Resources\FModel%281%29.ico" />
<None Include="Resources\FModel.ico" />
<None Include="Resources\FModel_Logo.png" />
<None Include="Resources\wTemplateF.png" />
<None Include="Resources\wTemplate.png" />
<None Include="Resources\T512.png" />
@ -299,7 +302,6 @@
<None Include="Resources\T-Icon-Traversal-64.png" />
<None Include="Resources\T-Icon-Animated-64.png" />
<None Include="Resources\T-Icon-Adaptive-64.png" />
<None Include="Resources\FModel_Logo.png" />
<None Include="Resources\unknown512.png" />
<None Include="Resources\properties_16xLG.png" />
<None Include="Resources\StatusAnnotations_Information_16xLG_color.png" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 72 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -34,10 +34,10 @@
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.panel1 = new System.Windows.Forms.Panel();
this.button2 = new System.Windows.Forms.Button();
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.button2 = new System.Windows.Forms.Button();
this.tableLayoutPanel1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
@ -97,6 +97,18 @@
this.panel1.Size = new System.Drawing.Size(792, 30);
this.panel1.TabIndex = 1;
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button2.Enabled = false;
this.button2.Location = new System.Drawing.Point(708, 4);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 3;
this.button2.Text = "Extract";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.Button2_Click);
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@ -126,18 +138,6 @@
this.textBox1.TabIndex = 0;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// button2
//
this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.button2.Enabled = false;
this.button2.Location = new System.Drawing.Point(708, 4);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(75, 23);
this.button2.TabIndex = 3;
this.button2.Text = "Extract";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.Button2_Click);
//
// SearchFiles
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -36,71 +36,34 @@ namespace FModel.Forms
if (MainWindow.PakAsTxt != null)
{
if (ThePak.CurrentUsedPakGuid != null && ThePak.CurrentUsedPakGuid != "0-0-0-0")
for (int i = 0; i < MainWindow.PakAsTxt.Length; i++)
{
for (int i = 0; i < MainWindow.PakAsTxt.Length; i++)
if (MainWindow.PakAsTxt[i].Contains(".uasset") || MainWindow.PakAsTxt[i].Contains(".uexp") || MainWindow.PakAsTxt[i].Contains(".ubulk"))
{
if (MainWindow.PakAsTxt[i].Contains(".uasset") || MainWindow.PakAsTxt[i].Contains(".uexp") || MainWindow.PakAsTxt[i].Contains(".ubulk"))
if (!_myInfosDict.ContainsKey(MainWindow.PakAsTxt[i].Substring(0, MainWindow.PakAsTxt[i].LastIndexOf(".", StringComparison.Ordinal))))
{
if (!_myInfosDict.ContainsKey(MainWindow.PakAsTxt[i].Substring(0, MainWindow.PakAsTxt[i].LastIndexOf(".", StringComparison.Ordinal))))
{
_myInfosDict.Add(MainWindow.PakAsTxt[i].Substring(0, MainWindow.PakAsTxt[i].LastIndexOf(".", StringComparison.Ordinal)), ThePak.CurrentUsedPak);
_myInfosDict.Add(MainWindow.PakAsTxt[i].Substring(0, MainWindow.PakAsTxt[i].LastIndexOf(".", StringComparison.Ordinal)), ThePak.AllpaksDictionary[Path.GetFileNameWithoutExtension(MainWindow.PakAsTxt[i])]);
_fileName = MainWindow.PakAsTxt[i].Substring(0, MainWindow.PakAsTxt[i].LastIndexOf(".", StringComparison.Ordinal));
_myInfos.Add(new FileInfo
{
FileName = _fileName,
PakFile = ThePak.CurrentUsedPak,
});
}
}
else
{
if (!_myInfosDict.ContainsKey(MainWindow.PakAsTxt[i]))
_fileName = MainWindow.PakAsTxt[i].Substring(0, MainWindow.PakAsTxt[i].LastIndexOf(".", StringComparison.Ordinal));
_myInfos.Add(new FileInfo
{
_myInfosDict.Add(MainWindow.PakAsTxt[i], ThePak.CurrentUsedPak);
_fileName = MainWindow.PakAsTxt[i];
_myInfos.Add(new FileInfo
{
FileName = _fileName,
PakFile = ThePak.CurrentUsedPak,
});
}
FileName = _fileName,
PakFile = ThePak.AllpaksDictionary[Path.GetFileNameWithoutExtension(MainWindow.PakAsTxt[i])],
});
}
}
}
else
{
for (int i = 0; i < MainWindow.PakAsTxt.Length; i++)
else
{
if (MainWindow.PakAsTxt[i].Contains(".uasset") || MainWindow.PakAsTxt[i].Contains(".uexp") || MainWindow.PakAsTxt[i].Contains(".ubulk"))
if (!_myInfosDict.ContainsKey(MainWindow.PakAsTxt[i]))
{
if (!_myInfosDict.ContainsKey(MainWindow.PakAsTxt[i].Substring(0, MainWindow.PakAsTxt[i].LastIndexOf(".", StringComparison.Ordinal))))
{
_myInfosDict.Add(MainWindow.PakAsTxt[i].Substring(0, MainWindow.PakAsTxt[i].LastIndexOf(".", StringComparison.Ordinal)), ThePak.AllpaksDictionary[Path.GetFileNameWithoutExtension(MainWindow.PakAsTxt[i])]);
_myInfosDict.Add(MainWindow.PakAsTxt[i], ThePak.AllpaksDictionary[Path.GetFileName(MainWindow.PakAsTxt[i])]);
_fileName = MainWindow.PakAsTxt[i].Substring(0, MainWindow.PakAsTxt[i].LastIndexOf(".", StringComparison.Ordinal));
_myInfos.Add(new FileInfo
{
FileName = _fileName,
PakFile = ThePak.AllpaksDictionary[Path.GetFileNameWithoutExtension(MainWindow.PakAsTxt[i])],
});
}
}
else
{
if (!_myInfosDict.ContainsKey(MainWindow.PakAsTxt[i]))
_fileName = MainWindow.PakAsTxt[i];
_myInfos.Add(new FileInfo
{
_myInfosDict.Add(MainWindow.PakAsTxt[i], ThePak.AllpaksDictionary[Path.GetFileName(MainWindow.PakAsTxt[i])]);
_fileName = MainWindow.PakAsTxt[i];
_myInfos.Add(new FileInfo
{
FileName = _fileName,
PakFile = ThePak.AllpaksDictionary[Path.GetFileName(MainWindow.PakAsTxt[i])],
});
}
FileName = _fileName,
PakFile = ThePak.AllpaksDictionary[Path.GetFileName(MainWindow.PakAsTxt[i])],
});
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -434,7 +434,7 @@ namespace FModel.Forms
this.label1.ForeColor = System.Drawing.Color.Red;
this.label1.Location = new System.Drawing.Point(168, 314);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(16, 13);
this.label1.Size = new System.Drawing.Size(19, 13);
this.label1.TabIndex = 19;
this.label1.Text = "⚠️";
//

File diff suppressed because it is too large Load Diff

View File

@ -46,8 +46,9 @@ namespace FModel
this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.filesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copySelectedFilePathToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsJSONToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.copySelectedFilePathToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.imageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoSaveImagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -84,7 +85,6 @@ namespace FModel
this.saveAsJSONToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.extractFolderContentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
this.statusStrip1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.panel1.SuspendLayout();
@ -163,26 +163,26 @@ namespace FModel
// loadOneToolStripMenuItem
//
this.loadOneToolStripMenuItem.Name = "loadOneToolStripMenuItem";
this.loadOneToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.loadOneToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
this.loadOneToolStripMenuItem.Text = "Load One PAK";
this.loadOneToolStripMenuItem.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.loadOneToolStripMenuItem_DropDownItemClicked);
//
// loadAllToolStripMenuItem
//
this.loadAllToolStripMenuItem.Name = "loadAllToolStripMenuItem";
this.loadAllToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.loadAllToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
this.loadAllToolStripMenuItem.Text = "Load All PAKs";
this.loadAllToolStripMenuItem.Click += new System.EventHandler(this.loadAllToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(159, 6);
//
// backupPAKsToolStripMenuItem
//
this.backupPAKsToolStripMenuItem.Name = "backupPAKsToolStripMenuItem";
this.backupPAKsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.backupPAKsToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
this.backupPAKsToolStripMenuItem.Text = "Backup PAKs";
this.backupPAKsToolStripMenuItem.Click += new System.EventHandler(this.backupPAKsToolStripMenuItem_Click);
//
@ -190,7 +190,7 @@ namespace FModel
//
this.differenceModeToolStripMenuItem.CheckOnClick = true;
this.differenceModeToolStripMenuItem.Name = "differenceModeToolStripMenuItem";
this.differenceModeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.differenceModeToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
this.differenceModeToolStripMenuItem.Text = "Difference Mode";
this.differenceModeToolStripMenuItem.CheckedChanged += new System.EventHandler(this.differenceModeToolStripMenuItem_CheckedChanged);
//
@ -199,21 +199,21 @@ namespace FModel
this.updateModeToolStripMenuItem.CheckOnClick = true;
this.updateModeToolStripMenuItem.Enabled = false;
this.updateModeToolStripMenuItem.Name = "updateModeToolStripMenuItem";
this.updateModeToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.updateModeToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
this.updateModeToolStripMenuItem.Text = "Update Mode";
this.updateModeToolStripMenuItem.CheckedChanged += new System.EventHandler(this.updateModeToolStripMenuItem_CheckedChanged);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(159, 6);
//
// settingsToolStripMenuItem
//
this.settingsToolStripMenuItem.Image = global::FModel.Properties.Resources.properties_16xLG;
this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem";
this.settingsToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F1;
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.settingsToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
this.settingsToolStripMenuItem.Text = "Settings";
this.settingsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click);
//
@ -236,13 +236,6 @@ namespace FModel
this.searchToolStripMenuItem.Text = "Search";
this.searchToolStripMenuItem.Click += new System.EventHandler(this.searchToolStripMenuItem_Click);
//
// copySelectedFilePathToolStripMenuItem
//
this.copySelectedFilePathToolStripMenuItem.Name = "copySelectedFilePathToolStripMenuItem";
this.copySelectedFilePathToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.copySelectedFilePathToolStripMenuItem.Text = "Copy Selected File Path";
this.copySelectedFilePathToolStripMenuItem.Click += new System.EventHandler(this.CopySelectedFilePathToolStripMenuItem_Click);
//
// saveAsJSONToolStripMenuItem
//
this.saveAsJSONToolStripMenuItem.Name = "saveAsJSONToolStripMenuItem";
@ -251,6 +244,18 @@ namespace FModel
this.saveAsJSONToolStripMenuItem.Text = "Save as JSON";
this.saveAsJSONToolStripMenuItem.Click += new System.EventHandler(this.SaveAsJSONToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(194, 6);
//
// copySelectedFilePathToolStripMenuItem
//
this.copySelectedFilePathToolStripMenuItem.Name = "copySelectedFilePathToolStripMenuItem";
this.copySelectedFilePathToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.copySelectedFilePathToolStripMenuItem.Text = "Copy Selected File Path";
this.copySelectedFilePathToolStripMenuItem.Click += new System.EventHandler(this.CopySelectedFilePathToolStripMenuItem_Click);
//
// imageToolStripMenuItem
//
this.imageToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -315,7 +320,7 @@ namespace FModel
//
this.aboutFModelToolStripMenuItem.Image = global::FModel.Properties.Resources.StatusAnnotations_Information_16xLG_color;
this.aboutFModelToolStripMenuItem.Name = "aboutFModelToolStripMenuItem";
this.aboutFModelToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.aboutFModelToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
this.aboutFModelToolStripMenuItem.Text = "About FModel";
this.aboutFModelToolStripMenuItem.Click += new System.EventHandler(this.aboutFModelToolStripMenuItem_Click);
//
@ -590,11 +595,6 @@ namespace FModel
this.extractFolderContentsToolStripMenuItem.Text = "Extract Folder Contents";
this.extractFolderContentsToolStripMenuItem.Click += new System.EventHandler(this.ExtractFolderContentsToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(194, 6);
//
// MainWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -302,7 +302,6 @@ namespace FModel
{
bMainKeyWorking = true;
JohnWick.MyKey = Settings.Default.AESKey;
string mountPoint = JohnWick.MyExtractor.GetMountPoint();
ThePak.PaksMountPoint.Add(ThePak.mainPaksList[i].thePak, mountPoint.Substring(9));
@ -339,47 +338,69 @@ namespace FModel
}
if (bMainKeyWorking) { LoadLocRes.LoadMySelectedLocRes(Settings.Default.IconLanguage); }
if (theSinglePak != null) //IMPORTANT: IT STILLS LOAD THE DICTIONARY -> IT'S GONNA BE USEFUL FOR TRANSLATIONS
for (int i = 0; i < ThePak.dynamicPaksList.Count; i++)
{
ThePak.CurrentUsedPak = theSinglePak.ClickedItem.Text;
ThePak.CurrentUsedPakGuid = ThePak.ReadPakGuid(Settings.Default.PAKsPath + "\\" + ThePak.CurrentUsedPak);
string pakName = DynamicKeysManager.AESEntries.Where(x => x.thePak == ThePak.dynamicPaksList[i].thePak).Select(x => x.thePak).FirstOrDefault();
string pakKey = DynamicKeysManager.AESEntries.Where(x => x.thePak == ThePak.dynamicPaksList[i].thePak).Select(x => x.theKey).FirstOrDefault();
if (ThePak.CurrentUsedPakGuid != "0-0-0-0") //LOADING DYNAMIC PAK
if (!string.IsNullOrEmpty(pakName) && !string.IsNullOrEmpty(pakKey))
{
if (DynamicKeysManager.AESEntries != null)
try
{
foreach (AESEntry s in DynamicKeysManager.AESEntries)
JohnWick.MyExtractor = new PakExtractor(Settings.Default.PAKsPath + "\\" + pakName, pakKey);
}
catch (Exception)
{
new UpdateMyConsole("0x" + pakKey + " doesn't work with " + ThePak.dynamicPaksList[i].thePak, Color.Red, true).AppendToConsole();
JohnWick.MyExtractor.Dispose();
continue;
}
string[] CurrentUsedPakLines = JohnWick.MyExtractor.GetFileList().ToArray();
if (CurrentUsedPakLines != null)
{
string mountPoint = JohnWick.MyExtractor.GetMountPoint();
ThePak.PaksMountPoint.Add(ThePak.dynamicPaksList[i].thePak, mountPoint.Substring(9));
for (int ii = 0; ii < CurrentUsedPakLines.Length; ii++)
{
if (s.thePak == ThePak.CurrentUsedPak && s.theKey.Length > 2)
CurrentUsedPakLines[ii] = JohnWick.MyExtractor.GetMountPoint().Substring(6) + CurrentUsedPakLines[ii];
string CurrentUsedPakFileName = CurrentUsedPakLines[ii].Substring(CurrentUsedPakLines[ii].LastIndexOf("/", StringComparison.Ordinal) + 1);
if (CurrentUsedPakFileName.Contains(".uasset") || CurrentUsedPakFileName.Contains(".uexp") || CurrentUsedPakFileName.Contains(".ubulk"))
{
try
if (!ThePak.AllpaksDictionary.ContainsKey(CurrentUsedPakFileName.Substring(0, CurrentUsedPakFileName.LastIndexOf(".", StringComparison.Ordinal))))
{
JohnWick.MyExtractor = new PakExtractor(Settings.Default.PAKsPath + "\\" + ThePak.CurrentUsedPak, s.theKey);
PakAsTxt = JohnWick.MyExtractor.GetFileList().ToArray();
if (PakAsTxt != null)
{
JohnWick.MyKey = s.theKey;
string mountPoint = JohnWick.MyExtractor.GetMountPoint();
ThePak.PaksMountPoint.Add(ThePak.CurrentUsedPak, mountPoint.Substring(9));
for (int i = 0; i < PakAsTxt.Length; i++)
{
PakAsTxt[i] = mountPoint.Substring(6) + PakAsTxt[i];
}
}
JohnWick.MyExtractor.Dispose();
}
catch (Exception)
{
JohnWick.MyExtractor.Dispose();
return;
ThePak.AllpaksDictionary.Add(CurrentUsedPakFileName.Substring(0, CurrentUsedPakFileName.LastIndexOf(".", StringComparison.Ordinal)), ThePak.dynamicPaksList[i].thePak);
}
}
else
{
if (!ThePak.AllpaksDictionary.ContainsKey(CurrentUsedPakFileName))
{
ThePak.AllpaksDictionary.Add(CurrentUsedPakFileName, ThePak.dynamicPaksList[i].thePak);
}
}
if (loadAllPaKs)
{
sb.Append(CurrentUsedPakLines[ii] + "\n");
}
}
if (loadAllPaKs) { new UpdateMyState(".PAK mount point: " + mountPoint.Substring(9), "Waiting").ChangeProcessState(); }
if (theSinglePak != null && ThePak.dynamicPaksList[i].thePak == theSinglePak.ClickedItem.Text)
{
ThePak.CurrentUsedPak = pakName;
ThePak.CurrentUsedPakGuid = ThePak.ReadPakGuid(Settings.Default.PAKsPath + "\\" + ThePak.CurrentUsedPak);
PakAsTxt = CurrentUsedPakLines;
}
}
JohnWick.MyExtractor.Dispose();
}
}
if (loadAllPaKs)
{
File.WriteAllText(App.DefaultOutputPath + "\\FortnitePAKs.txt", sb.ToString()); //File will always exist
@ -1034,10 +1055,7 @@ namespace FModel
ThePak.CurrentUsedItem = SelectedItemsArray[i];
if (ThePak.CurrentUsedPakGuid != null && ThePak.CurrentUsedPakGuid != "0-0-0-0")
Checking.ExtractedFilePath = JohnWick.ExtractAsset(ThePak.CurrentUsedPak, ThePak.CurrentUsedItem);
else
Checking.ExtractedFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[ThePak.CurrentUsedItem], ThePak.CurrentUsedItem);
Checking.ExtractedFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[ThePak.CurrentUsedItem], ThePak.CurrentUsedItem);
if (Checking.ExtractedFilePath != null)
{
@ -1058,7 +1076,7 @@ namespace FModel
}
if (Checking.ExtractedFilePath.Contains(".locres") && !Checking.ExtractedFilePath.Contains("EngineOverrides"))
SerializeLocRes();
if (Checking.ExtractedFilePath.Contains(".uplugin"))
if (Checking.ExtractedFilePath.Contains(".uplugin") || Checking.ExtractedFilePath.Contains(".uproject"))
uPluginConvertToJson(Checking.ExtractedFilePath);
}
else { throw new ArgumentException("Error while extracting " + ThePak.CurrentUsedItem); }

File diff suppressed because it is too large Load Diff

View File

@ -68,16 +68,7 @@ namespace FModel
{
try
{
string questFilePath;
if (ThePak.CurrentUsedPakGuid != null && ThePak.CurrentUsedPakGuid != "0-0-0-0")
{
questFilePath = JohnWick.ExtractAsset(ThePak.CurrentUsedPak, questFile);
}
else
{
questFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[questFile], questFile);
}
string questFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[questFile], questFile);
if (questFilePath != null)
{
if (questFilePath.Contains(".uasset") || questFilePath.Contains(".uexp") || questFilePath.Contains(".ubulk"))

View File

@ -289,16 +289,8 @@ namespace FModel
{
if (cSetsjo == null)
{
string oldKey = JohnWick.MyKey; //get the old key
string oldGuid = ThePak.CurrentUsedPakGuid; //get the old guid
JohnWick.MyKey = Settings.Default.AESKey; //set the main key to extract
ThePak.CurrentUsedPakGuid = "0-0-0-0"; //fake the guid -> writeFile need this guid to get the mountPoint, otherwise it crashes
string extractedCosmeticsSetsPath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary["CosmeticSets"], "CosmeticSets");
JohnWick.MyKey = oldKey; //set the old key
ThePak.CurrentUsedPakGuid = oldGuid; //set the old guid
if (extractedCosmeticsSetsPath != null)
{
if (extractedCosmeticsSetsPath.Contains(".uasset") || extractedCosmeticsSetsPath.Contains(".uexp") || extractedCosmeticsSetsPath.Contains(".ubulk"))

View File

@ -55,12 +55,7 @@ namespace FModel
{
if (theItem.HeroDefinition != null)
{
string heroFilePath;
if (ThePak.CurrentUsedPakGuid != null && ThePak.CurrentUsedPakGuid != "0-0-0-0")
heroFilePath = JohnWick.ExtractAsset(ThePak.CurrentUsedPak, theItem.HeroDefinition);
else
heroFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[theItem.HeroDefinition], theItem.HeroDefinition);
string heroFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[theItem.HeroDefinition], theItem.HeroDefinition);
if (heroFilePath != null)
{
if (heroFilePath.Contains(".uasset") || heroFilePath.Contains(".uexp") || heroFilePath.Contains(".ubulk"))
@ -106,16 +101,7 @@ namespace FModel
theItem.WeaponDefinition = "WID_Harvest_Pickaxe_WuKong";
}
string weaponFilePath;
if (ThePak.CurrentUsedPakGuid != null && ThePak.CurrentUsedPakGuid != "0-0-0-0")
{
weaponFilePath = JohnWick.ExtractAsset(ThePak.CurrentUsedPak, theItem.WeaponDefinition);
}
else
{
weaponFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[theItem.WeaponDefinition], theItem.WeaponDefinition);
}
string weaponFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[theItem.WeaponDefinition], theItem.WeaponDefinition);
if (weaponFilePath != null)
{
if (weaponFilePath.Contains(".uasset") || weaponFilePath.Contains(".uexp") || weaponFilePath.Contains(".ubulk"))
@ -211,10 +197,7 @@ namespace FModel
{
try
{
string catalogFilePath = (ThePak.CurrentUsedPakGuid != null && ThePak.CurrentUsedPakGuid != "0-0-0-0")
? catalogFilePath = JohnWick.ExtractAsset(ThePak.CurrentUsedPak, catName)
: catalogFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[catName], catName);
string catalogFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[catName], catName);
if (!string.IsNullOrEmpty(catalogFilePath))
{
Checking.WasFeatured = true;
@ -249,10 +232,6 @@ namespace FModel
break;
}
}
// There is no featured image (as legends pack, shadow pack...)
if (string.IsNullOrEmpty(ItemIconPath))
GetItemIcon(theItem);
}
}
catch (JsonSerializationException)
@ -278,16 +257,7 @@ namespace FModel
/// <param name="toDrawOn"></param>
public static void GetAmmoData(string ammoFile, Graphics toDrawOn)
{
string ammoFilePath;
if (ThePak.CurrentUsedPakGuid != null && ThePak.CurrentUsedPakGuid != "0-0-0-0")
{
ammoFilePath = JohnWick.ExtractAsset(ThePak.CurrentUsedPak, ammoFile.Substring(ammoFile.LastIndexOf('.') + 1));
}
else
{
ammoFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[ammoFile.Substring(ammoFile.LastIndexOf('.') + 1)], ammoFile.Substring(ammoFile.LastIndexOf('.') + 1));
}
string ammoFilePath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary[ammoFile.Substring(ammoFile.LastIndexOf('.') + 1)], ammoFile.Substring(ammoFile.LastIndexOf('.') + 1));
if (ammoFilePath != null)
{
if (ammoFilePath.Contains(".uasset") || ammoFilePath.Contains(".uexp") || ammoFilePath.Contains(".ubulk"))

View File

@ -69,17 +69,8 @@ namespace FModel
{
if (ThePak.AllpaksDictionary.ContainsKey("Game_BR.locres"))
{
string oldKey = JohnWick.MyKey; //get the old key
string oldGuid = ThePak.CurrentUsedPakGuid; //get the old guid
JohnWick.MyKey = Properties.Settings.Default.AESKey; //set the main key to extract
ThePak.CurrentUsedPakGuid = "0-0-0-0"; //fake the guid -> writeFile need this guid to get the mountPoint, otherwise it crashes
string locResPath = JohnWick.ExtractAsset(ThePak.AllpaksDictionary["Game_BR.locres"], "Game_BR.locres");
JohnWick.MyKey = oldKey; //set the old key
ThePak.CurrentUsedPakGuid = oldGuid; //set the old guid
return LocResSerializer.StringFinder(locResPath.Replace("zh-Hant", selectedLanguage));
}
else

View File

@ -24,16 +24,9 @@ namespace FModel
/// <param name="currentItem"></param>
/// <param name="DynamicPak"></param>
/// <returns> the mount point as string, used to create subfolders when extracting or create the tree when loading all paks </returns>
private static string GetMountPointFromDict(string currentItem, bool DynamicPak = false)
private static string GetMountPointFromDict(string currentItem)
{
if (DynamicPak)
{
return ThePak.PaksMountPoint[ThePak.CurrentUsedPak];
}
else
{
return ThePak.PaksMountPoint[ThePak.AllpaksDictionary[currentItem]];
}
return ThePak.PaksMountPoint[ThePak.AllpaksDictionary[currentItem]];
}
/// <summary>
@ -45,20 +38,10 @@ namespace FModel
/// <returns> the path to this brand new created file </returns>
private static string WriteFile(string currentItem, string myResults, byte[] data)
{
if (ThePak.CurrentUsedPakGuid != null && ThePak.CurrentUsedPakGuid != "0-0-0-0")
{
Directory.CreateDirectory(App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem, true) + myResults.Substring(0, myResults.LastIndexOf("/", StringComparison.Ordinal)));
File.WriteAllBytes(App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem, true) + myResults, data);
Directory.CreateDirectory(App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem) + myResults.Substring(0, myResults.LastIndexOf("/", StringComparison.Ordinal)));
File.WriteAllBytes(App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem) + myResults, data);
return App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem, true) + myResults;
}
else
{
Directory.CreateDirectory(App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem) + myResults.Substring(0, myResults.LastIndexOf("/", StringComparison.Ordinal)));
File.WriteAllBytes(App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem) + myResults, data);
return App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem) + myResults;
}
return App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem) + myResults;
}
/// <summary>
@ -71,6 +54,19 @@ namespace FModel
/// <returns> the path of the last created file (usually the uexp file but we don't care about the extension, so it's fine) </returns>
public static string ExtractAsset(string currentPak, string currentItem)
{
ThePak.CurrentUsedPak = currentPak;
ThePak.CurrentUsedPakGuid = ThePak.dynamicPaksList.Where(x => x.thePak == currentPak).Select(x => x.thePakGuid).FirstOrDefault();
if (!string.IsNullOrEmpty(ThePak.CurrentUsedPakGuid) && ThePak.CurrentUsedPakGuid != "0-0-0-0")
{
MyKey = DynamicKeysManager.AESEntries.Where(x => x.thePak == currentPak).Select(x => x.theKey).FirstOrDefault();
}
else
{
ThePak.CurrentUsedPakGuid = "0-0-0-0";
MyKey = Settings.Default.AESKey;
}
if (currentPak != currentPakToCheck || myArray == null)
{
MyExtractor = new PakExtractor(Settings.Default.PAKsPath + "\\" + currentPak, MyKey);
@ -109,10 +105,7 @@ namespace FModel
/// <returns> the path to the png image </returns>
public static string AssetToTexture2D(string AssetName)
{
string textureFilePath = (ThePak.CurrentUsedPakGuid != null && ThePak.CurrentUsedPakGuid != "0-0-0-0")
? ExtractAsset(ThePak.CurrentUsedPak, AssetName)
: ExtractAsset(ThePak.AllpaksDictionary[AssetName], AssetName);
string textureFilePath = ExtractAsset(ThePak.AllpaksDictionary[AssetName], AssetName);
string TexturePath = string.Empty;
if (!string.IsNullOrEmpty(textureFilePath))
{

View File

@ -157,9 +157,6 @@
<data name="wTemplateF" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\wTemplateF.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FModel" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\FModel.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FModel_Logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\FModel_Logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -223,4 +220,7 @@
<data name="E512" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\E512.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="FModel" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\FModel.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

BIN
FModel/Resources/FModel.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 924 KiB

After

Width:  |  Height:  |  Size: 308 KiB