Listen of a port and wait for a client connection.
41{
43
44
45
46
48 {
49 return;
50 }
51
52
53
54
56
57
58
59
61 {
62
63
64
65 ShowMessages("err, unable to handshake with the remote debugger\n");
66
67
68
69
71
72 return;
73 }
74
75
76
77
79 {
80
81
82
84
85
86
87
89 {
90
91
92
93 ShowMessages("err, unable to handshake with the remote debugger\n");
94 }
95
96
97
98
100
101 return;
102 }
103 else
104 {
105
106
107
109 {
110
111
112
113 ShowMessages("err, unable to handshake with the remote debugger\n");
114
115
116
117
119
120 return;
121 }
122 }
123
124
125
126
128
129
130
131
133
134
135
136
138
139 while (true)
140 {
141
142
143
144
145
147 {
148
149
150
151 break;
152 }
153
154
155
156
158
159
160
161
163
164
165
166
167 if (CommandExecutionResult == 1)
168 {
169
170
171
172 exit(0);
173 }
174
175
176
177
179 }
180
181
182
183
185
186
187
188
190
191
192
193
194 ShowMessages("closing the connection...\n");
195
196
197
198
201}
INT HyperDbgInterpreter(CHAR *Command)
Interpret commands.
Definition interpreter.cpp:800
BOOLEAN g_IsConnectedToRemoteDebugger
Shows whether the current system is a guest (debuggee) and a remote debugger is connected to this sys...
Definition globals.h:103
BYTE g_EndOfBufferCheckTcp[TCP_END_OF_BUFFER_CHARS_COUNT]
the buffer that we set at the end of buffers for tcp connection
Definition globals.h:78
SOCKET g_ServerListenSocket
Server in debuggee needs an extra socket.
Definition globals.h:125
SOCKET g_SeverSocket
The socket object of guest debuggee (not debugger) it is because in HyperDbg, debugger is client and ...
Definition globals.h:119
INT RemoteConnectionSendResultsToHost(const CHAR *sendbuf, INT len)
Send the results of executing a command from deubggee (server, guest) to the debugger (client,...
Definition remote-connection.cpp:481
INT CommunicationServerSendMessage(SOCKET ClientSocket, const CHAR *sendbuf, INT length)
send message as the server
Definition tcpserver.cpp:188
INT CommunicationServerShutdownAndCleanupConnection(SOCKET ClientSocket, SOCKET ListenSocket)
Shutdown and cleanup connection as server.
Definition tcpserver.cpp:216
INT CommunicationServerReceiveMessage(SOCKET ClientSocket, CHAR *recvbuf, INT recvbuflen)
listen and receive message as the server
Definition tcpserver.cpp:147
INT CommunicationServerCreateServerAndWaitForClient(PCSTR Port, SOCKET *ClientSocketArg, SOCKET *ListenSocketArg)
Create server and wait for a client to connect.
Definition tcpserver.cpp:31