51{
57 UINT32 ActionBreakToDebuggerLength = 0;
58 UINT32 ActionCustomCodeLength = 0;
59 UINT32 ActionScriptLength = 0;
60 vector<string> SplitCommandCaseSensitive {
Split(Command,
' ')};
64
65
66
67
68
70 &SplitCommand,
71 &SplitCommandCaseSensitive,
73 &Event,
74 &EventLength,
75 &ActionBreakToDebugger,
76 &ActionBreakToDebuggerLength,
77 &ActionCustomCode,
78 &ActionCustomCodeLength,
79 &ActionScript,
80 &ActionScriptLength,
81 &EventParsingErrorCause))
82 {
83 return;
84 }
85
86
87
88
89 if (SplitCommand.size() > 2)
90 {
93
95 return;
96 }
97
98
99
100
101 for (auto Section : SplitCommand)
102 {
103 if (!Section.compare("!trace"))
104 {
105 continue;
106 }
107 else if ((!Section.compare("step-in") || !Section.compare("stepin") || !Section.compare("step")) && !SetTraceType)
108 {
111 }
112 else if ((!Section.compare("step-out") || !Section.compare("stepout")) && !SetTraceType)
113 {
116 }
117 else if ((!Section.compare("step-instrument") || !Section.compare("instrument-step") ||
118 !Section.compare("instrumentstep") ||
119 !Section.compare("instrument-step-in")) &&
120 !SetTraceType)
121 {
124 }
125 else
126 {
127
128
129
131 Section.c_str());
132
134
136 }
137 }
138
139
140
141
142 if (!SetTraceType)
143 {
145
147 return;
148 }
149
150
151
152
154
155
156
157
159 {
160
161
162
163
164
165
167 return;
168 }
169
170
171
172
174 ActionBreakToDebugger,
175 ActionBreakToDebuggerLength,
176 ActionCustomCode,
177 ActionCustomCodeLength,
178 ActionScript,
179 ActionScriptLength))
180 {
181
182
183
184
186 return;
187 }
188}
UCHAR BOOLEAN
Definition BasicTypes.h:39
#define TRUE
Definition BasicTypes.h:55
#define FALSE
Definition BasicTypes.h:54
unsigned __int64 UINT64
Definition BasicTypes.h:21
unsigned int UINT32
Definition BasicTypes.h:48
const vector< string > Split(const string &s, const char &c)
general split command
Definition common.cpp:117
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:2292
BOOLEAN InterpretGeneralEventAndActionsFields(vector< string > *SplitCommand, vector< string > *SplitCommandCaseSensitive, 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:2342
BOOLEAN SendEventToKernel(PDEBUGGER_GENERAL_EVENT_DETAIL Event, UINT32 EventBufferLength)
Register the event to the kernel.
Definition debugger.cpp:1969
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:2086
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
NULL()
Definition test-case-generator.py:530
UINT64 OptionalParam1
Definition Events.h:272
Each event can have multiple actions.
Definition Events.h:406
Each command is like the following struct, it also used for tracing works in user mode and sending it...
Definition Events.h:350
DEBUGGER_EVENT_OPTIONS Options
Definition Events.h:391
VOID CommandTraceHelp()
help of the !trace command
Definition trace.cpp:20