Example #1
0
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
}
Example #2
0
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
}
Example #3
0
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
}