diff --git a/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs b/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs index 37d6f1d..732270d 100644 --- a/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs +++ b/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs @@ -176,7 +176,7 @@ namespace Il2CppInspector // Find all relocations; target address => (rela header (rels are converted to rela), symbol table base address, is rela?) var rels = new HashSet(); - StatusUpdate("Processing relocations"); + StatusUpdate("Finding relocations"); // Two types: add value from offset in image, and add value from specified addend foreach (var relSection in getSections(Elf.SHT_REL)) { @@ -222,7 +222,14 @@ namespace Il2CppInspector using var writer = new BinaryWriter(BaseStream, Encoding.Default, true); var relsz = Sizeof(typeof(TSym)); + var currentRel = 0; + var totalRel = rels.Count(); + foreach (var rel in rels) { + currentRel++; + if (currentRel % 1000 == 0) + StatusUpdate($"Processing relocations ({currentRel * 100 / totalRel:F0}%)"); + var symValue = ReadObject(conv.Long(rel.SymbolTable) + conv.Long(rel.SymbolIndex) * relsz).st_value; // S // Ignore relocations into memory addresses not mapped from the image @@ -269,6 +276,8 @@ namespace Il2CppInspector Console.WriteLine($"Processed {rels.Count} relocations"); // Detect and defeat trivial XOR encryption + StatusUpdate("Detecting encryption"); + if (getDynamic(Elf.DT_INIT) != null && sectionByName.ContainsKey(".rodata")) { // Use the data section to determine IF the file is obfuscated var rodataFirstBytes = ReadArray(conv.Long(sectionByName[".rodata"].sh_offset), 256); @@ -323,6 +332,8 @@ namespace Il2CppInspector public override IEnumerable GetExports() => exports; private void processSymbols() { + StatusUpdate("Processing symbols"); + // Three possible symbol tables in ELF files var pTables = new List<(TWord offset, TWord count, TWord strings)>(); diff --git a/Il2CppInspector.GUI/App.xaml.cs b/Il2CppInspector.GUI/App.xaml.cs index a474b34..5b16c1f 100644 --- a/Il2CppInspector.GUI/App.xaml.cs +++ b/Il2CppInspector.GUI/App.xaml.cs @@ -35,7 +35,7 @@ namespace Il2CppInspectorGUI try { OnStatusUpdate?.Invoke(this, "Extracting package"); - var streams = Inspector.GetStreamsFromPackage(packageFiles); + var streams = await Task.Run(() => Inspector.GetStreamsFromPackage(packageFiles)); if (streams == null) throw new InvalidOperationException("The supplied package is not an APK or IPA file, or does not contain a complete IL2CPP application");