!hide (enable transparent-mode)
Description of '!hide' command in HyperDbg.

Command

!hide

Syntax

!hide [pid | name] [process id (hex value) | name (string)]

Description

Enables the transparent-mode of HyperDbg for anti-debugging and anti-hypervisor methods. This option only works for the processes selected by you and won't be applied to all the processes.
You should run the '!hide' after running the '!measure' command.
You can use this command multiple times.
This command is case-sensitive for the name parameter.

Parameters

[pid | name]
If you want to use the process ID, you should specify pid, and if you want to enter the process name, you should specify the name as this argument.
[process id (hex value) | name (string)]
Name or process id of the process that you want to make HyperDbg transparent for it.
You should append.exe to your process names.

Examples

If you want to hide HyperDbg for process id 2a78.
1
HyperDbg> !hide pid 2a78
Copied!
If you want to hide HyperDbg for all the processes that their process names start with procexp.exe .
1
HyperDbg> !hide name procexp.exe
Copied!

IOCTL

You should send the IOCTL_DEBUGGER_HIDE_AND_UNHIDE_TO_TRANSPARENT_THE_DEBUGGER IOCTL to enable or disable transparent-mode.
The following structure shows whether enable or disable it.
IsHide = TRUE : Enable transparent-mode.
CpuidAverage, CpuidStandardDeviation, CpuidMedian can be computed by using theTransparentModeCheckHypervisorPresence function.
RdtscAverage, RdtscStandardDeviation, RdtscMedian can be computed by using the TransparentModeCheckRdtscpVmexit function.
TrueIfProcessIdAndFalseIfProcessName if this field is TRUE then you should fill the ProcId with the process id that you need to transparent HyperDbg for that process.
Otherwise, if you want to use a process name (not process ID), then you should set the TrueIfProcessIdAndFalseIfProcessName to FALSE and append the process name (string) to the bottom of this structure and put the string size + 1 (null terminator) to the LengthOfProcessName.
Then you should send the sizeof(DEBUGGER_HIDE_AND_TRANSPARENT_DEBUGGER_MODE)+ProcessNameStringSize as the input size of DeviceIoControl.
1
typedef struct _DEBUGGER_HIDE_AND_TRANSPARENT_DEBUGGER_MODE {
2
3
BOOLEAN IsHide;
4
5
UINT64 CpuidAverage;
6
UINT64 CpuidStandardDeviation;
7
UINT64 CpuidMedian;
8
UINT64 RdtscAverage;
9
UINT64 RdtscStandardDeviation;
10
UINT64 RdtscMedian;
11
BOOLEAN TrueIfProcessIdAndFalseIfProcessName;
12
UINT32 ProcId;
13
UINT32 LengthOfProcessName; // in the case of !hide name xxx, this parameter
14
// shows the length of xxx
15
16
UINT64 KernelStatus; /* DEBUGEER_OPERATION_WAS_SUCCESSFULL ,
17
DEBUGEER_ERROR_UNABLE_TO_HIDE_OR_UNHIDE_DEBUGGER
18
*/
19
20
} DEBUGGER_HIDE_AND_TRANSPARENT_DEBUGGER_MODE,
21
*PDEBUGGER_HIDE_AND_TRANSPARENT_DEBUGGER_MODE;
Copied!
If the results were successful, then the kernel sends the DEBUGEER_OPERATION_WAS_SUCCESSFULL to user-mode as KernelStatus in the above structure, and if it was unsuccessful, then it sendsDEBUGEER_ERROR_UNABLE_TO_HIDE_OR_UNHIDE_DEBUGGER which is an indicator of error.
You can send the above structure multiple times if you want to hide multiple processes.

Remarks

This command will not guarantee to provide 100% transparency, especially in nested-virtualization environments.
HyperDbg will protect you from user-mode anti-hypervisor methods by making vm-exits transparent even in a nested-virtualization environment; however, there are other traces for anti-VMware, anti-VirtualBox, etc. methods and these methods are still problematic because, HyperDbg tries to hide itself from anti-debugging and anti-hypervisor methods and it won't hide VMware, VirtualBox, etc. thus, you need to run this command in a physical-machine (not in a nested-virtualization environment); otherwise you should find other traces for virtual machine software and solve those traces by yourself (e.g., hooking anti-VMware APIs and Queries).
This command will continue the debuggee for some time (in Debugger Mode). This means that you lose the current context (registers & memory) after executing this command.

Requirements

None
Last modified 1mo ago