mirror of
https://github.com/4sval/FModel.git
synced 2026-04-08 10:06:40 -05:00
added merger up down + auto things properties are saved + cleaned last pr (auto pak path + auto main aes) + no more save raw data freeze + diff mode with deleted assets log
This commit is contained in:
parent
0af43df308
commit
83f7a38e43
|
|
@ -85,6 +85,15 @@
|
|||
<setting name="FOpenSounds" serializeAs="String">
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="FAutoExtractRaw" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="FAutoSaveJson" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
<setting name="FAutoSaveImg" serializeAs="String">
|
||||
<value>False</value>
|
||||
</setting>
|
||||
</FModel.Properties.Settings>
|
||||
</userSettings>
|
||||
<runtime>
|
||||
|
|
|
|||
|
|
@ -236,6 +236,8 @@
|
|||
<Compile Include="Methods\PakReader\AssetRegReader.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\AssetReader.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\ExportObject.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\UDictionary\FDictionaryHeader\FDictionaryHeader.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\UDictionary\FDictionaryHeader\FOodleCompressedData.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\UScript\UScriptStruct\FObjectExport.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\UScript\UScriptStruct\FPackageIndex.cs" />
|
||||
<Compile Include="Methods\PakReader\DDSDecoder.cs" />
|
||||
|
|
@ -314,7 +316,7 @@
|
|||
<Compile Include="Methods\PakReader\ExportObject\UCurveTable\ECurveTableMode.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\UCurveTable\UCurveTable.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\UDataTable\UDataTable.cs" />
|
||||
<Compile Include="Methods\PakReader\UDicReader.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\UDictionary\UDictionary.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\UScript\UScriptStruct\FBoxSphereBounds.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\UScript\UScriptStruct\FReferenceSkeleton\FMeshBoneInfo.cs" />
|
||||
<Compile Include="Methods\PakReader\ExportObject\UScript\UScriptStruct\FSkeletalMaterial\FMeshUVChannelInfo.cs" />
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:FModel"
|
||||
xmlns:commands="clr-namespace:FModel.Commands"
|
||||
xmlns:properties="clr-namespace:FModel.Properties"
|
||||
xmlns:TreeViewModel="clr-namespace:FModel.Methods.TreeViewModel"
|
||||
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
|
||||
x:Class="FModel.MainWindow"
|
||||
|
|
@ -18,7 +19,7 @@
|
|||
WindowStartupLocation="CenterScreen"
|
||||
Icon="Logo.ico"
|
||||
Loaded="Window_Loaded"
|
||||
UseLayoutRounding="True">
|
||||
UseLayoutRounding="True" Closed="Window_Closed">
|
||||
<Window.CommandBindings>
|
||||
<CommandBinding Command="{x:Static commands:FModel_Commands.OpenSettings}" Executed="MI_Settings_Click"/>
|
||||
<CommandBinding Command="{x:Static commands:FModel_Commands.OpenSearch}" Executed="MI_Search_Click"/>
|
||||
|
|
@ -64,14 +65,14 @@
|
|||
<Image Source="/FModel;component/Resources/save_16x.png" Height="15" Width="15"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="MI_AutoExportRaw" Header="Auto Export RAW Data" IsCheckable="True"/>
|
||||
<MenuItem x:Name="MI_AutoExportRaw" Header="Auto Export RAW Data" IsCheckable="True" IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=FAutoExtractRaw, Mode=TwoWay}"/>
|
||||
<Separator/>
|
||||
<MenuItem x:Name="MI_SaveJson" Header="Save JSON Data" Click="MI_SaveJson_Click">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="/FModel;component/Resources/save_16x.png" Height="15" Width="15"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="MI_AutoSaveJson" Header="Auto Save JSON Data" IsCheckable="True"/>
|
||||
<MenuItem x:Name="MI_AutoSaveJson" Header="Auto Save JSON Data" IsCheckable="True" IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=FAutoSaveJson, Mode=TwoWay}"/>
|
||||
<Separator/>
|
||||
<MenuItem Header="Open Output Folder" InputGestureText="F3" Command="{x:Static commands:FModel_Commands.OpenOutput}">
|
||||
<MenuItem.Icon>
|
||||
|
|
@ -85,7 +86,7 @@
|
|||
<Image Source="Resources/save_16x.png" Height="15" Width="15"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="MI_Auto_Save_Images" Header="Auto Save Images" IsCheckable="True"/>
|
||||
<MenuItem x:Name="MI_Auto_Save_Images" Header="Auto Save Images" IsCheckable="True" IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=FAutoSaveImg, Mode=TwoWay}"/>
|
||||
<Separator/>
|
||||
<MenuItem Header="Images Merger" InputGestureText="F4" Command="{x:Static commands:FModel_Commands.MergeImages}"/>
|
||||
</MenuItem>
|
||||
|
|
|
|||
|
|
@ -60,6 +60,10 @@ namespace FModel
|
|||
|
||||
AvalonEdit.SetAEConfig();
|
||||
}
|
||||
private void Window_Closed(object sender, System.EventArgs e)
|
||||
{
|
||||
FProp.Default.Save();
|
||||
}
|
||||
|
||||
#region BUTTON EVENTS
|
||||
private void Button_AESManager_Click(object sender, RoutedEventArgs e)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
using FModel.Methods;
|
||||
using FModel.Methods.AESManager;
|
||||
using FModel.Methods.Utilities;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
|
@ -31,47 +26,10 @@ namespace FModel.Forms
|
|||
this.SetValue(TextOptions.TextFormattingModeProperty, TextFormattingMode.Display);
|
||||
}
|
||||
|
||||
private async void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AddLblTxtForDynamicPAKs();
|
||||
GetUserSettings();
|
||||
if (string.IsNullOrEmpty(FProp.Default.FPak_MainAES))
|
||||
{
|
||||
await SetMainKey();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fetch latest version's main aes key.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task SetMainKey()
|
||||
{
|
||||
dynamic key = null;
|
||||
if (DLLImport.IsInternetAvailable())
|
||||
{
|
||||
try
|
||||
{
|
||||
using (HttpClient web = new HttpClient())
|
||||
{
|
||||
//Not using BenBot api since Rate Limit
|
||||
key = JsonConvert.DeserializeObject(await web.GetStringAsync("https://fnbot.shop/api/aes.json"));
|
||||
}
|
||||
MAesTextBox.Text = $"0x{key.aes}";
|
||||
FProp.Default.FPak_MainAES = $"{key.aes}";
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
new UpdateMyConsole("There was a problem getting the latest aes key for main pak files.", CColors.Blue, true).Append();
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
new UpdateMyConsole("Your internet connection is currently unavailable, can't check for dynamic keys at the moment.", CColors.Blue, true).Append();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@
|
|||
<Grid>
|
||||
<ListBox x:Name="ImagesListBox" Margin="0,40,0,0" SelectionMode="Extended"/>
|
||||
<Button x:Name="AddImages_Button" Content="Add" HorizontalAlignment="Left" Margin="0,10,0,0" VerticalAlignment="Top" Width="100" Click="AddImages_Button_Click"/>
|
||||
<Button x:Name="RemoveImage_Button" Content="Remove" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Top" Width="100" Click="RemoveImage_Button_Click"/>
|
||||
<Button x:Name="Up_Button" Content="🡹" HorizontalAlignment="Left" Margin="110,10,0,0" VerticalAlignment="Top" Width="30" Click="Up_Button_Click"/>
|
||||
<Button x:Name="Down_Button" Content="🡻" HorizontalAlignment="Left" Margin="145,10,0,0" VerticalAlignment="Top" Width="30" Click="Down_Button_Click"/>
|
||||
<Button x:Name="RemoveImage_Button" Content="Remove" HorizontalAlignment="Center" Margin="184,10,105,0" VerticalAlignment="Top" Width="100" Click="RemoveImage_Button_Click"/>
|
||||
<Button x:Name="ClearImages_Button" Content="Clear" HorizontalAlignment="Right" Margin="0,10,0,0" VerticalAlignment="Top" Width="100" Click="ClearImages_Button_Click"/>
|
||||
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -251,5 +251,60 @@ namespace FModel.Forms
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async void Up_Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (ImagesListBox.Items.Count > 0 && ImagesListBox.SelectedItems.Count > 0)
|
||||
{
|
||||
bool reloadImage = false;
|
||||
|
||||
int[] indices = ImagesListBox.SelectedItems.Cast<object>().Select(i => ImagesListBox.Items.IndexOf(i)).ToArray();
|
||||
if (indices.Length > 0 && indices[0] > 0)
|
||||
{
|
||||
for (int i = 0; i < ImagesListBox.Items.Count; i++)
|
||||
{
|
||||
if (indices.Contains(i))
|
||||
{
|
||||
object moveItem = ImagesListBox.Items[i];
|
||||
ImagesListBox.Items.Remove(moveItem);
|
||||
ImagesListBox.Items.Insert(i - 1, moveItem);
|
||||
((ListBoxItem)moveItem).IsSelected = true;
|
||||
reloadImage = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
ImagesListBox.SelectedItems.Add(indices);
|
||||
|
||||
if (reloadImage)
|
||||
await UpdateMergerPreview();
|
||||
}
|
||||
}
|
||||
|
||||
private async void Down_Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (ImagesListBox.Items.Count > 0 && ImagesListBox.SelectedItems.Count > 0)
|
||||
{
|
||||
bool reloadImage = false;
|
||||
|
||||
int[] indices = ImagesListBox.SelectedItems.Cast<object>().Select(i => ImagesListBox.Items.IndexOf(i)).ToArray();
|
||||
if (indices.Length > 0 && indices[indices.Length - 1] < ImagesListBox.Items.Count - 1)
|
||||
{
|
||||
for (int i = ImagesListBox.Items.Count - 1; i > -1; --i)
|
||||
{
|
||||
if (indices.Contains(i))
|
||||
{
|
||||
object moveItem = ImagesListBox.Items[i];
|
||||
ImagesListBox.Items.Remove(moveItem);
|
||||
ImagesListBox.Items.Insert(i + 1, moveItem);
|
||||
((ListBoxItem)moveItem).IsSelected = true;
|
||||
reloadImage = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (reloadImage)
|
||||
await UpdateMergerPreview();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,56 +105,9 @@ namespace FModel.Forms
|
|||
SetUserSettings();
|
||||
Close();
|
||||
}
|
||||
/// <summary>
|
||||
/// Get user's Directory Letter.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static string GetEpicDirectory() => Directory.Exists(@"C:\ProgramData\Epic") ? @"C:\ProgramData\Epic" : Directory.Exists(@"D:\ProgramData\Epic") ? @"D:\ProgramData\Epic" : @"E:\ProgramData\Epic";
|
||||
/// <summary>
|
||||
/// Check if the LauncherInstalled.dat exists.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private static bool DatFileExists() => File.Exists($@"{GetEpicDirectory()}\UnrealEngineLauncher\LauncherInstalled.dat");
|
||||
/// <summary>
|
||||
/// Fetch automatically user's game file location.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private string GetGameFiles()
|
||||
{
|
||||
if (DatFileExists())
|
||||
{
|
||||
var games = JsonConvert.DeserializeObject<ParseDatFile>(File.ReadAllText($@"{GetEpicDirectory()}\UnrealEngineLauncher\LauncherInstalled.dat")).List;
|
||||
List<string> AllGames = new List<string>();
|
||||
foreach (var game in games)
|
||||
{
|
||||
AllGames.Add(game.installlocation);
|
||||
}
|
||||
return $@"{AllGames.Where(x => x.Contains("Fortnite")).FirstOrDefault()}\FortniteGame\Content\Paks";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private class ParseDatFile
|
||||
{
|
||||
[JsonProperty("InstallationList")] public InstallationList[] List { get; set; }
|
||||
}
|
||||
private class InstallationList
|
||||
{
|
||||
[JsonProperty("InstallLocation")] public string installlocation { get; set; }
|
||||
}
|
||||
|
||||
private async void GetUserSettings()
|
||||
{
|
||||
string AutoPath = GetGameFiles();
|
||||
if (string.IsNullOrEmpty(FProp.Default.FPak_Path) && DatFileExists() && AutoPath != null)
|
||||
{
|
||||
FProp.Default.FPak_Path = AutoPath;
|
||||
RegisterFromPath.PAK_PATH = AutoPath;
|
||||
RegisterFromPath.FilterPAKs();
|
||||
new UpdateMyProcessEvents("Process events", "State").Update();
|
||||
}
|
||||
|
||||
|
||||
InputTextBox.Text = FProp.Default.FPak_Path;
|
||||
bDiffFileSize.IsChecked = FProp.Default.FDiffFileSize;
|
||||
OutputTextBox.Text = FProp.Default.FOutput_Path;
|
||||
|
|
@ -184,20 +137,22 @@ namespace FModel.Forms
|
|||
|
||||
private void SetUserSettings()
|
||||
{
|
||||
bool restart = false;
|
||||
|
||||
if (!string.Equals(FProp.Default.FPak_Path, InputTextBox.Text))
|
||||
{
|
||||
FProp.Default.FPak_Path = InputTextBox.Text;
|
||||
DarkMessageBox.Show("Please, restart FModel to apply your new input path", "FModel Input Path Changed", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
restart = true;
|
||||
}
|
||||
|
||||
FProp.Default.FDiffFileSize = (bool)bDiffFileSize.IsChecked;
|
||||
FProp.Default.ReloadAES = (bool)bReloadAES.IsChecked;
|
||||
FProp.Default.FOpenSounds = (bool)bOpenSounds.IsChecked;
|
||||
FProp.Default.FOpenSounds = (bool)bOpenSounds.IsChecked;
|
||||
|
||||
if (!string.Equals(FProp.Default.FOutput_Path, OutputTextBox.Text))
|
||||
{
|
||||
FProp.Default.FOutput_Path = OutputTextBox.Text;
|
||||
DarkMessageBox.Show("Please, restart FModel to apply your new output path", "FModel Output Path Changed", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
restart = true;
|
||||
}
|
||||
|
||||
if (AssetEntries.AssetEntriesDict != null && !string.Equals(FProp.Default.FLanguage, ((ComboBoxItem)ComboBox_Language.SelectedItem).Content.ToString()))
|
||||
|
|
@ -220,6 +175,11 @@ namespace FModel.Forms
|
|||
FProp.Default.FBannerOpacity = Convert.ToInt32(OpacityBanner_Slider.Value);
|
||||
|
||||
FProp.Default.Save();
|
||||
|
||||
if (restart)
|
||||
{
|
||||
DarkMessageBox.Show("Please, restart FModel to apply your new path", "FModel Path Changed", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||
}
|
||||
}
|
||||
|
||||
private async void UpdateImageBox(object sender, RoutedEventArgs e)
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ using System.Threading.Tasks;
|
|||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Windows.Media;
|
||||
using FProp = FModel.Properties.Settings;
|
||||
|
||||
namespace FModel.Methods.Assets
|
||||
{
|
||||
|
|
@ -137,14 +138,6 @@ namespace FModel.Methods.Assets
|
|||
FWindow.FMain.Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
FWindow.FMain.AssetPropertiesBox_Main.Text = jsonData;
|
||||
if (FWindow.FMain.MI_AutoExportRaw.IsChecked)
|
||||
{
|
||||
AssetsUtility.ExportAssetData(assetPath);
|
||||
}
|
||||
if (FWindow.FMain.MI_AutoSaveJson.IsChecked)
|
||||
{
|
||||
AssetsUtility.SaveAssetProperties();
|
||||
}
|
||||
});
|
||||
|
||||
if (AssetsUtility.IsValidJson(jsonData))
|
||||
|
|
|
|||
|
|
@ -103,11 +103,6 @@ namespace FModel.Methods.PAKs
|
|||
{
|
||||
TasksUtility.TaskCompleted(TheTask.Exception);
|
||||
});
|
||||
FWindow.FMain.TreeView_Main.IsEnabled = true;
|
||||
|
||||
FWindow.FMain.MI_LoadAllPAKs.IsEnabled = true;
|
||||
FWindow.FMain.MI_BackupPAKs.IsEnabled = true;
|
||||
FWindow.FMain.MI_DifferenceMode.IsEnabled = true;
|
||||
}
|
||||
|
||||
private static void LoadPAKFiles(bool bAllPAKs = false)
|
||||
|
|
@ -296,6 +291,32 @@ namespace FModel.Methods.PAKs
|
|||
});
|
||||
|
||||
new UpdateMyProcessEvents("All PAK files have been compared successfully", "Success").Update();
|
||||
await FWindow.FMain.Dispatcher.InvokeAsync(() =>
|
||||
{
|
||||
FWindow.FMain.TreeView_Main.IsEnabled = true;
|
||||
FWindow.FMain.MI_LoadAllPAKs.IsEnabled = true;
|
||||
FWindow.FMain.MI_BackupPAKs.IsEnabled = true;
|
||||
FWindow.FMain.MI_DifferenceMode.IsEnabled = true;
|
||||
});
|
||||
|
||||
//PRINT REMOVED IF NO FILE SIZE CHECK
|
||||
if (!FProp.Default.FDiffFileSize)
|
||||
{
|
||||
IEnumerable<FPakEntry> removedAssets = BackupEntries.Except(LocalEntries.ToArray());
|
||||
|
||||
List<string> removedItems = new List<string>();
|
||||
foreach (FPakEntry entry in removedAssets)
|
||||
{
|
||||
if (entry.Name.StartsWith("/FortniteGame/Content/Athena/Items/Cosmetics/"))
|
||||
removedItems.Add(entry.Name.Substring(0, entry.Name.LastIndexOf(".")));
|
||||
}
|
||||
|
||||
if (removedItems.Count > 0)
|
||||
{
|
||||
new UpdateMyConsole("Items Removed/Renamed:", CColors.Red, true).Append();
|
||||
removedItems.Distinct().ToList().ForEach(e => new UpdateMyConsole($" - {e.Substring(1)}", CColors.White, true).Append());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
using FModel.Methods.Utilities;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
|
@ -14,6 +16,21 @@ namespace FModel.Methods.PAKs
|
|||
|
||||
public static void FilterPAKs()
|
||||
{
|
||||
if (string.IsNullOrEmpty(FProp.Default.FPak_Path) && DatFileExists())
|
||||
{
|
||||
string AutoPath = GetGameFiles();
|
||||
if (!string.IsNullOrEmpty(AutoPath))
|
||||
{
|
||||
new UpdateMyConsole(".PAK files path detected at ", CColors.White).Append();
|
||||
new UpdateMyConsole(AutoPath, CColors.Blue, true).Append();
|
||||
|
||||
FProp.Default.FPak_Path = AutoPath;
|
||||
FProp.Default.Save();
|
||||
|
||||
PAK_PATH = FProp.Default.FPak_Path;
|
||||
}
|
||||
}
|
||||
|
||||
if (Directory.Exists(PAK_PATH))
|
||||
{
|
||||
PAKEntries.PAKEntriesList = new List<PAKInfosEntry>();
|
||||
|
|
@ -57,5 +74,34 @@ namespace FModel.Methods.PAKs
|
|||
{
|
||||
return Directory.GetFiles(PAK_PATH, "*.pak", SearchOption.AllDirectories);
|
||||
}
|
||||
|
||||
private static string GetEpicDirectory() => Directory.Exists(@"C:\ProgramData\Epic") ? @"C:\ProgramData\Epic" : Directory.Exists(@"D:\ProgramData\Epic") ? @"D:\ProgramData\Epic" : @"E:\ProgramData\Epic";
|
||||
private static bool DatFileExists() => File.Exists($@"{GetEpicDirectory()}\UnrealEngineLauncher\LauncherInstalled.dat");
|
||||
private static string GetGameFiles()
|
||||
{
|
||||
if (DatFileExists())
|
||||
{
|
||||
string jsonData = File.ReadAllText($@"{GetEpicDirectory()}\UnrealEngineLauncher\LauncherInstalled.dat");
|
||||
if (AssetsUtility.IsValidJson(jsonData))
|
||||
{
|
||||
JToken games = JsonConvert.DeserializeObject<JToken>(jsonData);
|
||||
if (games != null)
|
||||
{
|
||||
JArray installationListArray = games["InstallationList"].Value<JArray>();
|
||||
if (installationListArray != null)
|
||||
{
|
||||
foreach (JToken game in installationListArray)
|
||||
{
|
||||
if (string.Equals(game["AppName"].Value<string>(), "Fortnite"))
|
||||
{
|
||||
return $@"{game["InstallLocation"].Value<string>()}\FortniteGame\Content\Paks";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
using System.IO;
|
||||
|
||||
namespace PakReader
|
||||
{
|
||||
public class FDictionaryHeader
|
||||
{
|
||||
public uint Magic;
|
||||
public uint DictionaryVersion;
|
||||
public uint OodleMajorHeaderVersion;
|
||||
public int HashTableSize;
|
||||
public FOodleCompressedData DictionaryData;
|
||||
public FOodleCompressedData CompressorData;
|
||||
|
||||
public FDictionaryHeader(BinaryReader reader)
|
||||
{
|
||||
Magic = reader.ReadUInt32();
|
||||
DictionaryVersion = reader.ReadUInt32();
|
||||
OodleMajorHeaderVersion = reader.ReadUInt32();
|
||||
HashTableSize = reader.ReadInt32();
|
||||
DictionaryData = new FOodleCompressedData(reader);
|
||||
CompressorData = new FOodleCompressedData(reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
using System.IO;
|
||||
|
||||
namespace PakReader
|
||||
{
|
||||
public class FOodleCompressedData
|
||||
{
|
||||
public uint Offset;
|
||||
public uint CompressedLength;
|
||||
public uint DecompressedLength;
|
||||
|
||||
public FOodleCompressedData(BinaryReader reader)
|
||||
{
|
||||
Offset = reader.ReadUInt32();
|
||||
CompressedLength = reader.ReadUInt32();
|
||||
DecompressedLength = reader.ReadUInt32();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -51,38 +51,4 @@ namespace PakReader
|
|||
return DecompressedData;
|
||||
}
|
||||
}
|
||||
|
||||
public class FDictionaryHeader
|
||||
{
|
||||
public uint Magic;
|
||||
public uint DictionaryVersion;
|
||||
public uint OodleMajorHeaderVersion;
|
||||
public int HashTableSize;
|
||||
public FOodleCompressedData DictionaryData;
|
||||
public FOodleCompressedData CompressorData;
|
||||
|
||||
public FDictionaryHeader(BinaryReader reader)
|
||||
{
|
||||
Magic = reader.ReadUInt32();
|
||||
DictionaryVersion = reader.ReadUInt32();
|
||||
OodleMajorHeaderVersion = reader.ReadUInt32();
|
||||
HashTableSize = reader.ReadInt32();
|
||||
DictionaryData = new FOodleCompressedData(reader);
|
||||
CompressorData = new FOodleCompressedData(reader);
|
||||
}
|
||||
}
|
||||
|
||||
public class FOodleCompressedData
|
||||
{
|
||||
public uint Offset;
|
||||
public uint CompressedLength;
|
||||
public uint DecompressedLength;
|
||||
|
||||
public FOodleCompressedData(BinaryReader reader)
|
||||
{
|
||||
Offset = reader.ReadUInt32();
|
||||
CompressedLength = reader.ReadUInt32();
|
||||
DecompressedLength = reader.ReadUInt32();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -121,6 +121,34 @@ namespace FModel.Methods.Utilities
|
|||
|
||||
foreach (FPakEntry entry in entriesList)
|
||||
{
|
||||
#region AUTO EXTRACT RAW
|
||||
if (FProp.Default.FAutoExtractRaw)
|
||||
{
|
||||
string path = FProp.Default.FOutput_Path + "\\Exports\\" + entry.Name;
|
||||
string pWExt = FoldersUtility.GetFullPathWithoutExtension(entry.Name);
|
||||
string subfolders = pWExt.Substring(0, pWExt.LastIndexOf("/", StringComparison.InvariantCultureIgnoreCase));
|
||||
|
||||
Directory.CreateDirectory(FProp.Default.FOutput_Path + "\\Exports\\" + subfolders);
|
||||
Stream stream = reader.GetPackageStream(entry);
|
||||
using (var fStream = File.OpenWrite(path))
|
||||
using (stream)
|
||||
{
|
||||
stream.CopyTo(fStream);
|
||||
}
|
||||
|
||||
if (File.Exists(path))
|
||||
{
|
||||
new UpdateMyConsole(Path.GetFileName(path), CColors.Blue).Append();
|
||||
new UpdateMyConsole(" successfully exported", CColors.White, true).Append();
|
||||
}
|
||||
else //just in case
|
||||
{
|
||||
new UpdateMyConsole("Bruh moment\nCouldn't export ", CColors.White).Append();
|
||||
new UpdateMyConsole(Path.GetFileName(path), CColors.Blue, true).Append();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
switch (Path.GetExtension(entry.Name.ToLowerInvariant()))
|
||||
{
|
||||
case ".ini":
|
||||
|
|
@ -218,7 +246,31 @@ namespace FModel.Methods.Utilities
|
|||
}
|
||||
}
|
||||
|
||||
return JsonConvert.SerializeObject(ar.Exports, Formatting.Indented);
|
||||
string stringData = JsonConvert.SerializeObject(ar.Exports, Formatting.Indented);
|
||||
|
||||
#region AUTO SAVE JSON
|
||||
if (FProp.Default.FAutoSaveJson)
|
||||
{
|
||||
string name = Path.GetFileNameWithoutExtension(entriesList.ElementAt(0).Name);
|
||||
string path = FProp.Default.FOutput_Path + "\\JSONs\\" + name + ".json";
|
||||
if (!string.IsNullOrEmpty(stringData))
|
||||
{
|
||||
File.WriteAllText(path, stringData);
|
||||
if (File.Exists(path))
|
||||
{
|
||||
new UpdateMyConsole(name, CColors.Blue).Append();
|
||||
new UpdateMyConsole("'s Json data successfully saved", CColors.White, true).Append();
|
||||
}
|
||||
else //just in case
|
||||
{
|
||||
new UpdateMyConsole("Bruh moment\nCouldn't export ", CColors.White).Append();
|
||||
new UpdateMyConsole(name, CColors.Blue, true).Append();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
return stringData;
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using Newtonsoft.Json.Linq;
|
||||
using RestSharp;
|
||||
using System.Collections.Generic;
|
||||
using FProp = FModel.Properties.Settings;
|
||||
|
||||
namespace FModel.Methods.Utilities
|
||||
{
|
||||
|
|
@ -51,6 +52,13 @@ namespace FModel.Methods.Utilities
|
|||
string EndpointContent = GetEndpoint("http://benbotfn.tk:8080/api/aes");
|
||||
if (!string.IsNullOrEmpty(EndpointContent))
|
||||
{
|
||||
if (string.IsNullOrEmpty(FProp.Default.FPak_MainAES))
|
||||
{
|
||||
JToken mainKeyToken = JObject.Parse(EndpointContent).SelectToken("mainKey");
|
||||
FProp.Default.FPak_MainAES = mainKeyToken != null ? $"{mainKeyToken.Value<string>().Substring(2).ToUpperInvariant()}" : "";
|
||||
FProp.Default.Save();
|
||||
}
|
||||
|
||||
JToken dynamicPaks = JObject.Parse(EndpointContent).SelectToken("additionalKeys");
|
||||
return JToken.Parse(dynamicPaks.ToString()).ToString().TrimStart('[').TrimEnd(']');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using FindReplace;
|
|||
using ICSharpCode.AvalonEdit;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Media;
|
||||
using FProp = FModel.Properties.Settings;
|
||||
|
|
@ -52,6 +51,9 @@ namespace FModel.Methods.Utilities
|
|||
case "Success":
|
||||
FWindow.FMain.StateTextBlock.Background = new SolidColorBrush(Color.FromRgb(0, 158, 63));
|
||||
break;
|
||||
case "State":
|
||||
FWindow.FMain.StateTextBlock.Background = new SolidColorBrush(Color.FromRgb(28, 32, 38));
|
||||
break;
|
||||
default:
|
||||
FWindow.FMain.StateTextBlock.Background = new SolidColorBrush(Color.FromRgb(28, 32, 38));
|
||||
break;
|
||||
|
|
@ -205,7 +207,6 @@ namespace FModel.Methods.Utilities
|
|||
|
||||
return foundChild;
|
||||
}
|
||||
|
||||
public static void AutoUpdaterOnCheckForUpdateEvent(UpdateInfoEventArgs args)
|
||||
{
|
||||
if (args != null)
|
||||
|
|
|
|||
36
FModel/Properties/Settings.Designer.cs
generated
36
FModel/Properties/Settings.Designer.cs
generated
|
|
@ -322,5 +322,41 @@ namespace FModel.Properties {
|
|||
this["FOpenSounds"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool FAutoExtractRaw {
|
||||
get {
|
||||
return ((bool)(this["FAutoExtractRaw"]));
|
||||
}
|
||||
set {
|
||||
this["FAutoExtractRaw"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool FAutoSaveJson {
|
||||
get {
|
||||
return ((bool)(this["FAutoSaveJson"]));
|
||||
}
|
||||
set {
|
||||
this["FAutoSaveJson"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
||||
public bool FAutoSaveImg {
|
||||
get {
|
||||
return ((bool)(this["FAutoSaveImg"]));
|
||||
}
|
||||
set {
|
||||
this["FAutoSaveImg"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,5 +77,14 @@
|
|||
<Setting Name="FOpenSounds" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="FAutoExtractRaw" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="FAutoSaveJson" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
<Setting Name="FAutoSaveImg" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
Loading…
Reference in New Issue
Block a user