HyperDbg Debugger
Toggle main menu visibility
Loading...
Searching...
No Matches
platform-serial.h
Go to the documentation of this file.
1
17
#pragma once
18
19
#if defined(__linux__)
20
# include "
../../../../include/SDK/HyperDbgSdk.h
"
21
#endif
// defined(__linux__)
22
23
//
24
// Distinguishes the two I/O modes the transport uses. On Windows the debugger
25
// side opens the port for overlapped (async) I/O while the debuggee side uses
26
// blocking I/O; this enum lets the platform layer pick the right mechanism
27
// without leaking OVERLAPPED into the protocol code.
28
//
29
typedef
enum
_PLATFORM_SERIAL_IO_ROLE
30
{
31
PLATFORM_SERIAL_IO_DEBUGGER
,
// overlapped / async reads
32
PLATFORM_SERIAL_IO_DEBUGGEE
,
// blocking reads (with comm timeout)
33
34
}
PLATFORM_SERIAL_IO_ROLE
;
35
36
//
37
// OPEN a serial COM port by name for the given role.
38
// Returns a transport handle, or NULL on failure.
39
//
40
HANDLE
41
PlatformSerialOpen
(
const
char
* PortName,
PLATFORM_SERIAL_IO_ROLE
Role);
42
43
//
44
// CONFIGURE baud rate and the fixed 8-N-1 framing the protocol expects.
45
//
46
BOOLEAN
47
PlatformSerialConfigure
(HANDLE Handle,
DWORD
BaudRate);
48
49
//
50
// READ a single byte. *BytesRead is set to the number of bytes actually read.
51
// The caller (protocol layer) owns the packet-assembly loop.
52
//
53
BOOLEAN
54
PlatformSerialReadByte
(HANDLE Handle,
55
CHAR
* OutByte,
56
DWORD
* BytesRead,
57
PLATFORM_SERIAL_IO_ROLE
Role);
58
59
//
60
// WRITE a buffer. Synchronous selects blocking write (debuggee/handshaking)
61
// versus overlapped write (debugger).
62
//
63
BOOLEAN
64
PlatformSerialWrite
(HANDLE Handle,
const
void
* Buffer,
UINT32
Length,
BOOLEAN
Synchronous);
65
66
//
67
// CLOSE the transport handle and release any associated OS resources.
68
//
69
BOOLEAN
70
PlatformSerialClose
(HANDLE Handle);
BOOLEAN
UCHAR BOOLEAN
Definition
BasicTypes.h:35
DWORD
unsigned long DWORD
Definition
BasicTypes.h:38
UINT32
unsigned int UINT32
Definition
BasicTypes.h:54
CHAR
char CHAR
Definition
BasicTypes.h:33
HyperDbgSdk.h
_PLATFORM_SERIAL_IO_ROLE
_PLATFORM_SERIAL_IO_ROLE
Definition
platform-serial.h:30
PLATFORM_SERIAL_IO_DEBUGGEE
@ PLATFORM_SERIAL_IO_DEBUGGEE
Definition
platform-serial.h:32
PLATFORM_SERIAL_IO_DEBUGGER
@ PLATFORM_SERIAL_IO_DEBUGGER
Definition
platform-serial.h:31
PlatformSerialClose
BOOLEAN PlatformSerialClose(HANDLE Handle)
PlatformSerialReadByte
BOOLEAN PlatformSerialReadByte(HANDLE Handle, CHAR *OutByte, DWORD *BytesRead, PLATFORM_SERIAL_IO_ROLE Role)
PlatformSerialConfigure
BOOLEAN PlatformSerialConfigure(HANDLE Handle, DWORD BaudRate)
PLATFORM_SERIAL_IO_ROLE
enum _PLATFORM_SERIAL_IO_ROLE PLATFORM_SERIAL_IO_ROLE
PlatformSerialWrite
BOOLEAN PlatformSerialWrite(HANDLE Handle, const void *Buffer, UINT32 Length, BOOLEAN Synchronous)
PlatformSerialOpen
HANDLE PlatformSerialOpen(const char *PortName, PLATFORM_SERIAL_IO_ROLE Role)
hyperdbg
include
platform
user
header
platform-serial.h
Generated by
1.17.0