From b290ffa439fb0a23af12055f2b5235165298de2d Mon Sep 17 00:00:00 2001 From: Asval Date: Mon, 12 Aug 2019 16:53:46 +0200 Subject: [PATCH] FModel 2.4.4 --- FModel/MainWindow.cs | 13 +++++-- FModel/Methods/JohnWick/JohnWick.cs | 20 +++-------- FModel/Methods/PakHelper/CreateBackup.cs | 22 ++++++------ FModel/Methods/PakHelper/PakHelper.cs | 14 ++++---- FModel/Methods/VarApp.cs | 1 - FModel/Properties/AssemblyInfo.cs | 4 +-- README.md | 46 ++++++++++++++---------- 7 files changed, 61 insertions(+), 59 deletions(-) diff --git a/FModel/MainWindow.cs b/FModel/MainWindow.cs index bb4ec43e..4c03dac1 100644 --- a/FModel/MainWindow.cs +++ b/FModel/MainWindow.cs @@ -393,7 +393,6 @@ namespace FModel ThePak.AllpaksDictionary = new Dictionary(); ThePak.PaksExtractorDictionary = new Dictionary(); ThePak.PaksFileArrayDictionary = new Dictionary(); - ThePak.PaksMountPoint = new Dictionary(); RegisterSettings.updateModeDictionary = new Dictionary(); PakHelper.PakAsTxt = null; @@ -426,7 +425,11 @@ namespace FModel //ADD TO DICTIONNARY PakHelper.RegisterPaKsinDict(null, true); - if (new System.IO.FileInfo(App.DefaultOutputPath + "\\FortnitePAKs.txt").Length <= 0) //File will always exist so we check the file size instead + if (!File.Exists(App.DefaultOutputPath + "\\FortnitePAKs.txt")) + { + new UpdateMyState("Error while registering pak files in the dictionary", "Error").ChangeProcessState(); + } + else if (new System.IO.FileInfo(App.DefaultOutputPath + "\\FortnitePAKs.txt").Length <= 0) //File will always exist so we check the file size instead { File.Delete(App.DefaultOutputPath + "\\FortnitePAKs.txt"); new UpdateMyState("Can't read .PAK files with this key", "Error").ChangeProcessState(); @@ -454,7 +457,11 @@ namespace FModel //ADD TO DICTIONNARY PakHelper.RegisterPaKsinDict(null, true); - if (new System.IO.FileInfo(App.DefaultOutputPath + "\\FortnitePAKs.txt").Length <= 0) + if (!File.Exists(App.DefaultOutputPath + "\\FortnitePAKs.txt")) + { + new UpdateMyState("Error while registering pak files in the dictionary", "Error").ChangeProcessState(); + } + else if (new System.IO.FileInfo(App.DefaultOutputPath + "\\FortnitePAKs.txt").Length <= 0) { new UpdateMyState("Can't read .PAK files with this key", "Error").ChangeProcessState(); } diff --git a/FModel/Methods/JohnWick/JohnWick.cs b/FModel/Methods/JohnWick/JohnWick.cs index 1d871076..1bb8650b 100644 --- a/FModel/Methods/JohnWick/JohnWick.cs +++ b/FModel/Methods/JohnWick/JohnWick.cs @@ -12,28 +12,18 @@ namespace FModel { public static PakAsset MyAsset; - /// - /// Normal pak file: using AllpaksDictionary, it tells you the pak name depending on currentItem. Using this pak name and PaksMountPoint we get the mount point - /// - /// - /// the mount point as string, used to create subfolders when extracting or create the tree when loading all paks - private static string GetMountPointFromDict(string currentItem) - { - return ThePak.PaksMountPoint[ThePak.AllpaksDictionary[currentItem]]; - } - /// /// just the method to create subfolders using GetMountPointFromDict and write the file from myResults with its byte[] data /// /// /// /// the path to this brand new created file - private static string WriteFile(string currentItem, string myResults, byte[] data) + private static string WriteFile(string myResults, byte[] data) { - Directory.CreateDirectory(App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem) + myResults.Substring(0, myResults.LastIndexOf("/", StringComparison.Ordinal))); - File.WriteAllBytes(App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem) + myResults, data); + Directory.CreateDirectory(App.DefaultOutputPath + "\\Extracted\\" + myResults.Substring(0, myResults.LastIndexOf("/", StringComparison.Ordinal))); + File.WriteAllBytes(App.DefaultOutputPath + "\\Extracted\\" + myResults, data); - return App.DefaultOutputPath + "\\Extracted\\" + GetMountPointFromDict(currentItem) + myResults; + return App.DefaultOutputPath + "\\Extracted\\" + myResults; } /// @@ -67,7 +57,7 @@ namespace FModel uint y = (uint)index; byte[] b = pakExtractor.GetData(y); - AssetPath = WriteFile(currentItem, results[i], b).Replace("/", "\\"); + AssetPath = WriteFile(results[i], b).Replace("/", "\\"); } pakExtractor = null; diff --git a/FModel/Methods/PakHelper/CreateBackup.cs b/FModel/Methods/PakHelper/CreateBackup.cs index f30e6975..cc00ef1b 100644 --- a/FModel/Methods/PakHelper/CreateBackup.cs +++ b/FModel/Methods/PakHelper/CreateBackup.cs @@ -32,15 +32,14 @@ namespace FModel break; } - string[] CurrentUsedPakLines = extractor.GetFileList().ToArray(); - if (CurrentUsedPakLines != null) + if (extractor.GetFileList().ToArray() != null) { string mountPoint = extractor.GetMountPoint(); - for (int ii = 0; ii < CurrentUsedPakLines.Length; ii++) - { - CurrentUsedPakLines[ii] = mountPoint.Substring(9) + CurrentUsedPakLines[ii]; - sb.Append(CurrentUsedPakLines[ii] + "\n"); + string[] fileListWithMountPoint = extractor.GetFileList().Select(s => s.Replace(s, mountPoint.Substring(9) + s)).ToArray(); + for (int ii = 0; ii < fileListWithMountPoint.Length; ii++) + { + sb.Append(fileListWithMountPoint[ii] + "\n"); } new UpdateMyState(".PAK mount point: " + mountPoint.Substring(9), "Waiting").ChangeProcessState(); } @@ -65,15 +64,14 @@ namespace FModel continue; } - string[] CurrentUsedPakLines = extractor.GetFileList().ToArray(); - if (CurrentUsedPakLines != null) + if (extractor.GetFileList().ToArray() != null) { string mountPoint = extractor.GetMountPoint(); - for (int ii = 0; ii < CurrentUsedPakLines.Length; ii++) - { - CurrentUsedPakLines[ii] = mountPoint.Substring(9) + CurrentUsedPakLines[ii]; - sb.Append(CurrentUsedPakLines[ii] + "\n"); + string[] fileListWithMountPoint = extractor.GetFileList().Select(s => s.Replace(s, mountPoint.Substring(9) + s)).ToArray(); + for (int ii = 0; ii < fileListWithMountPoint.Length; ii++) + { + sb.Append(fileListWithMountPoint[ii] + "\n"); } new UpdateMyConsole("Backing up ", Color.Black).AppendToConsole(); new UpdateMyConsole(ThePak.dynamicPaksList[i].thePak, Color.DarkRed, true).AppendToConsole(); diff --git a/FModel/Methods/PakHelper/PakHelper.cs b/FModel/Methods/PakHelper/PakHelper.cs index 58aa6e1b..b55f2548 100644 --- a/FModel/Methods/PakHelper/PakHelper.cs +++ b/FModel/Methods/PakHelper/PakHelper.cs @@ -49,12 +49,12 @@ namespace FModel { bMainKeyWorking = true; string mountPoint = theExtractor.GetMountPoint(); - ThePak.PaksMountPoint.Add(ThePak.mainPaksList[i].thePak, mountPoint.Substring(9)); + string[] fileListWithMountPoint = theExtractor.GetFileList().Select(s => s.Replace(s, mountPoint.Substring(9) + s)).ToArray(); ThePak.PaksExtractorDictionary.Add(ThePak.mainPaksList[i].thePak, theExtractor); - ThePak.PaksFileArrayDictionary.Add(theExtractor, theExtractor.GetFileList().ToArray()); + ThePak.PaksFileArrayDictionary.Add(theExtractor, fileListWithMountPoint); - RegisterInDict(ThePak.mainPaksList[i].thePak, theExtractor.GetFileList().ToArray(), mountPoint, theSinglePak, loadAllPaKs); + RegisterInDict(ThePak.mainPaksList[i].thePak, fileListWithMountPoint, mountPoint, theSinglePak, loadAllPaKs); } } if (bMainKeyWorking) { LoadLocRes.LoadMySelectedLocRes(Settings.Default.IconLanguage); } @@ -83,12 +83,12 @@ namespace FModel if (theExtractor.GetFileList().ToArray() != null) { string mountPoint = theExtractor.GetMountPoint(); - ThePak.PaksMountPoint.Add(ThePak.dynamicPaksList[i].thePak, mountPoint.Substring(9)); + string[] fileListWithMountPoint = theExtractor.GetFileList().Select(s => s.Replace(s, mountPoint.Substring(9) + s)).ToArray(); ThePak.PaksExtractorDictionary.Add(ThePak.dynamicPaksList[i].thePak, theExtractor); - ThePak.PaksFileArrayDictionary.Add(theExtractor, theExtractor.GetFileList().ToArray()); + ThePak.PaksFileArrayDictionary.Add(theExtractor, fileListWithMountPoint); - RegisterInDict(ThePak.dynamicPaksList[i].thePak, theExtractor.GetFileList().ToArray(), mountPoint, theSinglePak, loadAllPaKs); + RegisterInDict(ThePak.dynamicPaksList[i].thePak, fileListWithMountPoint, mountPoint, theSinglePak, loadAllPaKs); } } } @@ -114,8 +114,6 @@ namespace FModel { for (int i = 0; i < thePakLines.Length; i++) { - thePakLines[i] = mountPoint.Substring(9) + thePakLines[i]; - string CurrentUsedPakFileName = thePakLines[i].Substring(thePakLines[i].LastIndexOf("/", StringComparison.Ordinal) + 1); if (CurrentUsedPakFileName.Contains(".uasset") || CurrentUsedPakFileName.Contains(".uexp") || CurrentUsedPakFileName.Contains(".ubulk")) { diff --git a/FModel/Methods/VarApp.cs b/FModel/Methods/VarApp.cs index 15fb9ff2..aadb7edb 100644 --- a/FModel/Methods/VarApp.cs +++ b/FModel/Methods/VarApp.cs @@ -52,7 +52,6 @@ namespace FModel public static Dictionary AllpaksDictionary { get; set; } public static Dictionary PaksExtractorDictionary { get; set; } public static Dictionary PaksFileArrayDictionary { get; set; } - public static Dictionary PaksMountPoint { get; set; } /// /// read the GUID of a the param, it's basically just reading some bytes at the end of a pak file, but it's useful to tell if the pak is dynamically encrypted diff --git a/FModel/Properties/AssemblyInfo.cs b/FModel/Properties/AssemblyInfo.cs index eb472295..8bdff950 100644 --- a/FModel/Properties/AssemblyInfo.cs +++ b/FModel/Properties/AssemblyInfo.cs @@ -33,7 +33,7 @@ using System.Runtime.InteropServices; // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut // en utilisant '*', comme indiqué ci-dessous : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.4.3.0")] -[assembly: AssemblyFileVersion("2.4.3.0")] +[assembly: AssemblyVersion("2.4.4.0")] +[assembly: AssemblyFileVersion("2.4.4.0")] [assembly: NeutralResourcesLanguage("en")] diff --git a/README.md b/README.md index 54f7f11e..91e9a511 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # FModel [![](https://img.shields.io/github/downloads/iAmAsval/FModel/total.svg?color=green&label=Total%20Downloads&logo=buzzfeed&logoColor=white)](https://github.com/iAmAsval/FModel/releases) -[![](https://img.shields.io/github/downloads/iAmAsval/FModel/latest/total.svg?label=2.4.3&logo=buzzfeed&logoColor=white)](https://github.com/iAmAsval/FModel//releases/latest) +[![](https://img.shields.io/github/downloads/iAmAsval/FModel/latest/total.svg?label=2.4.4&logo=buzzfeed&logoColor=white)](https://github.com/iAmAsval/FModel//releases/latest) [![](https://img.shields.io/badge/License-GPL-blue.svg?logo=gnu)](https://github.com/iAmAsval/FModel/blob/master/LICENSE) [![](https://img.shields.io/badge/Twitter-@AsvalFN-1da1f2.svg?logo=twitter)](https://twitter.com/AsvalFN) [![](https://img.shields.io/badge/Discord-Need%20Help%3F-7289da.svg?logo=discord)](https://discord.gg/JmWvXKb) @@ -12,13 +12,13 @@ ### Prerequisites [.NET Framework 4.7.1](https://dotnet.microsoft.com/download/dotnet-framework/net471) ### Download -[![](https://img.shields.io/badge/Release-2.4.3-orange.svg?logo=github)](https://github.com/iAmAsval/FModel/releases/latest) +[![](https://img.shields.io/badge/Release-2.4.4-orange.svg?logo=github)](https://github.com/iAmAsval/FModel/releases/latest) ### How To Use >

