From 1e2299c37cc91a509f1b12369872d27be0ce98a6 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 9 Nov 2017 14:50:42 +0100 Subject: [PATCH] unix: add PtracePokeUser PtracePeekUser was already added in CL 38638, also add its "counterpart" allowing to modify the tracee's user area. Change-Id: Id84e85fe17b5cab7df5ecc83b6b7b8a39241241d Reviewed-on: https://go-review.googlesource.com/76670 Reviewed-by: Ian Lance Taylor --- unix/syscall_linux.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unix/syscall_linux.go b/unix/syscall_linux.go index b98a7e15..9098661a 100644 --- a/unix/syscall_linux.go +++ b/unix/syscall_linux.go @@ -1125,6 +1125,10 @@ func PtracePokeData(pid int, addr uintptr, data []byte) (count int, err error) { return ptracePoke(PTRACE_POKEDATA, PTRACE_PEEKDATA, pid, addr, data) } +func PtracePokeUser(pid int, addr uintptr, data []byte) (count int, err error) { + return ptracePoke(PTRACE_POKEUSR, PTRACE_PEEKUSR, pid, addr, data) +} + func PtraceGetRegs(pid int, regsout *PtraceRegs) (err error) { return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) }