Check the script capabilities with the target script buffer.
88{
91
94 UINT32 NumberOfGetOperands = 0;
95 UINT32 NumberOfSetOperands = 0;
96
97 for (size_t i = 0; i < CountOfScriptSymbolChunks; i++)
98 {
100 {
101
102
103
104 Operands++;
105 ShowMessages(
" \t%lld. found a non-semnatic rule (operand) | type: 0x%llx, value: 0x%llx\n", i, SymbolArray[i].Type, SymbolArray[i].
Value);
106
107
108
109
110 switch (SymbolArray[i].Type)
111 {
114
116 {
118 ShowMessages("err, global/local variable assignment is not supported\n");
119 }
120
122 {
124 ShowMessages("err, global/local variable index is out of range of supported by this instance of hwdbg\n");
125 }
126
127 break;
128
131
132
133
134
135 break;
136
138
140 {
142 ShowMessages("err, register assignment is not supported\n");
143 }
144 break;
145
147
149 {
151 ShowMessages("err, pseudo register index is not supported\n");
152 }
153 break;
154
156
158 {
160 ShowMessages("err, temporary variables (for conditional statement) is not supported\n");
161 }
162
164 {
166 ShowMessages("err, temp variable index (number of operands for conditional statements) is out of range of supported by this instance of hwdbg\n");
167 }
168
169 break;
170
172
174 {
176 ShowMessages("err, temporary variables (for conditional statement) is not supported\n");
177 }
178
179 break;
180
181 default:
182
184 ShowMessages("err, unknown operand type: %lld (0x%llx)\n", SymbolArray[i].Type, SymbolArray[i].Type);
185 break;
186 }
187 }
188 else
189 {
190
191
192
193 Stages++;
194 ShowMessages(
"- %lld. found a semnatic rule (operator) | type: 0x%llx, value: 0x%llx\n", i, SymbolArray[i].Type, SymbolArray[i].
Value);
195
197 {
199 ShowMessages("err, unknown operand type for the operator (0x%llx)\n",
200 SymbolArray[i].Type);
201
203 }
204
205
206
207
208 switch (SymbolArray[i].
Value)
209 {
212 {
214 ShowMessages("err, OR is not supported by the debuggee\n");
215 }
216 break;
217
220 {
222 ShowMessages("err, XOR is not supported by the debuggee\n");
223 }
224 break;
225
228 {
230 ShowMessages("err, AND is not supported by the debuggee\n");
231 }
232 break;
233
236 {
238 ShowMessages("err, arithmetic shift right is not supported by the debuggee\n");
239 }
240 break;
241
244 {
246 ShowMessages("err, arithmetic shift left is not supported by the debuggee\n");
247 }
248 break;
249
252 {
254 ShowMessages("err, addition is not supported by the debuggee\n");
255 }
256 break;
257
260 {
262 ShowMessages("err, subtraction is not supported by the debuggee\n");
263 }
264 break;
265
268 {
270 ShowMessages("err, multiplication is not supported by the debuggee\n");
271 }
272 break;
273
276 {
278 ShowMessages("err, division is not supported by the debuggee\n");
279 }
280 break;
281
284 {
286 ShowMessages("err, modulus is not supported by the debuggee\n");
287 }
288 break;
289
291
294 {
296 ShowMessages("err, greater than is not supported by the debuggee\n");
297 }
298 break;
299
303 {
305 ShowMessages("err, less than is not supported by the debuggee\n");
306 }
307 break;
308
312 {
314 ShowMessages("err, greater than or equal to is not supported by the debuggee\n");
315 }
316 break;
317
321 {
323 ShowMessages("err, less than or equal to is not supported by the debuggee\n");
324 }
325 break;
326
330 {
332 ShowMessages("err, equal is not supported by the debuggee\n");
333 }
334 break;
335
339 {
341 ShowMessages("err, not equal is not supported by the debuggee\n");
342 }
343 break;
344
348 {
350 ShowMessages("err, jump is not supported by the debuggee\n");
351 }
352 break;
353
357 {
359 ShowMessages("err, jump if zero is not supported by the debuggee\n");
360 }
361 break;
362
366 {
368 ShowMessages("err, jump if not zero is not supported by the debuggee\n");
369 }
370 break;
371
374 {
376 ShowMessages("err, move is not supported by the debuggee\n");
377 }
378 break;
379
382 {
384 ShowMessages("err, printf is not supported by the debuggee\n");
385 }
386 break;
387
388 default:
389
391 ShowMessages("err, undefined operator for hwdbg: %lld (0x%llx)\n",
392 SymbolArray[i].Type,
393 SymbolArray[i].Type);
394
395 break;
396 }
397 }
398 }
399
400
401
402
403 *NumberOfStages = Stages;
404
405
406
407
408 *NumberOfOperands = Operands;
409
410
411
412
414
415
416
417
418 if (NotSupported)
419 {
421 }
422 else
423 {
425 }
426}
RequestedActionOfThePacket Value(0x1) 00000000
BOOLEAN FuncGetNumberOfOperands(UINT64 FuncType, UINT32 *NumberOfGetOperands, UINT32 *NumberOfSetOperands)
Script Engine get number of operands.
Definition script-engine.c:4688
UINT64 func_or
Definition HardwareDebugger.h:149
UINT64 func_mov
Definition HardwareDebugger.h:168
UINT64 func_div
Definition HardwareDebugger.h:157
UINT64 assign_registers
Definition HardwareDebugger.h:144
UINT64 assign_local_global_var
Definition HardwareDebugger.h:143
UINT64 func_printf
Definition HardwareDebugger.h:169
UINT64 func_sub
Definition HardwareDebugger.h:155
UINT64 assign_pseudo_registers
Definition HardwareDebugger.h:145
UINT64 func_mul
Definition HardwareDebugger.h:156
UINT64 func_elt
Definition HardwareDebugger.h:162
UINT64 func_and
Definition HardwareDebugger.h:151
UINT64 func_gt
Definition HardwareDebugger.h:159
UINT64 func_jnz
Definition HardwareDebugger.h:167
UINT64 stack_assignments
Definition HardwareDebugger.h:147
UINT64 func_equal
Definition HardwareDebugger.h:163
UINT64 func_neq
Definition HardwareDebugger.h:164
UINT64 conditional_statements_and_comparison_operators
Definition HardwareDebugger.h:146
UINT64 func_jmp
Definition HardwareDebugger.h:165
UINT64 func_lt
Definition HardwareDebugger.h:160
UINT64 func_xor
Definition HardwareDebugger.h:150
UINT64 func_add
Definition HardwareDebugger.h:154
UINT64 func_asl
Definition HardwareDebugger.h:153
UINT64 func_egt
Definition HardwareDebugger.h:161
UINT64 func_mod
Definition HardwareDebugger.h:158
UINT64 func_jz
Definition HardwareDebugger.h:166
UINT64 func_asr
Definition HardwareDebugger.h:152
UINT32 maximumNumberOfSupportedGetScriptOperators
Definition HardwareDebugger.h:125
UINT32 numberOfSupportedLocalAndGlobalVariables
Definition HardwareDebugger.h:123
struct _HWDBG_INSTANCE_INFORMATION::_HWDBG_SCRIPT_CAPABILITIES scriptCapabilities
UINT32 numberOfSupportedTemporaryVariables
Definition HardwareDebugger.h:124
UINT32 maximumNumberOfSupportedSetScriptOperators
Definition HardwareDebugger.h:126
Definition ScriptEngineCommonDefinitions.h:6