diff --git a/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs b/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs index 73eb519..66c192d 100644 --- a/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs +++ b/Il2CppInspector.Common/FileFormatReaders/ElfReader.cs @@ -473,9 +473,9 @@ namespace Il2CppInspector ImageEnd = (uint) conv.Int(p.p_offset) + (uint) conv.Int(p.p_filesz) - 1, // Not correct but probably the best we can do - IsData = (Elf) p.p_type == Elf.PT_LOAD, - IsExec = (Elf) p.p_type == Elf.PT_LOAD, - IsBSS = (Elf) p.p_type == Elf.PT_LOAD, + IsData = ((Elf) p.p_flags & Elf.PF_R) != 0, + IsExec = ((Elf) p.p_flags & Elf.PF_X) != 0, + IsBSS = conv.Int(p.p_filesz) == 0, Name = string.Empty }); diff --git a/Il2CppInspector.Common/FileFormatReaders/FormatLayouts/Elf.cs b/Il2CppInspector.Common/FileFormatReaders/FormatLayouts/Elf.cs index 2f1b8b8..8134e9d 100644 --- a/Il2CppInspector.Common/FileFormatReaders/FormatLayouts/Elf.cs +++ b/Il2CppInspector.Common/FileFormatReaders/FormatLayouts/Elf.cs @@ -35,6 +35,8 @@ namespace Il2CppInspector DT_PLTGOT = 3, PF_X = 1, + PF_W = 2, + PF_R = 4, // SHTs SHT_PROGBITS = 1,