ELF: Improve GetSections() accuracy when only PHT is available

This commit is contained in:
Katy Coe
2020-12-05 19:05:40 +01:00
parent aaa90370d1
commit bdf43a642d
2 changed files with 5 additions and 3 deletions

View File

@@ -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
});

View File

@@ -35,6 +35,8 @@ namespace Il2CppInspector
DT_PLTGOT = 3,
PF_X = 1,
PF_W = 2,
PF_R = 4,
// SHTs
SHT_PROGBITS = 1,