211{
214
215 if (SplitCommand.size() == 2 && !SplitCommand.at(1).compare("close"))
216 {
217
218
219
221 {
223 }
224 else
225 {
227 "err, debugger is not attached to any instance of debuggee\n");
228 }
229 return;
230 }
231 else if (SplitCommand.size() <= 3)
232 {
235 return;
236 }
237
238
239
240
241 if (!SplitCommand.at(1).compare("remote"))
242 {
243
244
245
246
247 if (!SplitCommand.at(2).compare("serial"))
248 {
249
250
251
252 if (SplitCommand.size() != 5)
253 {
256 return;
257 }
258
259
260
261
263 {
264
265
266
268 SplitCommand.at(3).c_str());
270 return;
271 }
272
273 Baudrate = stoi(SplitCommand.at(3));
274
275
276
277
279 {
280
281
282
285 return;
286 }
287
288
289
290
292 {
293
294
295
298 return;
299 }
300
301
302
303
305 }
306 else if (!SplitCommand.at(2).compare("namedpipe"))
307 {
308
309
310
311 string Delimiter = "namedpipe";
312 string Token = Command.substr(
313 Command.find(Delimiter) + Delimiter.size() + 1,
314 Command.size());
315
316
317
318
320 }
321 else
322 {
323
324
325
326 ShowMessages(
"unknown parameter '%s'\n\n", SplitCommand.at(2).c_str());
328 return;
329 }
330 }
331 else if (!SplitCommand.at(1).compare("prepare"))
332 {
333 if (SplitCommand.size() != 5)
334 {
337 return;
338 }
339
340
341
342
343
344 if (!SplitCommand.at(2).compare("serial"))
345 {
346
347
348
350 {
351
352
353
355 SplitCommand.at(3).c_str());
357 return;
358 }
359
360 Baudrate = stoi(SplitCommand.at(3));
361
362
363
364
366 {
367
368
369
372 return;
373 }
374
375
376
377
379 {
380
381
382
385 return;
386 }
387
388
389
390
392 }
393 else
394 {
395 ShowMessages(
"invalid parameter '%s'\n\n", SplitCommand.at(2));
397 return;
398 }
399 }
400 else
401 {
402 ShowMessages(
"invalid parameter '%s'\n\n", SplitCommand.at(1));
404 return;
405 }
406}
unsigned int UINT32
Definition BasicTypes.h:48
BOOLEAN IsNumber(const string &str)
check if given string is a numeric string or not
Definition common.cpp:145
BOOLEAN HyperDbgDebugRemoteDeviceUsingNamedPipe(const CHAR *NamedPipe)
Connect to a remote named pipe (Debugger)
Definition debug.cpp:156
BOOLEAN HyperDbgDebugRemoteDeviceUsingComPort(const CHAR *PortName, DWORD Baudrate)
Connect to a remote serial device (Debugger)
Definition debug.cpp:116
BOOLEAN CommandDebugCheckComPort(const CHAR *ComPort, UINT32 *Port)
Check if COM port is valid or not.
Definition debug.cpp:60
BOOLEAN HyperDbgDebugCurrentDeviceUsingComPort(const CHAR *PortName, DWORD Baudrate)
Connect to a remote serial device (Debuggee)
Definition debug.cpp:170
BOOLEAN CommandDebugCheckBaudrate(DWORD Baudrate)
Check if baud rate is valid or not.
Definition debug.cpp:93
VOID CommandDebugHelp()
help of the .debug command
Definition debug.cpp:29
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest)
Definition globals.h:231
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96