HyperDbg/hyperdbg/libhyperdbg/code/debugger/commands/debugging-commands/bl.cpp

76 lines
1.5 KiB
C++
Raw Normal View History

2021-03-11 01:17:23 +03:30
/**
* @file bl.cpp
2022-01-18 22:38:56 +03:30
* @author Sina Karvandi (sina@hyperdbg.org)
2021-03-11 01:17:23 +03:30
* @brief bl command
* @details
* @version 0.1
* @date 2021-03-11
*
* @copyright This project is released under the GNU Public License v3.
*
*/
#include "pch.h"
2021-03-11 01:17:23 +03:30
//
// Global Variables
//
extern BOOLEAN g_IsSerialConnectedToRemoteDebuggee;
/**
* @brief help of the bl command
2021-03-11 01:17:23 +03:30
*
* @return VOID
*/
2021-03-22 18:19:39 +04:30
VOID
CommandBlHelp()
{
ShowMessages("bl : lists all the enabled and disabled breakpoints.\n\n");
2021-03-22 18:19:39 +04:30
ShowMessages("syntax : \tbl\n");
2021-03-11 01:17:23 +03:30
}
/**
* @brief handler of the bl command
2021-03-11 01:17:23 +03:30
*
2024-03-17 19:00:14 +09:00
* @param SplitCommand
2021-03-11 01:17:23 +03:30
* @param Command
* @return VOID
*/
2021-03-22 18:19:39 +04:30
VOID
2024-03-17 19:00:14 +09:00
CommandBl(vector<string> SplitCommand, string Command)
2021-03-22 18:19:39 +04:30
{
DEBUGGEE_BP_LIST_OR_MODIFY_PACKET Request = {0};
2021-03-11 01:17:23 +03:30
//
2021-03-22 18:19:39 +04:30
// Validate the commands
2021-03-11 01:17:23 +03:30
//
2024-03-17 19:00:14 +09:00
if (SplitCommand.size() != 1)
2021-03-22 18:19:39 +04:30
{
2023-07-13 16:05:42 +09:00
ShowMessages("incorrect use of the 'bl'\n\n");
2021-03-22 18:19:39 +04:30
CommandBlHelp();
return;
}
2021-03-11 01:17:23 +03:30
//
2021-03-22 18:19:39 +04:30
// Check if the remote serial debuggee is paused or not (connected or not)
2021-03-11 01:17:23 +03:30
//
2021-03-22 18:19:39 +04:30
if (g_IsSerialConnectedToRemoteDebuggee)
{
//
// Perform listing breakpoint
//
Request.Request = DEBUGGEE_BREAKPOINT_MODIFICATION_REQUEST_LIST_BREAKPOINTS;
2021-03-11 01:17:23 +03:30
2021-03-22 18:19:39 +04:30
//
// Send the request
//
KdSendListOrModifyPacketToDebuggee(&Request);
ShowMessages("\n");
}
else
{
ShowMessages("err, listing breakpoints is only valid if you connected to "
"a debuggee in debugger-mode\n");
}
2021-03-11 01:17:23 +03:30
}