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

78 lines
1.6 KiB
C++
Raw Permalink 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-07-29 18:46:12 +09:00
* @param CommandTokens
* @param Command
2024-07-29 18:46:12 +09:00
*
2021-03-11 01:17:23 +03:30
* @return VOID
*/
2021-03-22 18:19:39 +04:30
VOID
CommandBl(vector<CommandToken> CommandTokens, 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-07-29 18:46:12 +09:00
if (CommandTokens.size() != 1)
2021-03-22 18:19:39 +04:30
{
ShowMessages("incorrect use of the '%s'\n\n",
GetCaseSensitiveStringFromCommandToken(CommandTokens.at(0)).c_str());
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
}