diff --git a/Il2CppInspector.Redux.GUI.UI/src/lib/signalr/server-api.ts b/Il2CppInspector.Redux.GUI.UI/src/lib/signalr/server-api.ts
index 7ec02e1..8cb4981 100644
--- a/Il2CppInspector.Redux.GUI.UI/src/lib/signalr/server-api.ts
+++ b/Il2CppInspector.Redux.GUI.UI/src/lib/signalr/server-api.ts
@@ -37,4 +37,8 @@ export class SignalRServerApi {
"GetPotentialUnityVersions",
);
}
+
+ async exportIl2CppFiles(targetDirectory: string) {
+ return await this.connection.send("ExportIl2CppFiles", targetDirectory);
+ }
}
diff --git a/Il2CppInspector.Redux.GUI.UI/src/routes/advanced/+page.svelte b/Il2CppInspector.Redux.GUI.UI/src/routes/advanced/+page.svelte
index 808d508..cb0ee6a 100644
--- a/Il2CppInspector.Redux.GUI.UI/src/routes/advanced/+page.svelte
+++ b/Il2CppInspector.Redux.GUI.UI/src/routes/advanced/+page.svelte
@@ -1,5 +1,22 @@
@@ -7,8 +24,17 @@
+
+
+
x.VersionRange.Min.ToString()).ToList());
}
+
+ public async Task ExportIl2CppFiles(UiClient client, string outputDirectory, CancellationToken cancellationToken = default)
+ {
+ Debug.Assert(_appModels.Count > 0);
+ var pkg = _appModels[0].Package;
+
+ await using (await LoadingSession.Start(client))
+ {
+ await Task.Run(async () =>
+ {
+ Directory.CreateDirectory(outputDirectory);
+
+ await client.ShowLogMessage("Extracting IL2CPP binary", cancellationToken);
+ pkg.SaveBinaryToFile(Path.Join(outputDirectory, pkg.BinaryImage.DefaultFilename));
+
+ await client.ShowLogMessage("Extracting IL2CPP metadata", cancellationToken);
+ pkg.SaveMetadataToFile(Path.Join(outputDirectory, "global-metadata.dat"));
+
+ await client.ShowSuccessToast("Successfully extracted IL2CPP files.", cancellationToken);
+ }, cancellationToken);
+ }
+ }
}
\ No newline at end of file