mirror of
https://github.com/HyperDbg/HyperDbg.git
synced 2026-07-10 01:29:59 +00:00
clang-format codes.
This commit is contained in:
parent
b30f242d0b
commit
343127b899
150 changed files with 25384 additions and 23097 deletions
|
|
@ -12,7 +12,7 @@
|
|||
#include <Windows.h>
|
||||
#include <string>
|
||||
#include <conio.h>
|
||||
#include <iostream>
|
||||
#include <iostream>
|
||||
#include "Definition.h"
|
||||
#include "Configuration.h"
|
||||
#include "details.h"
|
||||
|
|
@ -25,16 +25,14 @@ using namespace std;
|
|||
// Header file of HPRDBGCTRL
|
||||
// Imports
|
||||
//
|
||||
extern "C"
|
||||
{
|
||||
__declspec (dllimport) int HyperdbgLoadVmm();
|
||||
__declspec (dllimport) int HyperdbgUnload();
|
||||
__declspec (dllimport) int HyperdbgInstallVmmDriver();
|
||||
__declspec (dllimport) int HyperdbgUninstallDriver();
|
||||
__declspec (dllimport) int HyperdbgInterpreter(const char* Command);
|
||||
__declspec(dllexport) void HyperdbgShowSignature();
|
||||
__declspec (dllimport) void HyperdbgSetTextMessageCallback(Callback handler);
|
||||
|
||||
extern "C" {
|
||||
__declspec(dllimport) int HyperdbgLoadVmm();
|
||||
__declspec(dllimport) int HyperdbgUnload();
|
||||
__declspec(dllimport) int HyperdbgInstallVmmDriver();
|
||||
__declspec(dllimport) int HyperdbgUninstallDriver();
|
||||
__declspec(dllimport) int HyperdbgInterpreter(const char * Command);
|
||||
__declspec(dllexport) void HyperdbgShowSignature();
|
||||
__declspec(dllimport) void HyperdbgSetTextMessageCallback(Callback handler);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -44,37 +42,38 @@ extern "C"
|
|||
* @param argv
|
||||
* @return int
|
||||
*/
|
||||
int main(int argc, char* argv[]) {
|
||||
int
|
||||
main(int argc, char * argv[])
|
||||
{
|
||||
bool ExitFromDebugger = false;
|
||||
|
||||
bool ExitFromDebugger = false;
|
||||
if (argc != 1)
|
||||
{
|
||||
//
|
||||
// User-passed arguments to the debugger
|
||||
//
|
||||
if (!strcmp(argv[1], "--script"))
|
||||
{
|
||||
char ScriptBuffer[MAX_PATH + 10] = {0};
|
||||
|
||||
if (argc != 1) {
|
||||
//
|
||||
// Executing the script
|
||||
//
|
||||
sprintf_s(ScriptBuffer, sizeof(ScriptBuffer), ".script %s", argv[2]);
|
||||
HyperdbgInterpreter(ScriptBuffer);
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("invalid command line options passed to HyperDbg !\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// User-passed arguments to the debugger
|
||||
//
|
||||
if (!strcmp(argv[1], "--script")) {
|
||||
|
||||
char ScriptBuffer[MAX_PATH + 10] = { 0 };
|
||||
|
||||
//
|
||||
// Executing the script
|
||||
//
|
||||
sprintf_s(ScriptBuffer, sizeof(ScriptBuffer), ".script %s", argv[2]);
|
||||
HyperdbgInterpreter(ScriptBuffer);
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("invalid command line options passed to HyperDbg !\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Put to ease the test, it will be removed
|
||||
//
|
||||
/*
|
||||
//
|
||||
// Put to ease the test, it will be removed
|
||||
//
|
||||
/*
|
||||
if (HyperdbgInstallVmmDriver()) {
|
||||
return 1;
|
||||
}
|
||||
|
|
@ -87,43 +86,43 @@ int main(int argc, char* argv[]) {
|
|||
return 0;
|
||||
*/
|
||||
|
||||
//
|
||||
// ---------------------------------------------------------
|
||||
//
|
||||
//
|
||||
// ---------------------------------------------------------
|
||||
//
|
||||
|
||||
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");
|
||||
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)
|
||||
{
|
||||
HyperdbgShowSignature();
|
||||
while (!ExitFromDebugger)
|
||||
{
|
||||
HyperdbgShowSignature();
|
||||
|
||||
string command;
|
||||
getline(cin, command);
|
||||
string command;
|
||||
getline(cin, command);
|
||||
|
||||
if (cin.fail() || cin.eof()) {
|
||||
cin.clear(); // reset cin state
|
||||
}
|
||||
if (cin.fail() || cin.eof())
|
||||
{
|
||||
cin.clear(); // reset cin state
|
||||
}
|
||||
|
||||
int CommandExecutionResult = HyperdbgInterpreter(command.c_str());
|
||||
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;
|
||||
}
|
||||
if (CommandExecutionResult != 2)
|
||||
{
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
//
|
||||
// if the debugger encounters an exit state then the return will be 1
|
||||
//
|
||||
if (CommandExecutionResult == 1)
|
||||
{
|
||||
//
|
||||
// Exit from the debugger
|
||||
//
|
||||
ExitFromDebugger = true;
|
||||
}
|
||||
if (CommandExecutionResult != 2)
|
||||
{
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue