From 2afdc8b4211d243118cea169a62bafc49873d228 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Thu, 17 Sep 2020 10:00:47 +0200 Subject: [PATCH] CLI/GUI: Support AAB files --- Il2CppInspector.CLI/Program.cs | 4 ++-- Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs | 8 ++++---- Il2CppInspector.GUI/MainWindow.xaml | 2 +- Il2CppInspector.GUI/MainWindow.xaml.cs | 8 ++++---- README.md | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Il2CppInspector.CLI/Program.cs b/Il2CppInspector.CLI/Program.cs index 0566109..b4d8134 100644 --- a/Il2CppInspector.CLI/Program.cs +++ b/Il2CppInspector.CLI/Program.cs @@ -20,10 +20,10 @@ namespace Il2CppInspector.CLI { private class Options { - [Option('i', "bin", Required = false, Separator = ',', HelpText = "IL2CPP binary, APK or IPA input file(s) (single file or comma-separated list for split APKs)", Default = new[] { "libil2cpp.so" })] + [Option('i', "bin", Required = false, Separator = ',', HelpText = "IL2CPP binary, APK, AAB or IPA input file(s) (single file or comma-separated list for split APKs)", Default = new[] { "libil2cpp.so" })] public IEnumerable BinaryFiles { get; set; } - [Option('m', "metadata", Required = false, HelpText = "IL2CPP metadata file input (ignored for APK/IPA)", Default = "global-metadata.dat")] + [Option('m', "metadata", Required = false, HelpText = "IL2CPP metadata file input (ignored for APK/AAB/IPA)", Default = "global-metadata.dat")] public string MetadataFile { get; set; } [Option('c', "cs-out", Required = false, HelpText = "C# output file (when using single-file layout) or path (when using per namespace, assembly or class layout)", Default = "types.cs")] diff --git a/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs b/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs index c79cd53..345c786 100644 --- a/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs +++ b/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs @@ -381,7 +381,7 @@ namespace Il2CppInspector } #region Loaders - // Finds and extracts the metadata and IL2CPP binary from one or more APK files, or one IPA file into MemoryStreams + // Finds and extracts the metadata and IL2CPP binary from one or more APK files, or one AAB or IPA file into MemoryStreams // Returns null if package not recognized or does not contain an IL2CPP application public static (MemoryStream Metadata, MemoryStream Binary)? GetStreamsFromPackage(IEnumerable packageFiles, bool silent = false) { try { @@ -401,8 +401,8 @@ namespace Il2CppInspector // There are three possibilities: // - A single IPA file containing global-metadata.dat and a single binary supporting one or more architectures // (we return the binary inside the IPA to be loaded by MachOReader for single arch or UBReader for multi arch) - // - A single APK file containing global-metadata.dat and one or more binaries (one per architecture) - // (we return the entire APK to be loaded by APKReader) + // - A single APK or AAB file containing global-metadata.dat and one or more binaries (one per architecture) + // (we return the entire APK or AAB to be loaded by APKReader or AABReader) // - Multiple APK files, one of which contains global-metadadata.dat and the others contain one binary each // (we return all of the binaries re-packed in memory to a new Zip file, to be loaded by APKReader) foreach (var file in packageFiles) { @@ -492,7 +492,7 @@ namespace Il2CppInspector } } - // Load from an IPA or one or more APK files + // Load from an AAB, IPA or one or more APK files public static List LoadFromPackage(IEnumerable packageFiles, bool silent = false) { var streams = GetStreamsFromPackage(packageFiles, silent); if (!streams.HasValue) diff --git a/Il2CppInspector.GUI/MainWindow.xaml b/Il2CppInspector.GUI/MainWindow.xaml index 011e087..d891779 100644 --- a/Il2CppInspector.GUI/MainWindow.xaml +++ b/Il2CppInspector.GUI/MainWindow.xaml @@ -451,7 +451,7 @@ Option 2 - Select or drag & drop one or more APK files or an IPA file + Select or drag & drop one or more APK files, an AAB or IPA file Encrypted IPA files are not supported diff --git a/Il2CppInspector.GUI/MainWindow.xaml.cs b/Il2CppInspector.GUI/MainWindow.xaml.cs index 9ed6852..71238f8 100644 --- a/Il2CppInspector.GUI/MainWindow.xaml.cs +++ b/Il2CppInspector.GUI/MainWindow.xaml.cs @@ -137,11 +137,11 @@ namespace Il2CppInspectorGUI } /// - /// Select APK or IPA package files + /// Select APK, AAB or IPA package files /// private async void BtnSelectPackageFile_OnClick(object sender, RoutedEventArgs e) { var openFileDialog = new OpenFileDialog { - Filter = "Android/iOS Application Package (*.apk;*.ipa;*.zip)|*.apk;*.ipa;*.zip|All files (*.*)|*.*", + Filter = "Android/iOS Application Package (*.apk;*.aab;*.ipa;*.zip)|*.apk;*.aab;*.ipa;*.zip|All files (*.*)|*.*", CheckFileExists = true, Multiselect = true }; @@ -545,14 +545,14 @@ namespace Il2CppInspectorGUI string[] files = (string[]) e.Data.GetData(DataFormats.FileDrop); if (grdFirstPage.Visibility == Visibility.Visible) { - // Metadata or APK/IPA + // Metadata or APK/AAB/IPA if (files.Length == 1) { switch (files[0].ToLower()) { case var s when s.EndsWith(".dat"): await LoadMetadataAsync(s); break; - case var s when s.EndsWith(".apk") || s.EndsWith(".ipa") || s.EndsWith(".zip"): + case var s when s.EndsWith(".apk") || s.EndsWith(".aab") || s.EndsWith(".ipa") || s.EndsWith(".zip"): await LoadPackageAsync(s); break; } diff --git a/README.md b/README.md index 6823fa4..16b123c 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ You can read more about IL2CPP in my series [IL2CPP Reverse Engineering](https:/ File format and architecture support: * Supports ELF (Android .so), PE (Windows .exe), Mach-O (Apple iOS/Mac), Universal Binary (Fat Mach-O) and FSELF (PlayStation 4 .prx/.sprx) file formats -* Also supports single and split APK (Android) and decrypted IPA (iOS) application package files as input +* Also supports single and split APK (Android), AAB (Android App Bundle) and decrypted IPA (iOS) application package files as input * 32-bit and 64-bit support for all file formats * Supports ARMv7, Thumb-2, ARMv8 (A64), x86 and x64 architectures regardless of file format * Supports applications created with Unity 5.3.0 onwards (full IL2CPP version table below) @@ -109,9 +109,9 @@ Run `Il2CppInspector.exe` at the command prompt. File format and architecture are automatically detected. ``` - -i, --bin (Default: libil2cpp.so) IL2CPP binary, APK or IPA input file(s) (single file or comma-separated list for split APKs) + -i, --bin (Default: libil2cpp.so) IL2CPP binary, APK, AAB or IPA input file(s) (single file or comma-separated list for split APKs) - -m, --metadata (Default: global-metadata.dat) IL2CPP metadata file input (ignored for APK/IPA) + -m, --metadata (Default: global-metadata.dat) IL2CPP metadata file input (ignored for APK/AAB/IPA) -c, --cs-out (Default: types.cs) C# output file (when using single-file layout) or path (when using per namespace, assembly or class layout)