mirror of
https://github.com/HyperDbg/HyperDbg.git
synced 2026-07-10 01:29:59 +00:00
add mechanism to repeat by pressing enter key
This commit is contained in:
parent
1d8c4d224c
commit
3bb2cd7652
7 changed files with 110 additions and 25 deletions
|
|
@ -32,7 +32,8 @@ __declspec(dllimport) int HyperdbgInstallVmmDriver();
|
|||
__declspec(dllimport) int HyperdbgUninstallDriver();
|
||||
__declspec(dllimport) int HyperdbgStopDriver();
|
||||
__declspec(dllimport) int HyperdbgInterpreter(const char * Command);
|
||||
__declspec(dllexport) void HyperdbgShowSignature();
|
||||
__declspec(dllimport) void HyperdbgShowSignature();
|
||||
__declspec(dllimport) bool HyperdbgContinuePreviousCommand();
|
||||
__declspec(dllimport) void HyperdbgSetTextMessageCallback(Callback handler);
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +47,8 @@ __declspec(dllimport) void HyperdbgSetTextMessageCallback(Callback handler);
|
|||
int
|
||||
main(int argc, char * argv[])
|
||||
{
|
||||
bool ExitFromDebugger = false;
|
||||
bool ExitFromDebugger = false;
|
||||
string PreviousCommand;
|
||||
|
||||
printf("HyperDbg Debugger [core version: v%s]\n", Version);
|
||||
printf("Please visit https://docs.hyperdbg.com for more information...\n");
|
||||
|
|
@ -79,15 +81,32 @@ main(int argc, char * argv[])
|
|||
{
|
||||
HyperdbgShowSignature();
|
||||
|
||||
string command;
|
||||
getline(cin, command);
|
||||
string CurrentCommand;
|
||||
|
||||
getline(cin, CurrentCommand);
|
||||
|
||||
if (cin.fail() || cin.eof())
|
||||
{
|
||||
cin.clear(); // reset cin state
|
||||
}
|
||||
|
||||
int CommandExecutionResult = HyperdbgInterpreter(command.c_str());
|
||||
if (!CurrentCommand.compare("") &&
|
||||
HyperdbgContinuePreviousCommand())
|
||||
{
|
||||
//
|
||||
// Retry the previous command
|
||||
//
|
||||
CurrentCommand = PreviousCommand;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Save previous command
|
||||
//
|
||||
PreviousCommand = CurrentCommand;
|
||||
}
|
||||
|
||||
int CommandExecutionResult = HyperdbgInterpreter(CurrentCommand.c_str());
|
||||
|
||||
//
|
||||
// if the debugger encounters an exit state then the return will be 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue