HyperDbg Debugger
Loading...
Searching...
No Matches
globals.h
Go to the documentation of this file.
1
12#pragma once
13
15// Feature Indicators //
17
23
29
31// Interpreter Variables //
33
38
43
48
50// Remote and Local Connection //
52
61
68
75
82
90
97SOCKET g_SeverSocket = {0};
98
104
110string g_ServerPort = "";
111
117string g_ServerIp = "";
118
125
131
138
145
152
159
161// User Debugging Variables //
163
168
177
179// Serial Debugging Variables //
181
190
199
205
211
218
225
232
239
245
251
258
264
271
278
284
291
300
302
308
310// Global Variables //
312
319
325
331
337
343
349
357
363
369
376
383
391
400LIST_ENTRY g_EventTrace = {0};
401
409
417LIST_ENTRY g_OutputSources = {0};
418
423TCHAR g_DriverLocation[MAX_PATH] = {0};
424
429TCHAR g_DriverName[MAX_PATH] = {0};
430
436
441TCHAR g_TestLocation[MAX_PATH] = {0};
442
451
457
463
472
479
485
493
500
507
512std::map<UINT64, LOCAL_FUNCTION_DESCRIPTION> g_DisassemblerSymbolMap;
513
521
527
533
539
545
551
557
562
567
569// Settings //
571
578
585
592
599
601// Symbol Table //
603
610
617
624
631
638
640// User mode Debugging //
642
647std::wstring g_StartCommandPath = L"";
648
654
656// Script engine tests //
658
665
672
674// hwdbg //
676
682
688
693std::vector<UINT32> g_HwdbgPortConfiguration;
UCHAR BOOLEAN
Definition BasicTypes.h:39
unsigned char BYTE
Definition BasicTypes.h:24
#define TRUE
Definition BasicTypes.h:55
#define FALSE
Definition BasicTypes.h:54
unsigned __int64 UINT64
Definition BasicTypes.h:21
unsigned int UINT32
Definition BasicTypes.h:48
unsigned long ULONG
Definition BasicTypes.h:37
#define TCP_END_OF_BUFFER_CHARS_COUNT
count of characters for tcp end of buffer
Definition Constants.h:440
#define SERIAL_END_OF_BUFFER_CHAR_4
Definition Constants.h:435
#define DebuggerOutputSourceTagStartSeed
The seeds that user-mode codes use as the starter of their output source tag.
Definition Constants.h:236
#define SERIAL_END_OF_BUFFER_CHAR_2
Definition Constants.h:433
#define SERIAL_END_OF_BUFFER_CHAR_1
characters of the buffer that we set at the end of buffers for serial
Definition Constants.h:432
#define DEBUGGER_DEBUGGEE_IS_RUNNING_NO_CORE
Apply the event to all the cores.
Definition Constants.h:605
#define SERIAL_END_OF_BUFFER_CHARS_COUNT
count of characters for serial end of buffer
Definition Constants.h:426
#define TCP_END_OF_BUFFER_CHAR_2
Definition Constants.h:447
#define SERIAL_END_OF_BUFFER_CHAR_3
Definition Constants.h:434
#define TCP_END_OF_BUFFER_CHAR_1
characters of the buffer that we set at the end of buffers for tcp
Definition Constants.h:446
#define MAXIMUM_INSTR_SIZE
maximum instruction size in Intel
Definition Constants.h:468
#define TCP_END_OF_BUFFER_CHAR_4
Definition Constants.h:449
#define TCP_END_OF_BUFFER_CHAR_3
Definition Constants.h:448
#define DebuggerEventTagStartSeed
The seeds that user-mode codes use as the starter of their events' tag.
Definition Constants.h:222
std::map< std::string, COMMAND_DETAIL > CommandType
Type saving commands and mapping to command string.
Definition commands.h:183
#define DEBUGGER_MAXIMUM_SYNCRONIZATION_KERNEL_DEBUGGER_OBJECTS
maximum number of event handles in kernel-debugger
Definition debugger.h:21
#define DEBUGGER_MAXIMUM_SYNCRONIZATION_USER_DEBUGGER_OBJECTS
Maximum number of event handles in user-debugger.
Definition debugger.h:88
UINT32 g_SymbolTableCurrentIndex
The index to hold the track of added symbols.
Definition globals.h:623
BOOLEAN g_IsEndOfMessageReceived
variable to keep track if the end of the message received (for showing signature)
Definition globals.h:144
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
ULONG g_CurrentRemoteCore
Current core that the debuggee is debugging.
Definition globals.h:263
BOOLEAN g_IsSerialConnectedToRemoteDebugger
Shows if the debugger was connected to remote debugger (A remote host)
Definition globals.h:238
BOOLEAN g_IsConnectedToRemoteDebuggee
Shows whether the current debugger is the host and connected to a remote debuggee (guest)
Definition globals.h:74
UINT32 g_InterpreterCountOfOpenCurlyBrackets
Keeps the trace of curly brackets in the interpreter.
Definition globals.h:47
HANDLE g_DebuggeeStopCommandEventHandle
An event to make sure that the user won't give any command in debuggee and all the commands are comin...
Definition globals.h:277
string g_ServerPort
In debugger (not debuggee), we save the port of server debuggee in this variable to use it later e....
Definition globals.h:110
BYTE g_EndOfBufferCheckTcp[TCP_END_OF_BUFFER_CHARS_COUNT]
the buffer that we set at the end of buffers for tcp connection
Definition globals.h:56
SOCKET g_ServerListenSocket
Server in debuggee needs an extra socket.
Definition globals.h:103
TCHAR g_TestLocation[MAX_PATH]
Holds the location test-hyperdbg.exe.
Definition globals.h:441
DEBUGGER_EVENT_AND_ACTION_RESULT g_DebuggeeResultOfRegisteringEvent
Holds the result of registering events from the remote debuggee.
Definition globals.h:283
OVERLAPPED g_OverlappedIoStructureForReadDebuggee
Definition globals.h:301
BOOLEAN g_IsVmxOffProcessStart
Shows whether the vmxoff process start or not.
Definition globals.h:462
DEBUGGER_SYNCRONIZATION_EVENTS_STATE g_UserSyncronizationObjectsHandleTable[DEBUGGER_MAXIMUM_SYNCRONIZATION_USER_DEBUGGER_OBJECTS]
In debugger (not debuggee), we save the handle of the user-mode listening thread for pauses here for ...
Definition globals.h:176
std::wstring g_StartCommandPathAndArguments
the start arguments used in .start command
Definition globals.h:653
UINT64 g_EventTag
This variable holds the trace and generate numbers for new tags of events.
Definition globals.h:375
BOOLEAN g_LogOpened
Shows whether the '.logopen' command is executed and the log file is open or not.
Definition globals.h:478
HANDLE g_IsDriverLoadedSuccessfully
Handle to show that if the debugger is loaded successfully.
Definition globals.h:130
BOOLEAN g_ShouldPreviousCommandBeContinued
Shows whether the previous command should be continued or not.
Definition globals.h:318
BYTE g_EndOfBufferCheckSerial[SERIAL_END_OF_BUFFER_CHARS_COUNT]
the buffer that we set at the end of buffers for serial
Definition globals.h:185
HANDLE g_RemoteDebuggeeListeningThread
In debugger (not debuggee), we save the ip of server debuggee in this variable to use it later e....
Definition globals.h:124
BOOLEAN g_OutputSourcesInitialized
it shows whether the debugger started using output sources or not or in other words,...
Definition globals.h:408
TCHAR g_DriverLocation[MAX_PATH]
Holds the location driver to install it.
Definition globals.h:423
BOOLEAN g_SerialConnectionAlreadyClosed
In both debuggee and debugger we save the state of the closed connection to avoid double close.
Definition globals.h:151
LIST_ENTRY g_EventTrace
Holds a list of events in kernel and the state of events and the commands to show the state of each c...
Definition globals.h:400
UINT64 g_OutputSourceTag
This variable holds the trace and generate numbers for unique tag of the output resources.
Definition globals.h:382
BOOLEAN g_IsUserDebuggerInitialized
Whether the user debugger is initialized or not.
Definition globals.h:167
BOOLEAN g_EventTraceInitialized
it shows whether the debugger started using events or not or in other words, is g_EventTrace initiali...
Definition globals.h:390
BOOLEAN g_IsCommandListInitialized
Is list of command initialized.
Definition globals.h:348
SOCKET g_SeverSocket
The socket object of guest debuggee (not debugger) it is because in HyperDbg, debugger is client and ...
Definition globals.h:97
BOOLEAN g_CurrentExprEvalResultHasError
global variable to detect if there was an error in the result of script-engine statement tests
Definition globals.h:671
BOOLEAN g_IsDebuggeeRunning
Shows if the debuggee is running or not.
Definition globals.h:250
UINT64 * g_ScriptGlobalVariables
Holder of global variables for script engine.
Definition globals.h:330
UINT64 g_CpuidStandardDeviation
The standard deviation calculated from the measurements of cpuid '!measure' command.
Definition globals.h:532
HANDLE g_SerialRemoteComPortHandle
In debugger (not debuggee), we save the handle of the user-mode listening thread for remote system he...
Definition globals.h:224
UINT32 g_ProcessIdOfLatestStartingProcess
The process id of the latest starting process.
Definition globals.h:368
PVOID g_MessageHandlerSharedBuffer
The shared buffer for the handler of ShowMessages function.
Definition globals.h:456
UINT64 g_ResultOfEvaluatedExpression
Result of the expression that is evaluated in the debuggee.
Definition globals.h:630
ofstream g_LogOpenFile
The object of log file ('.logopen' command)
Definition globals.h:484
std::vector< UINT32 > g_HwdbgPortConfiguration
Ports configuration of hwdbg.
Definition globals.h:693
HWDBG_INSTANCE_INFORMATION g_HwdbgInstanceInfo
Instance information of the current hwdbg debuggee.
Definition globals.h:681
BOOLEAN g_AutoFlush
Whether auto-flush mode is enabled or not enabled.
Definition globals.h:591
DEBUGGER_SYNCRONIZATION_EVENTS_STATE g_KernelSyncronizationObjectsHandleTable[DEBUGGER_MAXIMUM_SYNCRONIZATION_KERNEL_DEBUGGER_OBJECTS]
In debugger (not debuggee), we save the handle of the user-mode listening thread for pauses here for ...
Definition globals.h:198
BOOLEAN g_IsRunningInstruction32Bit
whether the Current executing instructions is 32-bit or 64 bit
Definition globals.h:210
UINT64 g_RdtscAverage
The average calculated from the measurements of rdtsc/p '!measure' command.
Definition globals.h:544
HANDLE g_EndOfMessageReceivedEvent
Handle to if the end of the message received (for showing signature)
Definition globals.h:137
BOOLEAN g_IgnoreNewLoggingMessages
Shows if the debugger should show debuggee's messages or not.
Definition globals.h:257
DEBUGGER_EVENT_AND_ACTION_RESULT g_DebuggeeResultOfAddingActionsToEvent
Holds the result of adding action to events from the remote debuggee.
Definition globals.h:289
UINT64 g_KernelBaseAddress
Shows the kernel base address.
Definition globals.h:566
std::map< UINT64, LOCAL_FUNCTION_DESCRIPTION > g_DisassemblerSymbolMap
Symbol table for disassembler.
Definition globals.h:512
BOOLEAN g_AddressConversion
Whether converting addresses to object names or not.
Definition globals.h:584
BOOLEAN g_IsInterpreterPreviousCharacterABackSlash
Is interpreter encountered a back slash at previous run.
Definition globals.h:42
HANDLE g_SerialListeningThreadHandle
In debuggee and debugger, we save the handle of the user-mode listening thread for pauses here.
Definition globals.h:217
BOOLEAN g_IsConnectedToRemoteDebugger
Shows whether the current system is a guest (debuggee) and a remote debugger is connected to this sys...
Definition globals.h:81
PVOID g_MessageHandler
The handler for ShowMessages function this is because the user might choose not to use printf and ins...
Definition globals.h:450
TCHAR g_DriverName[MAX_PATH]
Holds the name of the driver to install it.
Definition globals.h:429
PMODULE_SYMBOL_DETAIL g_SymbolTable
The buffer that stores the details of symbol table.
Definition globals.h:609
BOOLEAN g_HwdbgInstanceInfoIsValid
Shows whether the instance info is valid (received) or not.
Definition globals.h:687
BOOLEAN g_IsInstrumentingInstructions
Shows whether the user is running 't', 'p', or 'i' command.
Definition globals.h:561
BOOLEAN g_UseCustomDriverLocation
Whether the user wants to use a custom driver location or not.
Definition globals.h:435
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest)
Definition globals.h:231
UINT32 g_VirtualAddressWidth
Virtual address width for x86 processors.
Definition globals.h:28
BOOLEAN g_IsInterpreterOnString
shows whether the interpreter is currently on a string or not
Definition globals.h:37
BOOLEAN g_BreakPrintingOutput
Shows whether the pause command or CTRL+C or CTRL+Break is executed or not.
Definition globals.h:499
UINT32 g_ErrorStateOfResultOfEvaluatedExpression
Shows the state of the evaluation of expression which whether contains error or not.
Definition globals.h:637
BOOLEAN g_IsExecutingSymbolLoadingRoutines
Executing symbol reloading or downloading routines.
Definition globals.h:506
ACTIVE_DEBUGGING_PROCESS g_ActiveProcessDebuggingState
State of active debugging thread.
Definition globals.h:362
UINT64 g_RdtscMedian
The median calculated from the measurements of rdtsc/p '!measure' command.
Definition globals.h:556
BOOLEAN g_TransparentResultsMeasured
Shows whether the user executed and mesaured '!measure' command or not, it is because we want to use ...
Definition globals.h:520
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
LIST_ENTRY g_OutputSources
Holds a list of output sources created by output command.
Definition globals.h:417
BOOLEAN g_AutoUnpause
Whether auto-unpause mode is enabled or not enabled.
Definition globals.h:577
OVERLAPPED g_OverlappedIoStructureForWriteDebugger
Definition globals.h:299
BOOLEAN g_IsDebuggerModulesLoaded
this variable is used to indicate that modules are loaded so we make sure to later use a trace of loa...
Definition globals.h:356
UINT64 g_CpuidMedian
The median calculated from the measurements of cpuid '!measure' command.
Definition globals.h:538
UINT64 * g_ScriptLocalVariables
Holder of local variables for script engine.
Definition globals.h:336
UINT64 g_CurrentExprEvalResult
global variable to save the result of script-engine statement tests
Definition globals.h:664
SOCKET g_ClientConnectSocket
The socket object of host debugger (not debuggee) it is because in HyperDbg, debuggee is server and d...
Definition globals.h:89
BOOLEAN g_IsDebuggeeInHandshakingPhase
Shows if the debuggee is in the handshake phase or not.
Definition globals.h:244
OVERLAPPED g_OverlappedIoStructureForReadDebugger
This is an OVERLAPPED structure for managing simultaneous read and writes for debugger (in current de...
Definition globals.h:298
UINT64 g_RdtscStandardDeviation
The standard deviation calculated from the measurements of rdtsc/p '!measure' command.
Definition globals.h:550
UINT32 g_SymbolTableSize
The buffer that stores size of the details of symbol table.
Definition globals.h:616
BOOLEAN g_IgnorePauseRequests
Show whether the pause request (CTRL+C or CTRL+BREAK) should be ignored or not.
Definition globals.h:158
UINT64 * g_ScriptTempVariables
Holder of temp variables for script engine.
Definition globals.h:342
BOOLEAN g_ExecutingScript
Shows whether the target is executing a script form '.script' command or executing script by an argum...
Definition globals.h:492
BYTE g_CurrentRunningInstruction[MAXIMUM_INSTR_SIZE]
Current executing instructions.
Definition globals.h:204
std::wstring g_StartCommandPath
the start path used in .start command
Definition globals.h:647
CommandType g_CommandsList
List of command and attributes.
Definition globals.h:324
string g_ServerIp
In debugger (not debuggee), we save the port of server debuggee in this variable to use it later e....
Definition globals.h:117
BOOLEAN g_SharedEventStatus
Shows whether the queried event is enabled or disabled.
Definition globals.h:307
BOOLEAN g_IsDebuggerConntectedToNamedPipe
Shows if the debugger is connected to the guest using named pipe.
Definition globals.h:270
UINT64 g_CpuidAverage
The average calculated from the measurements of cpuid '!measure' command.
Definition globals.h:526
BOOLEAN g_RtmSupport
check for RTM support
Definition globals.h:22
UINT32 g_DisassemblerSyntax
Shows the syntax used in !u !u2 u u2 commands.
Definition globals.h:598
structures related to current thread debugging state
Definition ud.h:48
Status of register buffers.
Definition Events.h:423
In debugger holds the state of events.
Definition debugger.h:110
The structure of script capabilities information in hwdbg.
Definition HardwareDebugger.h:91
structures for sending and saving details about each module and symbols details
Definition Symbols.h:24