2020-07-25 03:32:04 -07:00
|
|
|
/**
|
|
|
|
|
* @file sleep.cpp
|
2022-01-18 22:38:56 +03:30
|
|
|
* @author Sina Karvandi (sina@hyperdbg.org)
|
2020-07-25 03:32:04 -07:00
|
|
|
* @brief sleep command
|
|
|
|
|
* @details
|
|
|
|
|
* @version 0.1
|
|
|
|
|
* @date 2020-07-25
|
|
|
|
|
*
|
|
|
|
|
* @copyright This project is released under the GNU Public License v3.
|
|
|
|
|
*
|
|
|
|
|
*/
|
2022-05-04 16:38:21 -07:00
|
|
|
#include "pch.h"
|
2020-07-25 03:32:04 -07:00
|
|
|
|
2020-08-28 04:03:12 -07:00
|
|
|
/**
|
2023-07-13 16:05:42 +09:00
|
|
|
* @brief help of the sleep command
|
2021-02-10 15:19:01 -08:00
|
|
|
*
|
|
|
|
|
* @return VOID
|
2020-08-28 04:03:12 -07:00
|
|
|
*/
|
2021-03-22 18:19:39 +04:30
|
|
|
VOID
|
|
|
|
|
CommandSleepHelp()
|
|
|
|
|
{
|
2022-04-10 22:24:56 +04:30
|
|
|
ShowMessages("sleep : sleeps the debugger; this command is used in scripts, it doesn't breaks "
|
2021-03-22 18:19:39 +04:30
|
|
|
"the debugger but the debugger still shows the buffers received "
|
|
|
|
|
"from kernel.\n\n");
|
2022-04-17 23:05:24 +04:30
|
|
|
|
2022-02-08 16:06:26 +03:30
|
|
|
ShowMessages("syntax : \tsleep [MillisecondsTime (hex)]\n");
|
2020-07-25 03:32:04 -07:00
|
|
|
}
|
|
|
|
|
|
2020-08-28 04:03:12 -07:00
|
|
|
/**
|
|
|
|
|
* @brief sleep command help
|
2021-02-10 15:19:01 -08:00
|
|
|
*
|
2024-07-30 14:17:06 +09:00
|
|
|
* @param CommandTokens
|
2024-07-31 14:08:14 +09:00
|
|
|
* @param Command
|
2024-07-30 14:17:06 +09:00
|
|
|
*
|
2021-02-10 15:19:01 -08:00
|
|
|
* @return VOID
|
2020-08-28 04:03:12 -07:00
|
|
|
*/
|
2021-03-22 18:19:39 +04:30
|
|
|
VOID
|
2024-07-31 14:08:14 +09:00
|
|
|
CommandSleep(vector<CommandToken> CommandTokens, string Command)
|
2021-03-22 18:19:39 +04:30
|
|
|
{
|
|
|
|
|
UINT32 MillisecondsTime = 0;
|
2020-07-25 03:32:04 -07:00
|
|
|
|
2024-07-30 14:17:06 +09:00
|
|
|
if (CommandTokens.size() != 2)
|
2021-03-22 18:19:39 +04:30
|
|
|
{
|
2024-07-30 14:17:06 +09:00
|
|
|
ShowMessages("incorrect use of the '%s'\n\n",
|
|
|
|
|
GetCaseSensitiveStringFromCommandToken(CommandTokens.at(0)).c_str());
|
2021-03-22 18:19:39 +04:30
|
|
|
CommandSleepHelp();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2020-07-25 03:32:04 -07:00
|
|
|
|
2024-07-30 14:17:06 +09:00
|
|
|
if (!ConvertTokenToUInt32(CommandTokens.at(1), &MillisecondsTime))
|
2021-03-22 18:19:39 +04:30
|
|
|
{
|
|
|
|
|
ShowMessages(
|
|
|
|
|
"please specify a correct hex value for time (milliseconds)\n\n");
|
|
|
|
|
CommandSleepHelp();
|
|
|
|
|
return;
|
|
|
|
|
}
|
2026-07-17 17:54:05 +02:00
|
|
|
PlatformSleep(MillisecondsTime);
|
2020-07-25 03:32:04 -07:00
|
|
|
}
|