From 9083be4c1833b94204d9535206a7f7959e1a17da Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Thu, 13 Feb 2020 18:05:26 +0100 Subject: [PATCH] ELF: Don't decrypt if there is no .rodata section (part of #21) --- Il2CppInspector.Common/FileFormatReaders/ElfReader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs b/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs index f144ca5..795dbef 100644 --- a/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs +++ b/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs @@ -252,7 +252,7 @@ namespace Il2CppInspector Console.WriteLine($"Processed {rels.Count} relocations"); // Detect and defeat trivial XOR encryption - if (dynamic_table.Any(d => (Elf) conv.Int(d.d_tag) == Elf.DT_INIT)) { + if (getDynamic(Elf.DT_INIT) != null && sectionByName.ContainsKey(".rodata")) { var rodataFirstBytes = ReadArray(conv.Long(sectionByName[".rodata"].sh_offset), 256); var xorKey = rodataFirstBytes.GroupBy(b => b).OrderByDescending(f => f.Count()).First().Key;