Video Tutorial by FireMonkey

**1.** Once you start the executable, you'll be asked to set your path to your Fortnite .PAK files. Meanwhile a `FModel` subfolder will be created in your `Documents` folder. -![](https://i.imgur.com/9AUVUVU.gif) +![](https://i.imgur.com/j0WJcDW.gif) **2.** Restart the executable, go to the AES Manager and add your AES Keys, click **Load** and select your .PAK file - It will parse all Assets contained in the selected .PAK file with their respective path @@ -38,13 +38,13 @@ - Try to convert the Asset to OTF ### Difference Mode -**1.** Create a backup of your .PAK files before the update (**Load** -> **Backup PAKs**) +**1.** Create a backup of your .PAK files before the update, or download one of those i made **2.** Enable Difference Mode **3.** Click `Load Difference` -![](https://i.imgur.com/36icHam.gif) +![](https://i.imgur.com/us68z5R.gif) ### Update Mode **1.** Enable Difference Mode, then Update Mode @@ -53,18 +53,34 @@ **3.** Click `Load And Extract Difference` -[Demonstration](https://streamable.com/234bg) +[Demonstration](https://streamable.com/c39oz) ## DOCUMENTATION -### Important -**PLEASE, IF YOU DON'T KNOW ANYTHING ABOUT FORTNITE GAME FILES/DATAMINING DON'T USE THIS PROGRAM. Asval and those who help make FModel a program have lives to live and can't explain to every single person how to work the program.** +### Q&A +_What's FModel?_ -If you don't know how to compile code from the main page, download the newest release in the releases tab at the top of the site. + - FModel is a Fortnite .PAK files explorer mainly known to create icons for different BR/STW items as well as all BR challenges -If issues occur when compiling the source code, make sure that the software is being built for x64. +_Where can i download FModel?_ +[Latest Version](https://github.com/iAmAsval/FModel/releases/latest/download/FModel.zip) + +_I'm sure the key is correct but opening the file with this key isn't working_ + + - First, make sure `C:\Windows\System32\vcruntime140.dll` isn't missing. If it's missing you can download it by installing [Microsoft Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads). + - If it's not missing you can open on issue on GitHub or contact us on Twitter @AsvalFN @MaikyMOficial @iFireMonkey + +_I can't compile the solution on Visual Studio_ + + - If issues occur when compiling the source code, make sure that the software is being built for x64. + +_Why FModel?_ + + - The name come from the popular Unreal Engine Viewer [UModel](https://github.com/gildor2/UModel) + - It wasn't made to be a competitor but more to complete what was missing exclusively on Fortnite + - Icon creation with languages support, an area to display the serialized asset, single pak file loader, and more). + +If you find this project useful, feel free to give it a :star: thank you :kissing_heart: -If somehow FModel crashed due to permissions, please either disable Windows Defender or add an exception for FModel.exe. -Also if you find this project useful, feel free to give it a :star: thank you :kissing_heart: ### Features 1. Read, Search, Extract, Serialize 2. Icon Creation for various BR/STW Cosmetics or Challenges with language support @@ -81,12 +97,6 @@ Also if you find this project useful, feel free to give it a :star: thank you :k ### Contributors
Waddlesworth
Waddlesworth

🔧
Maiky M
Maiky M

🔧🐦
AyeTSG
AyeTSG

🔧🐦
FireMonkey
FireMonkey

🔧🐦
- -### The History -Basically, I was bored one day and wanted to make something like [UModel](https://github.com/gildor2/UModel) but with a Fortnite Touch and more features. - -I'd highly suggest you to use [UModel](https://github.com/gildor2/UModel) if you want to use something made professionally. - ## TODO - [ ] Code refactoring - [ ] New Heroes icon design with perks and more