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

!unhide command More...

#include "pch.h"

Functions

VOID CommandUnhideHelp ()
 help of the !unhide command
 
VOID CommandUnhide (vector< string > SplitCommand, string Command)
 !unhide command handler
 

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< string > SplitCommand,
string Command )

!unhide command handler

Parameters
SplitCommand
Command
Returns
VOID
39{
40 BOOLEAN Status;
41 ULONG ReturnedLength;
43
44 if (SplitCommand.size() >= 2)
45 {
46 ShowMessages("incorrect use of the '!unhide'\n\n");
48 return;
49 }
50
51 //
52 // Check if debugger is loaded or not
53 //
55
56 //
57 // We don't wanna hide the debugger and make transparent vm-exits
58 //
59 UnhideRequest.IsHide = FALSE;
60
61 //
62 // Send the request to the kernel
63 //
64 Status = DeviceIoControl(
65 g_DeviceHandle, // Handle to device
67 // code
68 &UnhideRequest, // Input Buffer to driver.
70 &UnhideRequest, // Output Buffer from driver.
72 // buffer in 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 ShowMessages("transparent debugging successfully disabled :)\n");
86 }
87 else if (UnhideRequest.KernelStatus ==
89 {
90 ShowMessages("debugger is not in transparent-mode\n");
91 }
92 else
93 {
94 ShowMessages("unknown error occurred :(\n");
95 }
96}
UCHAR BOOLEAN
Definition BasicTypes.h:39
#define FALSE
Definition BasicTypes.h:54
unsigned long ULONG
Definition BasicTypes.h:37
#define DEBUGGER_ERROR_DEBUGGER_ALREADY_UHIDE
error, the debugger is already in transparent-mode
Definition ErrorCodes.h:93
#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:120
#define SIZEOF_DEBUGGER_HIDE_AND_TRANSPARENT_DEBUGGER_MODE
Definition RequestStructures.h:541
#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
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
request for enable or disable transparent-mode
Definition RequestStructures.h:549
UINT64 KernelStatus
Definition RequestStructures.h:565
BOOLEAN IsHide
Definition RequestStructures.h:550
VOID CommandUnhideHelp()
help of the !unhide command
Definition unhide.cpp:20

◆ CommandUnhideHelp()

VOID CommandUnhideHelp ( )

help of the !unhide command

Returns
VOID
21{
22 ShowMessages("!unhide : reverts the transparency measures of the '!hide' command.\n\n");
23
24 ShowMessages("syntax : \t!unhide\n");
25
26 ShowMessages("\n");
27 ShowMessages("\t\te.g : !unhide\n");
28}