mirror of
https://github.com/HyperDbg/HyperDbg.git
synced 2026-07-10 01:29:59 +00:00
make the cli interface ready
This commit is contained in:
parent
9108b23496
commit
044d02a372
6 changed files with 129 additions and 57 deletions
|
|
@ -15,6 +15,7 @@
|
|||
#include <iostream>
|
||||
#include "Definition.h"
|
||||
#include "Configuration.h"
|
||||
#include "details.h"
|
||||
|
||||
#pragma comment(lib, "HPRDBGCTRL.lib")
|
||||
|
||||
|
|
@ -30,30 +31,12 @@ extern "C"
|
|||
__declspec (dllimport) int __cdecl HyperdbgUnload();
|
||||
__declspec (dllimport) int __cdecl HyperdbgInstallDriver();
|
||||
__declspec (dllimport) int __cdecl HyperdbgUninstallDriver();
|
||||
__declspec (dllimport) int __cdecl HyperdbgInterpreter(std::string Command);
|
||||
__declspec (dllimport) int __cdecl HyperdbgInterpreter(const char* Command);
|
||||
__declspec (dllimport) void __stdcall HyperdbgSetTextMessageCallback(Callback handler);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Print HyperDbg Header
|
||||
*
|
||||
*/
|
||||
void PrintAppearance() {
|
||||
|
||||
printf("\n"
|
||||
|
||||
|
||||
" _ _ _ _____ ____ _ _ \n"
|
||||
" | | | |_ _ _ __ ___ _ ____ _(_)___ ___ _ __ | ___| __ ___ _ __ ___ / ___| ___ _ __ __ _| |_ ___| |__ \n"
|
||||
" | |_| | | | | '_ \\ / _ \\ '__\\ \\ / / / __|/ _ \\| '__| | |_ | '__/ _ \\| '_ ` _ \\ \\___ \\ / __| '__/ _` | __/ __| '_ \\ \n"
|
||||
" | _ | |_| | |_) | __/ | \\ V /| \\__ \\ (_) | | | _|| | | (_) | | | | | | ___) | (__| | | (_| | || (__| | | |\n"
|
||||
" |_| |_|\\__, | .__/ \\___|_| \\_/ |_|___/\\___/|_| |_| |_| \\___/|_| |_| |_| |____/ \\___|_| \\__,_|\\__\\___|_| |_|\n"
|
||||
" |___/|_| \n"
|
||||
"\n\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief CLI main function
|
||||
*
|
||||
|
|
@ -61,17 +44,36 @@ void PrintAppearance() {
|
|||
*/
|
||||
int main()
|
||||
{
|
||||
//
|
||||
// Print Hypervisor From Scratch Message
|
||||
//
|
||||
PrintAppearance();
|
||||
bool ExitFromDebugger = false;
|
||||
|
||||
printf("HyperDbg Debugger [core version: v%s]\n",Version);
|
||||
printf("Please visit https://docs.hyperdbg.com for more information...\n");
|
||||
printf("HyperDbg is released under the GNU Public License v3 (GPLv3).\n\n");
|
||||
|
||||
while (!ExitFromDebugger)
|
||||
{
|
||||
printf("0: HyperDbg >");
|
||||
|
||||
string command;
|
||||
getline(cin, command);
|
||||
int CommandExecutionResult = HyperdbgInterpreter(command.c_str());
|
||||
|
||||
//
|
||||
//if the debugger encounters an exit state then the return will be 1
|
||||
//
|
||||
if (CommandExecutionResult == 1)
|
||||
{
|
||||
//
|
||||
// Exit from the debugger
|
||||
//
|
||||
ExitFromDebugger = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//std::string command = "salam";
|
||||
//HyperdbgInterpreter(command);
|
||||
|
||||
//_getch();
|
||||
//return 0;
|
||||
return 0;
|
||||
|
||||
//
|
||||
// Installing Driver
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue