(pid int32)
| 11 | ) |
| 12 | |
| 13 | func OpenProcess(pid int32) (windows.Handle, error) { |
| 14 | handle, err := windows.OpenProcess(utils.PROCESS_VM_READ|utils.PROCESS_QUERY_INFORMATION, false, uint32(pid)) |
| 15 | if err != nil { |
| 16 | // return 0, fmt.Errorf("failed to open process: %v", err) |
| 17 | } |
| 18 | return handle, nil |
| 19 | } |
| 20 | func ReadMemory(handle windows.Handle, address uintptr, size uint32) ([]byte, error) { |
| 21 | buffer := make([]byte, size) |
| 22 | var bytesRead uintptr |
no outgoing calls
no test coverage detected