Check the script capablities with the target script buffer.
243{
246
251
252 for (size_t i = 0; i < CountOfScriptSymbolChunks; i++)
253 {
255 {
256
257
258
259 Operands++;
260 ShowMessages(
" \t%d. found a non-semnatic rule (operand) | type: 0x%x, value: 0x%x\n", i, SymbolArray[i].Type, SymbolArray[i].
Value);
261
262
263
264
265 switch (SymbolArray[i].Type)
266 {
269
271 {
273 ShowMessages(
"err, global/local variable assignment is not supported\n");
274 }
275
277 {
279 ShowMessages(
"err, global/local variable index is out of range of supported by this instance of hwdbg\n");
280 }
281
282 break;
283
286
287
288
289
290 break;
291
293
295 {
297 ShowMessages(
"err, register assignment is not supported\n");
298 }
299 break;
300
302
304 {
306 ShowMessages(
"err, pseudo register index is not supported\n");
307 }
308 break;
309
311
313 {
315 ShowMessages(
"err, temporary variables (for conditional statement) is not supported\n");
316 }
317
319 {
321 ShowMessages(
"err, temp variable index (number of operands for conditional statements) is out of range of supported by this instance of hwdbg\n");
322 }
323
324 break;
325
326 default:
327
329 ShowMessages(
"err, unknown operand type: %d (0x%x)\n", SymbolArray[i].Type, SymbolArray[i].Type);
330 break;
331 }
332 }
333 else
334 {
335
336
337
338 Stages++;
339 ShowMessages(
"- %d. found a semnatic rule (operator) | type: 0x%x, value: 0x%x\n", i, SymbolArray[i].Type, SymbolArray[i].
Value);
340
342 {
344 ShowMessages(
"err, unknown operand type for the operator (0x%x)\n",
345 SymbolArray[i].Type);
346
348 }
349
350
351
352
353 switch (SymbolArray[i].
Value)
354 {
357 {
359 ShowMessages(
"err, OR is not supported by the debuggee\n");
360 }
361 break;
362
365 {
367 ShowMessages(
"err, XOR is not supported by the debuggee\n");
368 }
369 break;
370
373 {
375 ShowMessages(
"err, AND is not supported by the debuggee\n");
376 }
377 break;
378
381 {
383 ShowMessages(
"err, arithmetic shift right is not supported by the debuggee\n");
384 }
385 break;
386
389 {
391 ShowMessages(
"err, arithmetic shift left is not supported by the debuggee\n");
392 }
393 break;
394
397 {
399 ShowMessages(
"err, addition is not supported by the debuggee\n");
400 }
401 break;
402
405 {
407 ShowMessages(
"err, subtraction is not supported by the debuggee\n");
408 }
409 break;
410
413 {
415 ShowMessages(
"err, multiplication is not supported by the debuggee\n");
416 }
417 break;
418
421 {
423 ShowMessages(
"err, division is not supported by the debuggee\n");
424 }
425 break;
426
429 {
431 ShowMessages(
"err, modulus is not supported by the debuggee\n");
432 }
433 break;
434
436
439 {
441 ShowMessages(
"err, greater than is not supported by the debuggee\n");
442 }
443 break;
444
448 {
450 ShowMessages(
"err, less than is not supported by the debuggee\n");
451 }
452 break;
453
457 {
459 ShowMessages(
"err, greater than or equal to is not supported by the debuggee\n");
460 }
461 break;
462
466 {
468 ShowMessages(
"err, less than or equal to is not supported by the debuggee\n");
469 }
470 break;
471
475 {
477 ShowMessages(
"err, equal is not supported by the debuggee\n");
478 }
479 break;
480
484 {
486 ShowMessages(
"err, not equal is not supported by the debuggee\n");
487 }
488 break;
489
493 {
495 ShowMessages(
"err, jump is not supported by the debuggee\n");
496 }
497 break;
498
502 {
504 ShowMessages(
"err, jump if zero is not supported by the debuggee\n");
505 }
506 break;
507
511 {
513 ShowMessages(
"err, jump if not zero is not supported by the debuggee\n");
514 }
515 break;
516
519 {
521 ShowMessages(
"err, move is not supported by the debuggee\n");
522 }
523 break;
524
527 {
529 ShowMessages(
"err, printf is not supported by the debuggee\n");
530 }
531 break;
532
533 default:
534
536 ShowMessages(
"err, undefined operator for hwdbg: %d (0x%x)\n",
537 SymbolArray[i].Type,
538 SymbolArray[i].Type);
539
540 break;
541 }
542 }
543 }
544
545
546
547
548 *NumberOfStages = Stages;
549
550
551
552
553 *NumberOfOperands = Operands;
554
555
556
557
558 if (NotSupported)
559 {
561 }
562 else
563 {
565 }
566}
UCHAR BOOLEAN
Definition BasicTypes.h:39
#define TRUE
Definition BasicTypes.h:55
#define FALSE
Definition BasicTypes.h:54
unsigned int UINT32
Definition BasicTypes.h:48
UINT32 * NumberOfGetOperands
Definition HyperDbgScriptImports.h:33
UINT32 UINT32 * NumberOfSetOperands
Definition HyperDbgScriptImports.h:33
#define SYMBOL_REGISTER_TYPE
Definition ScriptEngineCommonDefinitions.h:57
#define FUNC_MUL
Definition ScriptEngineCommonDefinitions.h:113
#define SYMBOL_TEMP_TYPE
Definition ScriptEngineCommonDefinitions.h:60
#define SYMBOL_GLOBAL_ID_TYPE
Definition ScriptEngineCommonDefinitions.h:54
#define SYMBOL_LOCAL_ID_TYPE
Definition ScriptEngineCommonDefinitions.h:55
#define FUNC_JMP
Definition ScriptEngineCommonDefinitions.h:123
#define FUNC_GT
Definition ScriptEngineCommonDefinitions.h:116
#define FUNC_MOV
Definition ScriptEngineCommonDefinitions.h:131
#define FUNC_EGT
Definition ScriptEngineCommonDefinitions.h:118
#define FUNC_SUB
Definition ScriptEngineCommonDefinitions.h:112
#define FUNC_PRINTF
Definition ScriptEngineCommonDefinitions.h:163
#define FUNC_ASR
Definition ScriptEngineCommonDefinitions.h:109
#define FUNC_ASL
Definition ScriptEngineCommonDefinitions.h:110
#define FUNC_ELT
Definition ScriptEngineCommonDefinitions.h:119
#define FUNC_OR
Definition ScriptEngineCommonDefinitions.h:106
#define FUNC_XOR
Definition ScriptEngineCommonDefinitions.h:107
#define SYMBOL_UNDEFINED
Definition ScriptEngineCommonDefinitions.h:53
#define FUNC_ADD
Definition ScriptEngineCommonDefinitions.h:111
#define FUNC_NEQ
Definition ScriptEngineCommonDefinitions.h:121
#define FUNC_JZ
Definition ScriptEngineCommonDefinitions.h:124
#define FUNC_EQUAL
Definition ScriptEngineCommonDefinitions.h:120
#define FUNC_LT
Definition ScriptEngineCommonDefinitions.h:117
#define SYMBOL_SEMANTIC_RULE_TYPE
Definition ScriptEngineCommonDefinitions.h:59
#define FUNC_DIV
Definition ScriptEngineCommonDefinitions.h:114
#define SYMBOL_PSEUDO_REG_TYPE
Definition ScriptEngineCommonDefinitions.h:58
#define FUNC_AND
Definition ScriptEngineCommonDefinitions.h:108
#define SYMBOL_NUM_TYPE
Definition ScriptEngineCommonDefinitions.h:56
#define FUNC_MOD
Definition ScriptEngineCommonDefinitions.h:115
#define FUNC_JNZ
Definition ScriptEngineCommonDefinitions.h:125
RequestedActionOfThePacket Value(0x1) 00000000
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition libhyperdbg.cpp:96
BOOLEAN ScriptEngineFuncNumberOfOperands(UINT64 FuncType, UINT32 *NumberOfGetOperands, UINT32 *NumberOfSetOperands)
wrapper for getting operand count
Definition script-engine-wrapper.cpp:874
UINT64 func_or
Definition HardwareDebugger.h:123
UINT64 func_mov
Definition HardwareDebugger.h:142
UINT64 func_div
Definition HardwareDebugger.h:131
UINT64 assign_registers
Definition HardwareDebugger.h:119
UINT64 assign_local_global_var
Definition HardwareDebugger.h:118
UINT64 func_printf
Definition HardwareDebugger.h:143
UINT64 func_sub
Definition HardwareDebugger.h:129
UINT64 assign_pseudo_registers
Definition HardwareDebugger.h:120
UINT64 func_mul
Definition HardwareDebugger.h:130
UINT64 func_elt
Definition HardwareDebugger.h:136
UINT64 func_and
Definition HardwareDebugger.h:125
UINT64 func_gt
Definition HardwareDebugger.h:133
UINT64 func_jnz
Definition HardwareDebugger.h:141
UINT64 func_equal
Definition HardwareDebugger.h:137
UINT64 func_neq
Definition HardwareDebugger.h:138
UINT64 conditional_statements_and_comparison_operators
Definition HardwareDebugger.h:121
UINT64 func_jmp
Definition HardwareDebugger.h:139
UINT64 func_lt
Definition HardwareDebugger.h:134
UINT64 func_xor
Definition HardwareDebugger.h:124
UINT64 func_add
Definition HardwareDebugger.h:128
UINT64 func_asl
Definition HardwareDebugger.h:127
UINT64 func_egt
Definition HardwareDebugger.h:135
UINT64 func_mod
Definition HardwareDebugger.h:132
UINT64 func_jz
Definition HardwareDebugger.h:140
UINT64 func_asr
Definition HardwareDebugger.h:126
UINT32 numberOfSupportedLocalAndGlobalVariables
Definition HardwareDebugger.h:98
struct _HWDBG_INSTANCE_INFORMATION::_HWDBG_SCRIPT_CAPABILITIES scriptCapabilities
UINT32 numberOfSupportedTemporaryVariables
Definition HardwareDebugger.h:99
Definition ScriptEngineCommonDefinitions.h:6