func (s *Section) Perm() binaryx.Perm { p := binaryx.Perm(0) if s.Section.Flags&SectFlagPureInstructions != 0 { p |= binaryx.PermExecute } // TODO: Add PermWrite and PermRead detection return p }
func (s *Section) Perm() binaryx.Perm { p := binaryx.Perm(0) if s.Section.Characteristics&uint32(SectFlagMemExec) != 0 { p |= binaryx.PermExecute } if s.Section.Characteristics&uint32(SectFlagMemWrite) != 0 { p |= binaryx.PermWrite } if s.Section.Characteristics&uint32(SectFlagMemRead) != 0 { p |= binaryx.PermRead } return p }
func (s *Section) Perm() binaryx.Perm { p := binaryx.Perm(0) if s.Section.Flags&elf.SHF_EXECINSTR != 0 { p |= binaryx.PermExecute } if s.Section.Flags&elf.SHF_WRITE != 0 { p |= binaryx.PermWrite } if s.Section.Flags&elf.SHF_ALLOC != 0 { p |= binaryx.PermRead } return p }