58 |
58 |
59 func PtraceGetFsBase(pid int, fsbase *int64) (err error) { |
59 func PtraceGetFsBase(pid int, fsbase *int64) (err error) { |
60 return ptrace(PT_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0) |
60 return ptrace(PT_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0) |
61 } |
61 } |
62 |
62 |
63 func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) { |
63 func PtraceIO(req int, pid int, offs uintptr, out []byte, countin int) (count int, err error) { |
64 ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint32(countin)} |
64 ioDesc := PtraceIoDesc{ |
|
65 Op: int32(req), |
|
66 Offs: offs, |
|
67 Addr: uintptr(unsafe.Pointer(&out[0])), // TODO(#58351): this is not safe. |
|
68 Len: uint32(countin), |
|
69 } |
65 err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) |
70 err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0) |
66 return int(ioDesc.Len), err |
71 return int(ioDesc.Len), err |
67 } |
72 } |