HyperDbg Debugger
Loading...
Searching...
No Matches
Smm.h File Reference

Headers relating to operations related to System Management Mode (SMM). More...

Go to the source code of this file.

Macros

#define SMI_TRIGGER_POWER_VALUE   0x80
 SMI trigger port value.

Functions

BOOLEAN SmmPerformSmiOperation (SMI_OPERATION_PACKETS *SmiOperationRequest, BOOLEAN ApplyFromVmxRootMode)
 Perform actions related to System Management Interrupts (SMIs).

Detailed Description

Headers relating to operations related to System Management Mode (SMM).

Author
Sina Karvandi (sina@.nosp@m.hype.nosp@m.rdbg..nosp@m.org)
Version
0.15
Date
2025-08-02

Macro Definition Documentation

◆ SMI_TRIGGER_POWER_VALUE

#define SMI_TRIGGER_POWER_VALUE   0x80

SMI trigger port value.

Function Documentation

◆ SmmPerformSmiOperation()

BOOLEAN SmmPerformSmiOperation ( SMI_OPERATION_PACKETS * SmiOperationRequest,
BOOLEAN ApplyFromVmxRootMode )

Perform actions related to System Management Interrupts (SMIs).

Parameters
SmiOperationRequest
ApplyFromVmxRootMode
Returns
BOOLEAN
84{
85 BOOLEAN Status = FALSE;
86
87 UNREFERENCED_PARAMETER(ApplyFromVmxRootMode);
88
89 //
90 // Check the SMI operation type and perform the corresponding action
91 //
92 switch (SmiOperationRequest->SmiOperationType)
93 {
95
96 //
97 // Read the SMI count from the MSR
98 //
99 SmiOperationRequest->SmiCount = SmmReadSmiCount();
100
101 Status = TRUE;
102 break;
103
105
106 if (SmmTriggerPowerSmi())
107 {
108 //
109 // If the SMI was triggered successfully
110 //
111 Status = TRUE;
112 }
113 else
114 {
115 //
116 // If the SMI was not triggered successfully, set error status
117 //
119 }
120
121 break;
122
123 default:
124
125 Status = FALSE;
127
128 break;
129 }
130
131 //
132 // Set the status of the SMI operation request
133 //
134 if (Status)
135 {
136 SmiOperationRequest->KernelStatus = DEBUGGER_OPERATION_WAS_SUCCESSFUL;
137 }
138
139 return Status;
140}
UINT64 SmmReadSmiCount()
Definition Smm.c:21
BOOLEAN SmmTriggerPowerSmi()
Definition Smm.c:39
UCHAR BOOLEAN
Definition BasicTypes.h:35
#define TRUE
Definition BasicTypes.h:114
#define FALSE
Definition BasicTypes.h:113
#define DEBUGGER_ERROR_UNABLE_TO_TRIGGER_SMI
error, unable to trigger SMI
Definition ErrorCodes.h:576
#define DEBUGGER_ERROR_INVALID_SMI_OPERATION_PARAMETERS
error, invalid parameters for SMI operation request
Definition ErrorCodes.h:570
#define DEBUGGER_OPERATION_WAS_SUCCESSFUL
General value to indicate that the operation or request was successful.
Definition ErrorCodes.h:23
@ SMI_OPERATION_REQUEST_TYPE_READ_COUNT
Definition RequestStructures.h:1254
@ SMI_OPERATION_REQUEST_TYPE_TRIGGER_POWER_SMI
Definition RequestStructures.h:1255
UINT32 KernelStatus
Definition RequestStructures.h:1267
UINT64 SmiCount
Definition RequestStructures.h:1266
SMI_OPERATION_REQUEST_TYPE SmiOperationType
Definition RequestStructures.h:1265