func WriteRegister(mask1, mask2 uint32, buffer []uint32) error { code, err := C.T32_WriteRegister(C.dword(mask1), C.dword(mask2), (*C.dword)(unsafe.Pointer(&buffer[0]))) if err != nil { return err } else if code != 0 { return errors.New("T32_WriteRegister Error") } return nil }
func ReadRegister(mask1, mask2 uint32) ([]uint32, error) { var buffer = make([]uint32, 64) code, err := C.T32_ReadRegister(C.dword(mask1), C.dword(mask2), (*C.dword)(unsafe.Pointer(&buffer[0]))) if err != nil { return nil, err } else if code != 0 { return nil, errors.New("T32_ReadRegister Error") } return buffer, nil }
func WriteBreakpoint(address uint32, access, breakpoint, size int) error { code, err := C.T32_WriteBreakpoint(C.dword(address), C.int(access), C.int(breakpoint), C.int(size)) if err != nil { return err } else if code != 0 { return errors.New("T32_WriteBreakpoint Error") } return nil }
func WriteMemoryPipe(address uint32, access int, buffer []byte, size int) error { code, err := C.T32_WriteMemoryPipe(C.dword(address), C.int(access), (*C.byte)(unsafe.Pointer(&buffer[0])), C.int(size)) if err != nil { return err } else if code != 0 { return errors.New("T32_WriteMemoryPipe Error") } return nil }
func ReadBreakpoint(address uint32, access, size int) ([]uint16, error) { var buffer = make([]uint16, size) code, err := C.T32_ReadBreakpoint(C.dword(address), C.int(access), (*C.word)(unsafe.Pointer(&buffer[0])), C.int(size)) if err != nil { return nil, err } else if code != 0 { return nil, errors.New("T32_ReadBreakpoint Error") } return buffer, nil }
func GetSource(address uint32) (string, uint32, error) { var filename = make([]byte, 256) var line uint32 code, err := C.T32_GetSource(C.dword(address), (*C.char)(unsafe.Pointer(&filename[0])), (*C.dword)(&line)) if err != nil { return "", _INVALID_U32, err } else if code != 0 { return "", _INVALID_U32, errors.New("T32_GetSource Error") } return string(filename), line, nil }
func CmdWin(win uint32, command string) error { gcmd := C.CString(command) defer C.free(unsafe.Pointer(gcmd)) code, err := C.T32_CmdWin(C.dword(win), gcmd) if err != nil { return err } else if code != 0 { return errors.New("T32_WinCmd Error") } return nil }