48{
54 UINT32 ActionBreakToDebuggerLength = 0;
55 UINT32 ActionCustomCodeLength = 0;
56 UINT32 ActionScriptLength = 0;
57 UINT64 TargetRegister = 1;
58 UINT64 MaskRegister = 0xFFFFFFFFFFFFFFFF;
62
63 if (CommandTokens.size() < 2)
64 {
65 ShowMessages("incorrect use of the '%s'\n\n",
68 return;
69 }
70
71
72
73
74
76 &CommandTokens,
78 &Event,
79 &EventLength,
80 &ActionBreakToDebugger,
81 &ActionBreakToDebuggerLength,
82 &ActionCustomCode,
83 &ActionCustomCodeLength,
84 &ActionScript,
85 &ActionScriptLength,
86 &EventParsingErrorCause))
87 {
88 return;
89 }
90
91
92
93
94 for (auto Section : CommandTokens)
95 {
97 {
98 continue;
99 }
100 else if (!GetRegister)
101 {
102
103
104
106 {
107
108
109
110 ShowMessages("unknown parameter '%s'\n\n",
113
115 return;
116 }
117 else
118 {
120 }
121 }
122 else if (!GetMask)
123 {
125 {
126
127
128
129 ShowMessages("unknown parameter '%s'\n\n",
132
134 return;
135 }
136 else
137 {
139 }
140 }
141 else
142 {
143
144
145
146 ShowMessages("unknown parameter '%s'\n\n",
149
151 return;
152 }
153 }
154
155 if (TargetRegister != VMX_EXIT_QUALIFICATION_REGISTER_CR0 && TargetRegister != VMX_EXIT_QUALIFICATION_REGISTER_CR4)
156 {
157 ShowMessages("please choose either 0 for cr0 or 4 for cr4\n");
159
161 return;
162 }
163
164
165
166
168
169
170
171
173
174
175
176
178 {
179
180
181
182
183
185 return;
186 }
187
188
189
190
192 ActionBreakToDebugger,
193 ActionBreakToDebuggerLength,
194 ActionCustomCode,
195 ActionCustomCodeLength,
196 ActionScript,
197 ActionScriptLength))
198 {
199
200
201
203 return;
204 }
205}
std::string GetCaseSensitiveStringFromCommandToken(CommandToken TargetToken)
Get case sensitive string from command token.
Definition common.cpp:467
BOOLEAN CompareLowerCaseStrings(CommandToken TargetToken, const CHAR *StringToCompare)
Compare lower case strings.
Definition common.cpp:503
BOOLEAN ConvertTokenToUInt64(CommandToken TargetToken, PUINT64 Result)
add ` between 64 bit values and convert them to string
Definition common.cpp:447
VOID CommandCrwriteHelp()
help of the !crwrite command
Definition crwrite.cpp:20
VOID FreeEventsAndActionsMemory(PDEBUGGER_GENERAL_EVENT_DETAIL Event, PDEBUGGER_GENERAL_ACTION ActionBreakToDebugger, PDEBUGGER_GENERAL_ACTION ActionCustomCode, PDEBUGGER_GENERAL_ACTION ActionScript)
Deallocate buffers relating to events and actions.
Definition debugger.cpp:1688
BOOLEAN InterpretGeneralEventAndActionsFields(vector< CommandToken > *CommandTokens, VMM_EVENT_TYPE_ENUM EventType, PDEBUGGER_GENERAL_EVENT_DETAIL *EventDetailsToFill, PUINT32 EventBufferLength, PDEBUGGER_GENERAL_ACTION *ActionDetailsToFillBreakToDebugger, PUINT32 ActionBufferLengthBreakToDebugger, PDEBUGGER_GENERAL_ACTION *ActionDetailsToFillCustomCode, PUINT32 ActionBufferLengthCustomCode, PDEBUGGER_GENERAL_ACTION *ActionDetailsToFillScript, PUINT32 ActionBufferLengthScript, PDEBUGGER_EVENT_PARSING_ERROR_CAUSE ReasonForErrorInParsing)
Interpret general event fields.
Definition debugger.cpp:1736
BOOLEAN SendEventToKernel(PDEBUGGER_GENERAL_EVENT_DETAIL Event, UINT32 EventBufferLength)
Register the event to the kernel.
Definition debugger.cpp:1367
BOOLEAN RegisterActionToEvent(PDEBUGGER_GENERAL_EVENT_DETAIL Event, PDEBUGGER_GENERAL_ACTION ActionBreakToDebugger, UINT32 ActionBreakToDebuggerLength, PDEBUGGER_GENERAL_ACTION ActionCustomCode, UINT32 ActionCustomCodeLength, PDEBUGGER_GENERAL_ACTION ActionScript, UINT32 ActionScriptLength)
Register the action to the event.
Definition debugger.cpp:1483
NULL()
Definition test-case-generator.py:530
UINT64 OptionalParam2
Definition Events.h:278
UINT64 OptionalParam1
Definition Events.h:277
DEBUGGER_EVENT_OPTIONS Options
Definition Events.h:396