mirror of
https://github.com/sliverarmory/reflektor
synced 2026-08-25 09:14:48 +00:00
23 lines
400 B
Go
23 lines
400 B
Go
//go:build linux && !android && arm && arm.7
|
|
|
|
package memmod
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
const linuxARMCacheflush = 0x0f0002
|
|
|
|
func flushLinuxInstructionCache(start, end uintptr) error {
|
|
if start >= end {
|
|
return nil
|
|
}
|
|
_, _, errno := unix.Syscall(linuxARMCacheflush, start, end, 0)
|
|
if errno != 0 {
|
|
return fmt.Errorf("cacheflush executable memory: %w", errno)
|
|
}
|
|
return nil
|
|
}
|