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

flush command More...

#include "pch.h"

Functions

VOID CommandFlushHelp ()
 help of the flush command
 
VOID CommandFlushRequestFlush ()
 flush command handler
 
VOID CommandFlush (vector< string > SplitCommand, string Command)
 flush command handler
 

Variables

BOOLEAN g_IsSerialConnectedToRemoteDebuggee
 Shows if the debugger was connected to remote debuggee over (A remote guest)
 

Detailed Description

flush command

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

Function Documentation

◆ CommandFlush()

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

flush command handler

Parameters
SplitCommand
Command
Returns
VOID
110{
111 if (SplitCommand.size() != 1)
112 {
113 ShowMessages("incorrect use of the 'flush'\n\n");
115 return;
116 }
117
118 //
119 // Flush the buffer
120 //
122}
VOID CommandFlushHelp()
help of the flush command
Definition flush.cpp:25
VOID CommandFlushRequestFlush()
flush command handler
Definition flush.cpp:39
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96

◆ CommandFlushHelp()

VOID CommandFlushHelp ( )

help of the flush command

Returns
VOID
26{
27 ShowMessages("flush : removes all the buffer and messages from kernel-mode "
28 "buffers.\n\n");
29
30 ShowMessages("syntax : \tflush \n");
31}

◆ CommandFlushRequestFlush()

VOID CommandFlushRequestFlush ( )

flush command handler

Returns
VOID
40{
41 BOOL Status;
42 ULONG ReturnedLength;
43 DEBUGGER_FLUSH_LOGGING_BUFFERS FlushRequest = {0};
44
46 {
47 //
48 // It's a debug-mode
49 //
51 }
52 else
53 {
54 //
55 // It's a vmi-mode
56 //
58
59 //
60 // By the way, we don't need to send an input buffer
61 // to the kernel, but let's keep it like this, if we
62 // want to pass some other arguments to the kernel in
63 // the future
64 //
65 Status = DeviceIoControl(
66 g_DeviceHandle, // Handle to device
67 IOCTL_DEBUGGER_FLUSH_LOGGING_BUFFERS, // IO Control Code (IOCTL)
68 &FlushRequest, // Input Buffer to driver.
69 SIZEOF_DEBUGGER_FLUSH_LOGGING_BUFFERS, // Input buffer length
70 &FlushRequest, // Output Buffer from driver.
71 SIZEOF_DEBUGGER_FLUSH_LOGGING_BUFFERS, // Length of output buffer in
72 // bytes.
73 &ReturnedLength, // Bytes placed in buffer.
74 NULL // synchronous call
75 );
76
77 if (!Status)
78 {
79 ShowMessages("ioctl failed with code 0x%x\n", GetLastError());
80 return;
81 }
82
84 {
85 //
86 // The amount of message that are deleted are the amount of
87 // vmx-root messages and vmx non-root messages
88 //
90 "flushing buffers was successful, total %d messages were cleared.\n",
93 }
94 else
95 {
96 ShowMessages("flushing buffers was not successful :(\n");
97 }
98 }
99}
int BOOL
Definition BasicTypes.h:23
unsigned long ULONG
Definition BasicTypes.h:37
#define DEBUGGER_OPERATION_WAS_SUCCESSFUL
General value to indicate that the operation or request was successful.
Definition ErrorCodes.h:23
#define IOCTL_DEBUGGER_FLUSH_LOGGING_BUFFERS
ioctl, flush the kernel buffers
Definition Ioctls.h:155
#define SIZEOF_DEBUGGER_FLUSH_LOGGING_BUFFERS
Definition RequestStructures.h:286
BOOLEAN g_IsSerialConnectedToRemoteDebuggee
Shows if the debugger was connected to remote debuggee over (A remote guest)
Definition globals.h:231
BOOLEAN KdSendFlushPacketToDebuggee()
Send a flush request to the debuggee.
Definition kd.cpp:314
#define AssertShowMessageReturnStmt(expr, message, rc)
Definition common.h:51
#define AssertReturn
Definition common.h:19
#define ASSERT_MESSAGE_DRIVER_NOT_LOADED
Definition common.h:25
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
request for flushing buffers
Definition RequestStructures.h:294
UINT32 CountOfMessagesThatSetAsReadFromVmxRoot
Definition RequestStructures.h:296
UINT32 CountOfMessagesThatSetAsReadFromVmxNonRoot
Definition RequestStructures.h:297
UINT32 KernelStatus
Definition RequestStructures.h:295

Variable Documentation

◆ g_IsSerialConnectedToRemoteDebuggee

BOOLEAN g_IsSerialConnectedToRemoteDebuggee
extern

Shows if the debugger was connected to remote debuggee over (A remote guest)