HyperDbg Debugger
Loading...
Searching...
No Matches
load.cpp File Reference

load command More...

#include "pch.h"

Functions

VOID CommandLoadHelp ()
 help of the load command
 
VOID CommandLoad (vector< string > SplitCommand, string Command)
 load command handler
 

Variables

HANDLE g_IsDriverLoadedSuccessfully
 Handle to show that if the debugger is loaded successfully.
 
HANDLE g_DeviceHandle
 Holds the global handle of device which is used to send the request to the kernel by IOCTL, this handle is not used for IRP Pending of message tracing this handle is used in KD VMM.
 
BOOLEAN g_IsConnectedToHyperDbgLocally
 Shows whether the user is allowed to use 'load' command to load modules locally in VMI (virtual machine introspection) mode.
 
BOOLEAN g_IsDebuggerModulesLoaded
 this variable is used to indicate that modules are loaded so we make sure to later use a trace of loading in 'unload' command (used in Debugger VMM)
 

Detailed Description

load command

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.1
Date
2020-05-27

Function Documentation

◆ CommandLoad()

VOID CommandLoad ( vector< string > SplitCommand,
string Command )

load command handler

Parameters
SplitCommand
Command
Returns
VOID
47{
48 if (SplitCommand.size() != 2)
49 {
50 ShowMessages("incorrect use of the 'load'\n\n");
52 return;
53 }
54
56 {
57 ShowMessages("you're not connected to any instance of HyperDbg, did you "
58 "use '.connect'? \n");
59 return;
60 }
61
62 //
63 // Check for the module
64 //
65 if (!SplitCommand.at(1).compare("vmm"))
66 {
67 //
68 // Check to make sure that the driver is not already loaded
69 //
71 {
72 ShowMessages("handle of the driver found, if you use 'load' before, please "
73 "first unload it then call 'unload'\n");
74 return;
75 }
76
77 //
78 // Load VMM Module
79 //
80 ShowMessages("loading the vmm driver\n");
81
83 {
84 ShowMessages("failed to install or load the driver\n");
85 return;
86 }
87
88 //
89 // If in vmi-mode then initialize and load symbols (pdb)
90 // for previously downloaded symbols
91 // When the VMM module is loaded, we use the current
92 // process (HyperDbg's process) as the base for user-mode
93 // symbols
94 //
95 SymbolLocalReload(GetCurrentProcessId());
96 }
97 else
98 {
99 //
100 // Module not found
101 //
102 ShowMessages("err, module not found\n");
103 }
104}
INT HyperDbgInstallVmmDriver()
Install VMM driver.
Definition libhyperdbg.cpp:502
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
INT HyperDbgLoadVmmModule()
load vmm module
Definition libhyperdbg.cpp:798
HANDLE g_DeviceHandle
Holds the global handle of device which is used to send the request to the kernel by IOCTL,...
Definition globals.h:471
BOOLEAN g_IsConnectedToHyperDbgLocally
Shows whether the user is allowed to use 'load' command to load modules locally in VMI (virtual machi...
Definition globals.h:67
VOID CommandLoadHelp()
help of the load command
Definition load.cpp:28
BOOLEAN SymbolLocalReload(UINT32 UserProcessId)
Locally reload the symbol table.
Definition symbol.cpp:50

◆ CommandLoadHelp()

VOID CommandLoadHelp ( )

help of the load command

Returns
VOID
29{
30 ShowMessages("load : installs the drivers and load the modules.\n\n");
31
32 ShowMessages("syntax : \tload [ModuleName (string)]\n");
33
34 ShowMessages("\n");
35 ShowMessages("\t\te.g : load vmm\n");
36}

Variable Documentation

◆ g_DeviceHandle

HANDLE g_DeviceHandle
extern

Holds the global handle of device which is used to send the request to the kernel by IOCTL, this handle is not used for IRP Pending of message tracing this handle is used in KD VMM.

◆ g_IsConnectedToHyperDbgLocally

BOOLEAN g_IsConnectedToHyperDbgLocally
extern

Shows whether the user is allowed to use 'load' command to load modules locally in VMI (virtual machine introspection) mode.

◆ g_IsDebuggerModulesLoaded

BOOLEAN g_IsDebuggerModulesLoaded
extern

this variable is used to indicate that modules are loaded so we make sure to later use a trace of loading in 'unload' command (used in Debugger VMM)

◆ g_IsDriverLoadedSuccessfully

HANDLE g_IsDriverLoadedSuccessfully
extern

Handle to show that if the debugger is loaded successfully.