MCPcopy Index your code
hub / github.com/codeyourweb/irma / ReadProcessMemory

Function ReadProcessMemory

w32.go:137–146  ·  view source on GitHub ↗

ReadProcessMemory is a wrapper for the same WIN32 API function https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-readprocessmemory

(hProcess windows.Handle, lpBaseAddress uintptr, nSize uintptr)

Source from the content-addressed store, hash-verified

135// ReadProcessMemory is a wrapper for the same WIN32 API function
136// https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-readprocessmemory
137func ReadProcessMemory(hProcess windows.Handle, lpBaseAddress uintptr, nSize uintptr) (data []byte, err error) {
138 data = make([]byte, nSize)
139 var lpNumberOfBytesRead uint32 = 0
140 ret, _, err := syscall.Syscall6(procReadProcessMemory.Addr(), 5, uintptr(hProcess), lpBaseAddress, uintptr(unsafe.Pointer(&data[0])), nSize, uintptr(unsafe.Pointer(&lpNumberOfBytesRead)), 0)
141 if ret == 0 {
142 return nil, err
143 }
144
145 return data, nil
146}
147
148// CreateMutex is a wrapper for CreateMutexW WIN32 API function
149// https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-createmutexw

Callers 1

DumpModuleMemoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected