vmReadUint32 reads a uint32 from the process' memory starting at ptr.
(n *seccomp.Notif, ptr uintptr)
| 99 | |
| 100 | // vmReadUint32 reads a uint32 from the process' memory starting at ptr. |
| 101 | func (p *Process) vmReadUint32(n *seccomp.Notif, ptr uintptr) (uint32, syscall.Errno, error) { |
| 102 | b, errno, err := p.vmReadBytes(n, ptr, 4) |
| 103 | if errno != 0 || err != nil { |
| 104 | return 0, errno, err |
| 105 | } |
| 106 | if len(b) < 4 { |
| 107 | return 0, unix.EINVAL, nil |
| 108 | } |
| 109 | return arch.Uint32(b), 0, nil |
| 110 | } |
| 111 | |
| 112 | // vmReadString reads a NULL-terminated string from the process virtual memory |
| 113 | // starting at ptr. |
no test coverage detected