CLI/GUI: Add support for saving processed metadata and binary
This commit is contained in:
@@ -31,6 +31,7 @@ using Il2CppInspector.Reflection;
|
||||
using Ookii.Dialogs.Wpf;
|
||||
using Path = System.IO.Path;
|
||||
using Il2CppInspector.Cpp.UnityHeaders;
|
||||
using System.IO.Packaging;
|
||||
|
||||
namespace Il2CppInspectorGUI
|
||||
{
|
||||
@@ -42,6 +43,9 @@ namespace Il2CppInspectorGUI
|
||||
public MainWindow() {
|
||||
InitializeComponent();
|
||||
|
||||
// Allow XAML to access properties in the App class
|
||||
DataContext = ((App) Application.Current);
|
||||
|
||||
// Subscribe to status update events
|
||||
((App) Application.Current).OnStatusUpdate += OnStatusUpdate;
|
||||
|
||||
@@ -314,6 +318,43 @@ namespace Il2CppInspectorGUI
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save extracted or decrypted files
|
||||
/// </summary>
|
||||
private async void BtnSaveMetadata_OnClick(object sender, RoutedEventArgs e) {
|
||||
var package = ((AppModel) lstImages.SelectedItem).TypeModel.Package;
|
||||
var saveFileDialog = new SaveFileDialog {
|
||||
Filter = "IL2CPP metadata files (*.dat)|*.dat|All files (*.*)|*.*",
|
||||
FileName = "global-metadata.dat",
|
||||
CheckFileExists = false,
|
||||
OverwritePrompt = true
|
||||
};
|
||||
|
||||
if (saveFileDialog.ShowDialog() == false)
|
||||
return;
|
||||
|
||||
var outPath = saveFileDialog.FileName;
|
||||
await Task.Run(() => package.SaveMetadataToFile(outPath));
|
||||
}
|
||||
|
||||
private async void BtnSaveBinary_OnClick(object sender, RoutedEventArgs e) {
|
||||
var package = ((AppModel) lstImages.SelectedItem).TypeModel.Package;
|
||||
var binaryName = package.BinaryImage.DefaultFilename;
|
||||
|
||||
var saveFileDialog = new SaveFileDialog {
|
||||
Filter = "All files (*.*)|*.*",
|
||||
FileName = binaryName,
|
||||
CheckFileExists = false,
|
||||
OverwritePrompt = true
|
||||
};
|
||||
|
||||
if (saveFileDialog.ShowDialog() == false)
|
||||
return;
|
||||
|
||||
var outPath = saveFileDialog.FileName;
|
||||
await Task.Run(() => package.SaveBinaryToFile(outPath));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Perform export
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user