MCPcopy
hub / github.com/subtrace/subtrace / vmReadUint32

Method vmReadUint32

cmd/run/engine/process/vm.go:101–110  ·  view source on GitHub ↗

vmReadUint32 reads a uint32 from the process' memory starting at ptr.

(n *seccomp.Notif, ptr uintptr)

Source from the content-addressed store, hash-verified

99
100// vmReadUint32 reads a uint32 from the process' memory starting at ptr.
101func (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.

Callers 2

handleGetsockoptMethod · 0.95
vmWriteSockaddrMethod · 0.95

Calls 1

vmReadBytesMethod · 0.95

Tested by

no test coverage detected