236{
246 string NamedPipeAddress;
248 string ComAddress;
250
252 {
253
254
255
257 {
258 ShowMessages("err, debugger is not attached to any instance of debuggee\n");
259 }
260
261 return;
262 }
263 else if (CommandTokens.size() <= 3)
264 {
265 ShowMessages("incorrect use of the '%s'\n\n",
268 return;
269 }
270
271 for (auto Section : CommandTokens)
272 {
273 if (IsFirstCommand)
274 {
275 IsFirstCommand =
FALSE;
276 continue;
277 }
279 {
281 continue;
282 }
284 {
286 continue;
287 }
289 {
291 continue;
292 }
294 {
296 continue;
297 }
299 {
301 continue;
302 }
303 else if (!IsNamedPipeAddressKnown && IsNamedPipe)
304 {
305 IsNamedPipeAddressKnown =
TRUE;
307 continue;
308 }
310 {
311 IsComPortBaudrateKnown =
TRUE;
313
314
315
316
318 {
319
320
321
322 ShowMessages("err, baud rate is invalid\n\n");
324 return;
325 }
326
327 continue;
328 }
329 else if (!IsComPortAddressKnown && IsSerial)
330 {
331 IsComPortAddressKnown =
TRUE;
333
334
335
336
338 {
339
340
341
342 ShowMessages("err, COM port is invalid\n\n");
344 return;
345 }
346
347 continue;
348 }
349 else
350 {
351 ShowMessages("err, couldn't resolve error at '%s'\n\n",
354 return;
355 }
356 }
357
358
359
360
361 if (IsRemote && IsPrepare)
362 {
363 ShowMessages("err, both 'remote' and 'prepare' can't be used together\n\n");
365 return;
366 }
367
368 if (!IsRemote && !IsPrepare)
369 {
370 ShowMessages("err, either 'remote' or 'prepare' should be used\n\n");
372 return;
373 }
374
375
376
377
378 if (IsPrepare && IsPause)
379 {
380 ShowMessages("err, 'pause' cannot be used with 'prepare'\n\n");
382 return;
383 }
384
385
386
387
388 if (IsNamedPipe && IsPrepare)
389 {
390 ShowMessages("err, named pipe cannot be used with 'prepare'\n\n");
392 return;
393 }
394
395
396
397
398 if (IsNamedPipe && NamedPipeAddress.empty())
399 {
400 ShowMessages("err, named pipe address is empty\n\n");
402 return;
403 }
404
405
406
407
408 if (IsSerial && (!IsComPortAddressKnown || !IsComPortBaudrateKnown))
409 {
410 ShowMessages("err, COM port address or baudrate is unknown\n\n");
412 return;
413 }
414
415
416
417
418 if (IsPrepare)
419 {
420
421
422
424 }
425 else
426 {
427
428
429
430 if (IsNamedPipe)
431 {
433 }
434 else if (IsSerial)
435 {
437 }
438 }
439}
std::string GetCaseSensitiveStringFromCommandToken(CommandToken TargetToken)
Get case sensitive string from command token.
Definition common.cpp:467
BOOLEAN CompareLowerCaseStrings(CommandToken TargetToken, const CHAR *StringToCompare)
Compare lower case strings.
Definition common.cpp:503
BOOLEAN HyperDbgDebugRemoteDeviceUsingComPort(const CHAR *PortName, DWORD Baudrate, BOOLEAN PauseAfterConnection)
Connect to a remote serial device (Debugger).
Definition debug.cpp:116
BOOLEAN HyperDbgDebugRemoteDeviceUsingNamedPipe(const CHAR *NamedPipe, BOOLEAN PauseAfterConnection)
Connect to a remote named pipe (Debugger).
Definition debug.cpp:157
BOOLEAN CommandDebugCheckComPort(const CHAR *ComPort, UINT32 *Port)
Check if COM port is valid or not.
Definition debug.cpp:59
BOOLEAN HyperDbgDebugCurrentDeviceUsingComPort(const CHAR *PortName, DWORD Baudrate)
Connect to a remote serial device (Debuggee).
Definition debug.cpp:171
BOOLEAN CommandDebugCheckBaudrate(DWORD Baudrate)
Check if baud rate is valid or not.
Definition debug.cpp:92
VOID CommandDebugHelp()
help of the .debug command
Definition debug.cpp:25
BOOLEAN HyperDbgDebugCloseRemoteDebugger()
Connect to a remote serial device (Debuggee).
Definition debug.cpp:211