50{
56 UINT32 ActionBreakToDebuggerLength = 0;
57 UINT32 ActionCustomCodeLength = 0;
58 UINT32 ActionScriptLength = 0;
62
63
64
65
66
68 &CommandTokens,
70 &Event,
71 &EventLength,
72 &ActionBreakToDebugger,
73 &ActionBreakToDebuggerLength,
74 &ActionCustomCode,
75 &ActionCustomCodeLength,
76 &ActionScript,
77 &ActionScriptLength,
78 &EventParsingErrorCause))
79 {
80 return;
81 }
82
83
84
85
87 {
88 ShowMessages("the utilization of 'post' or 'all' event calling stages is not meaningful "
89 "for the mode (user-mode/kernel-mode) change traps; therefore, this command does not support them\n");
90
92 return;
93 }
94
95
96
97
98 if (CommandTokens.size() > 2)
99 {
100 ShowMessages("incorrect use of the '%s'\n\n",
102
104
106 return;
107 }
108
109
110
111
112 for (auto Section : CommandTokens)
113 {
115 {
116 continue;
117 }
119 {
122 }
124 {
127 }
129 {
132 }
133 else
134 {
135
136
137
138 ShowMessages("err, couldn't resolve error at '%s'\n\n",
140
142
144 }
145 }
146
147
148
149
150 if (!SetMode)
151 {
152 ShowMessages("please specify the mode(s) that you want to intercept their execution (u, k, ku)\n");
153
155 return;
156 }
157
158
159
160
162 {
163 ShowMessages("this event only applies to the selected process(es). please specify "
164 "the 'pid' or the process id of the target process that you want to trap its execution\n");
165
167 return;
168 }
169
170
171
172
174
175
176
177
179 {
180
181
182
183
184
185
187 return;
188 }
189
190
191
192
194 ActionBreakToDebugger,
195 ActionBreakToDebuggerLength,
196 ActionCustomCode,
197 ActionCustomCodeLength,
198 ActionScript,
199 ActionScriptLength))
200 {
201
202
203
204
206 return;
207 }
208}
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
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
VOID CommandModeHelp()
help of the !mode command
Definition mode.cpp:20
NULL()
Definition test-case-generator.py:530
UINT64 OptionalParam1
Definition Events.h:277
DEBUGGER_EVENT_OPTIONS Options
Definition Events.h:396
VMM_CALLBACK_EVENT_CALLING_STAGE_TYPE EventStage
Definition Events.h:374
UINT32 ProcessId
Definition Events.h:365