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.
|
|
|
|
|
*
|
|
|
|
|
*/
|
2022-05-04 16:38:21 -07:00
|
|
|
#include "pch.h"
|
2021-03-11 01:17:23 +03:30
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Global Variables
|
|
|
|
|
//
|
|
|
|
|
extern BOOLEAN g_IsSerialConnectedToRemoteDebuggee;
|
|
|
|
|
|
|
|
|
|
/**
|
2022-02-08 16:06:26 +03:30
|
|
|
* @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");
|
2022-04-17 23:05:24 +04:30
|
|
|
|
2021-03-22 18:19:39 +04:30
|
|
|
ShowMessages("syntax : \tbl\n");
|
2021-03-11 01:17:23 +03:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2022-02-08 16:06:26 +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
|
2024-07-31 14:08:14 +09:00
|
|
|
* @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
|
2024-07-31 14:08:14 +09:00
|
|
|
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
|
|
|
{
|
2024-07-31 18:21:23 +09:00
|
|
|
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
|
|
|
}
|