I’d like to print the virtual memory content of the current program from 0x10000
to 0x50000
(an area containing a syscall trampoline on my system).
package main
import (
"syscall"
"unsafe"
)
func main() {
syscall.Syscall(SYS_WRITE, uintptr(1), uintptr(unsafe.Pointer(0x10000)), uintptr(0x40000))
}
However when I tried to compile I’m getting that error :
cannot convert 65536 (type int) to type unsafe.Pointer
In my case,cgo
is disabled (import "C"
fails at compile time).
Also does syscall.Syscall(SYS_WRITE
is the only way to do it ?