Ejemplo n.º 1
0
func (k *PosixKernel) Mprotect(addr, size uint64, prot enum.MmapProt) uint64 {
	// FIXME: Issue #137
	prot = enum.MmapProt(uc.PROT_ALL)
	if err := k.U.MemProtect(addr, size, int(prot)); err != nil {
		return UINT64_MAX // FIXME
	}
	return 0
}
Ejemplo n.º 2
0
func MmapProt(reg uint64) enum.MmapProt {
	var out enum.MmapProt
	for a, b := range mmapProtMap {
		if int(reg)&a == a {
			out |= enum.MmapProt(b)
		}
	}
	return out
}