From ee93343ff842a1ea8b9ace70150a25956b032b0d Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Fri, 14 Feb 2020 15:11:29 +0100 Subject: [PATCH] ELF: Fix DT_INIT from GetFunctionTable() wasn't mapped to file offset --- Il2CppInspector.Common/FileFormatReaders/ElfReader.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs b/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs index 8a7c76a..582619f 100644 --- a/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs +++ b/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs @@ -341,13 +341,13 @@ namespace Il2CppInspector var init = MapVATR(conv.ULong(getDynamic(Elf.DT_INIT_ARRAY).d_un)); var size = getDynamic(Elf.DT_INIT_ARRAYSZ).d_un; - var init_array = conv.UIntArray(ReadArray(init, conv.Int(size) / (Bits / 8))).Select(x => MapVATR(x)); + var init_array = conv.UIntArray(ReadArray(init, conv.Int(size) / (Bits / 8))); // Additionally, check if there is an old-style DT_INIT function and include it in the list if so if (getDynamic(Elf.DT_INIT) != null) - init_array = init_array.Concat(conv.UIntArray(new[] {getDynamic(Elf.DT_INIT).d_un})); + init_array = init_array.Concat(conv.UIntArray(new[] { getDynamic(Elf.DT_INIT).d_un })).ToArray(); - return init_array.ToArray(); + return init_array.Select(x => MapVATR(x)).ToArray(); } // Map a virtual address to an offset into the image file. Throws an exception if the virtual address is not mapped into the file.