54{
56
57 if (SplitCommand.size() >= 3)
58 {
61 return;
62 }
63
64 if (SplitCommand.size() == 2 && SplitCommand.at(1).compare("default"))
65 {
68 return;
69 }
70 else if (SplitCommand.size() == 2 &&
71 !SplitCommand.at(1).compare("default"))
72 {
74 }
75
76
77
78
80 {
82 "Debugger is loaded and your machine is already in a hypervisor, you "
83 "should measure the times before 'load'-ing the debugger, please "
84 "'unload' the debugger and use '!measure' again or use '!measure "
85 "default' to use hardcoded measurements\n");
86 return;
87 }
88
89 if (!DefaultMode)
90 {
95 {
97 "we detected that there is a hypervisor, on your system, it "
98 "leads to wrong measurement results for our transparent-mode, please "
99 "make sure that you're not in a hypervisor then measure the result "
100 "again; otherwise the transparent-mode will not work but you can use "
101 "'!measure default' to use the hardcoded measurements !\n\n");
102
103 return;
104 }
105
110 {
112 "we detected that there is a hypervisor, on your system, it "
113 "leads to wrong measurement results for our transparent-mode, please "
114 "make sure that you're not in a hypervisor then measure the result "
115 "again; otherwise the transparent-mode will not work but you can use "
116 "'!measure default' to use the hardcoded measurements !\n\n");
117
118 return;
119 }
120 }
121 else
122 {
123
124
125
126
127
128
129
133
134
135
136
140 }
141
142 ShowMessages(
"the measurements were successful\nyou can use the '!hide' command now\n");
143
144
145
146
148}
UCHAR BOOLEAN
Definition BasicTypes.h:39
#define TRUE
Definition BasicTypes.h:55
#define FALSE
Definition BasicTypes.h:54
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
UINT64 g_CpuidStandardDeviation
The standard deviation calculated from the measurements of cpuid '!measure' command.
Definition globals.h:532
UINT64 g_RdtscAverage
The average calculated from the measurements of rdtsc/p '!measure' command.
Definition globals.h:544
VOID CommandMeasureHelp()
help of the !measure command
Definition measure.cpp:33
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
UINT64 g_CpuidMedian
The median calculated from the measurements of cpuid '!measure' command.
Definition globals.h:538
UINT64 g_RdtscStandardDeviation
The standard deviation calculated from the measurements of rdtsc/p '!measure' command.
Definition globals.h:550
UINT64 g_CpuidAverage
The average calculated from the measurements of cpuid '!measure' command.
Definition globals.h:526
BOOLEAN TransparentModeCheckRdtscpVmexit(UINT64 *Average, UINT64 *StandardDeviation, UINT64 *Median)
compute the average, standard deviation and median if rdtsc+rdtsc
Definition transparency.cpp:224
BOOLEAN TransparentModeCheckHypervisorPresence(UINT64 *Average, UINT64 *StandardDeviation, UINT64 *Median)
compute the average, standard deviation and median if rdtsc+cpuid+rdtsc
Definition transparency.cpp:194