FModel 2.4.4

This commit is contained in:
Asval 2019-08-12 16:53:46 +02:00
parent f0ff619f9b
commit b290ffa439
7 changed files with 61 additions and 59 deletions

View File

@ -393,7 +393,6 @@ namespace FModel
ThePak.AllpaksDictionary = new Dictionary<string, string>();
ThePak.PaksExtractorDictionary = new Dictionary<string, PakExtractor>();
ThePak.PaksFileArrayDictionary = new Dictionary<PakExtractor, string[]>();
ThePak.PaksMountPoint = new Dictionary<string, string>();
RegisterSettings.updateModeDictionary = new Dictionary<string, string>();
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();
}

View File

@ -12,28 +12,18 @@ namespace FModel
{
public static PakAsset MyAsset;
/// <summary>
/// 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
/// </summary>
/// <param name="currentItem"></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)
{
return ThePak.PaksMountPoint[ThePak.AllpaksDictionary[currentItem]];
}
/// <summary>
/// just the method to create subfolders using GetMountPointFromDict and write the file from myResults with its byte[] data
/// </summary>
/// <param name="myResults"></param>
/// <param name="data"></param>
/// <returns> the path to this brand new created file </returns>
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;
}
/// <summary>
@ -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;

View File

@ -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();

View File

@ -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"))
{

View File

@ -52,7 +52,6 @@ namespace FModel
public static Dictionary<string, string> AllpaksDictionary { get; set; }
public static Dictionary<string, PakExtractor> PaksExtractorDictionary { get; set; }
public static Dictionary<PakExtractor, string[]> PaksFileArrayDictionary { get; set; }
public static Dictionary<string, string> PaksMountPoint { get; set; }
/// <summary>
/// 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

View File

@ -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")]

View File

@ -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
><p align="center"><a href="https://www.youtube.com/watch?v=rWlux5vg9Xs">Video Tutorial by FireMonkey</a></p>
**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
<table><tr><td align="center"><a href="https://github.com/SirWaddles"><img src="https://avatars1.githubusercontent.com/u/769399?s=200&v=4" width="100px;" alt="Waddlesworth"/><br /><sub><b>Waddlesworth</b></sub></a><br><a href="https://github.com/SirWaddles" title="Github">🔧</a></td><td align="center"><a href="https://github.com/MaikyM"><img src="https://avatars3.githubusercontent.com/u/51415805?s=200&v=4" width="100px;" alt="Maiky M"/><br /><sub><b>Maiky M</b></sub></a><br /><a href="https://github.com/MaikyM" title="Github">🔧</a><a href="https://twitter.com/MaikyMOficial" title="Twitter">🐦</a></td><td align="center"><a href="https://github.com/AyeTSG"><img src="https://avatars1.githubusercontent.com/u/49595354?s=200&v=4" width="100px;" alt="AyeTSG"/><br><sub><b>AyeTSG</b></sub></a><br><a href="https://github.com/AyeTSG" title="Github">🔧</a><a href="https://twitter.com/AyeTSG" title="Twitter">🐦</a></td><td align="center"><a href="https://github.com/ItsFireMonkey"><img src="https://avatars2.githubusercontent.com/u/38590471?s=200&v=4" width="100px;" alt="FireMonkey"/><br /><sub><b>FireMonkey</b></sub></a><br><a href="https://github.com/ItsFireMonkey" title="Github">🔧</a><a href="https://twitter.com/iFireMonkey" title="Twitter">🐦</a></td></tr></table>
### 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