From d627cb93df334aa85fe83bc6f9ed9bbb174e011a Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Mon, 7 Dec 2020 00:19:02 +0100 Subject: [PATCH] ELF: Fix incorrect use of SHT_* as bitflag --- 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 66c192d..46d2781 100644 --- a/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs +++ b/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs @@ -488,9 +488,9 @@ namespace Il2CppInspector ImageStart = (uint) conv.Int(s.sh_offset), ImageEnd = (uint) conv.Int(s.sh_offset) + (uint) conv.Int(s.sh_size) - 1, - IsData = ((Elf) conv.Int(s.sh_flags) & Elf.SHF_ALLOC) == Elf.SHF_ALLOC && ((Elf) conv.Int(s.sh_flags) & Elf.SHF_EXECINSTR) == 0 && ((Elf) s.sh_type & Elf.SHT_PROGBITS) == Elf.SHT_PROGBITS, - IsExec = ((Elf) conv.Int(s.sh_flags) & Elf.SHF_EXECINSTR) == Elf.SHF_EXECINSTR && ((Elf) s.sh_type & Elf.SHT_PROGBITS) == Elf.SHT_PROGBITS, - IsBSS = ((Elf) s.sh_type & Elf.SHT_NOBITS) == Elf.SHT_NOBITS, + IsData = ((Elf) conv.Int(s.sh_flags) & Elf.SHF_ALLOC) == Elf.SHF_ALLOC && ((Elf) conv.Int(s.sh_flags) & Elf.SHF_EXECINSTR) == 0 && (Elf) s.sh_type == Elf.SHT_PROGBITS, + IsExec = ((Elf) conv.Int(s.sh_flags) & Elf.SHF_EXECINSTR) == Elf.SHF_EXECINSTR && (Elf) s.sh_type == Elf.SHT_PROGBITS, + IsBSS = (Elf) s.sh_type == Elf.SHT_NOBITS, Name = sectionByName.First(sbn => conv.Int(sbn.Value.sh_offset) == conv.Int(s.sh_offset)).Key });