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

!unhide command More...

#include "pch.h"

Functions

VOID CommandUnhideHelp ()
 help of the !unhide command
BOOLEAN HyperDbgDisableTransparentMode ()
 Disable transparent mode.
VOID CommandUnhide (vector< CommandToken > CommandTokens, string Command)
 !unhide command handler

Variables

BOOLEAN g_IsVmmModuleLoaded
 shows whether the VMM module is loaded or not

Detailed Description

!unhide command

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

Function Documentation

◆ CommandUnhide()

VOID CommandUnhide ( vector< CommandToken > CommandTokens,
string Command )

!unhide command handler

Parameters
CommandTokens
Command
Returns
VOID
101{
102 if (CommandTokens.size() >= 2)
103 {
104 ShowMessages("incorrect use of the '%s'\n\n",
105 GetCaseSensitiveStringFromCommandToken(CommandTokens.at(0)).c_str());
106
108 return;
109 }
110
111 //
112 // Disable transparent mode
113 //
115}
std::string GetCaseSensitiveStringFromCommandToken(CommandToken TargetToken)
Get case sensitive string from command token.
Definition common.cpp:467
VOID CommandUnhideHelp()
help of the !unhide command
Definition unhide.cpp:25
BOOLEAN HyperDbgDisableTransparentMode()
Disable transparent mode.
Definition unhide.cpp:41

◆ CommandUnhideHelp()

VOID CommandUnhideHelp ( )

help of the !unhide command

Returns
VOID
26{
27 ShowMessages("!unhide : reverts the transparency measures of the '!hide' command and exits the transparent mode.\n\n");
28
29 ShowMessages("syntax : \t!unhide\n");
30
31 ShowMessages("\n");
32 ShowMessages("\t\te.g : !unhide\n");
33}

◆ HyperDbgDisableTransparentMode()

BOOLEAN HyperDbgDisableTransparentMode ( )

Disable transparent mode.

Returns
BOOLEAN
42{
43 BOOLEAN Status;
44 ULONG ReturnedLength;
46
47 //
48 // Check if debugger is loaded or not
49 //
51
52 //
53 // We don't wanna hide the debugger and make transparent vm-exits
54 //
55 UnhideRequest.IsHide = FALSE;
56
57 //
58 // Send the request to the kernel
59 //
60 Status = DeviceIoControl(
61 g_DeviceHandle, // Handle to device
63 // code
64 &UnhideRequest, // Input Buffer to driver.
66 &UnhideRequest, // Output Buffer from driver.
68 // buffer in bytes.
69 &ReturnedLength, // Bytes placed in buffer.
70 NULL // synchronous call
71 );
72
73 if (!Status)
74 {
75 ShowMessages("ioctl failed with code 0x%x\n", GetLastError());
76 return FALSE;
77 }
78
80 {
81 ShowMessages("transparent debugging successfully disabled :)\n");
82 return TRUE;
83 }
84 else
85 {
86 ShowErrorMessage(UnhideRequest.KernelStatus);
87 return FALSE;
88 }
89}
UCHAR BOOLEAN
Definition BasicTypes.h:35
#define TRUE
Definition BasicTypes.h:114
#define FALSE
Definition BasicTypes.h:113
unsigned long ULONG
Definition BasicTypes.h:31
#define DEBUGGER_OPERATION_WAS_SUCCESSFUL
General value to indicate that the operation or request was successful.
Definition ErrorCodes.h:23
#define IOCTL_DEBUGGER_HIDE_AND_UNHIDE_TO_TRANSPARENT_THE_DEBUGGER
ioctl, request to enable or disable transparent-mode
Definition Ioctls.h:178
#define SIZEOF_DEBUGGER_HIDE_AND_TRANSPARENT_DEBUGGER_MODE
Definition RequestStructures.h:588
struct _DEBUGGER_HIDE_AND_TRANSPARENT_DEBUGGER_MODE DEBUGGER_HIDE_AND_TRANSPARENT_DEBUGGER_MODE
request for enable or disable transparent-mode
BOOLEAN ShowErrorMessage(UINT32 Error)
shows the error message
Definition debugger.cpp:40
#define AssertShowMessageReturnStmt(expr1, expr2, message1, message2, rc)
Definition common.h:59
#define ASSERT_MESSAGE_VMM_NOT_LOADED
Definition common.h:31
#define ASSERT_MESSAGE_DRIVER_NOT_LOADED
Definition common.h:27
#define AssertReturnFalse
Definition common.h:21
HANDLE g_DeviceHandle
Holds the global handle of device which is used to send the request to the kernel by IOCTL,...
Definition globals.h:481
BOOLEAN g_IsVmmModuleLoaded
shows whether the VMM module is loaded or not
Definition globals.h:28
UINT32 KernelStatus
Definition RequestStructures.h:613
BOOLEAN IsHide
Definition RequestStructures.h:597

Variable Documentation

◆ g_IsVmmModuleLoaded

BOOLEAN g_IsVmmModuleLoaded
extern

shows whether the VMM module is loaded or not