HyperDbg Debugger
Toggle main menu visibility
Loading...
Searching...
No Matches
script-engine.h
Go to the documentation of this file.
1
12
13
#pragma once
14
#include "
type.h
"
15
16
#ifndef SCRIPT_ENGINE_H
17
# define SCRIPT_ENGINE_H
18
19
20
VOID
21
ShowMessages
(
const
char
* Fmt, ...);
22
23
PSYMBOL
24
NewSymbol
(
void
);
25
26
PSYMBOL
27
NewStringSymbol
(
PSCRIPT_ENGINE_TOKEN
Token);
28
29
PSYMBOL
30
NewWstringSymbol
(
PSCRIPT_ENGINE_TOKEN
Token);
31
32
unsigned
int
33
GetSymbolHeapSize
(
PSYMBOL
Symbol);
34
35
void
36
RemoveSymbol
(
PSYMBOL
* Symbol);
37
38
PSYMBOL_BUFFER
39
NewSymbolBuffer
(
void
);
40
41
PSYMBOL_BUFFER
42
PushSymbol
(
PSYMBOL_BUFFER
SymbolBuffer,
const
PSYMBOL
Symbol);
43
44
PSYMBOL
45
ToSymbol
(
PSCRIPT_ENGINE_TOKEN
PTOKEN,
PSCRIPT_ENGINE_ERROR_TYPE
Error);
46
47
void
48
ScriptEngineBooleanExpresssionParse
(
49
UINT64 BooleanExpressionSize,
50
PSCRIPT_ENGINE_TOKEN
FirstToken,
51
PSCRIPT_ENGINE_TOKEN_LIST
MatchedStack,
52
PSYMBOL_BUFFER
CodeBuffer,
53
char
* str,
54
char
* c,
55
PSCRIPT_ENGINE_ERROR_TYPE
Error);
56
57
UINT64
58
BooleanExpressionExtractEnd
(
char
* str,
BOOL
* WaitForWaitStatementBooleanExpression,
PSCRIPT_ENGINE_TOKEN
CurrentIn);
59
60
void
61
CodeGen
(
62
PSCRIPT_ENGINE_TOKEN_LIST
MatchedStack,
63
PSYMBOL_BUFFER
CodeBuffer,
64
PSCRIPT_ENGINE_TOKEN
Operator,
65
PSCRIPT_ENGINE_ERROR_TYPE
Error,
66
char
** ScriptSource
67
);
68
69
unsigned
long
long
int
70
RegisterToInt
(
char
* str);
71
72
unsigned
long
long
int
73
PseudoRegToInt
(
char
* str);
74
75
unsigned
long
long
int
76
SemanticRuleToInt
(
char
* str);
77
78
char
*
79
HandleError
(
PSCRIPT_ENGINE_ERROR_TYPE
Error,
char
* str);
80
81
int
82
NewGlobalIdentifier
(
PSCRIPT_ENGINE_TOKEN
PTOKEN);
83
84
int
85
GetGlobalIdentifierVal
(
PSCRIPT_ENGINE_TOKEN
PTOKEN);
86
87
VOID
88
SetGlobalIdentifierVariableType
(
PSCRIPT_ENGINE_TOKEN
Token,
VARIABLE_TYPE
* VariableType);
89
90
VARIABLE_TYPE
*
91
GetGlobalIdentifierVariableType
(
PSCRIPT_ENGINE_TOKEN
Token);
92
93
unsigned
long
long
94
NewLocalIdentifier
(
PSCRIPT_ENGINE_TOKEN
PTOKEN,
unsigned
int
VariableSize);
95
96
int
97
GetLocalIdentifierVal
(
PSCRIPT_ENGINE_TOKEN
PTOKEN);
98
99
VOID
100
SetLocalIdentifierVariableType
(
PSCRIPT_ENGINE_TOKEN
Token,
VARIABLE_TYPE
* VariableType);
101
102
VARIABLE_TYPE
*
103
GetLocalIdentifierVariableType
(
PSCRIPT_ENGINE_TOKEN
Token);
104
105
int
106
NewFunctionParameterIdentifier
(
PSCRIPT_ENGINE_TOKEN
Token);
107
108
int
109
GetFunctionParameterIdentifier
(
PSCRIPT_ENGINE_TOKEN
Token);
110
111
int
112
LalrGetRhsSize
(
int
RuleId);
113
114
BOOL
115
LalrIsOperandType
(
PSCRIPT_ENGINE_TOKEN
PTOKEN);
116
117
PUSER_DEFINED_FUNCTION_NODE
118
GetUserDefinedFunctionNode
(
PSCRIPT_ENGINE_TOKEN
Token);
119
120
BOOLEAN
121
FuncGetNumberOfOperands
(UINT64 FuncType,
UINT32
* NumberOfGetOperands,
UINT32
* NumberOfSetOperands);
122
123
#endif
BOOL
int BOOL
Definition
BasicTypes.h:25
BOOLEAN
UCHAR BOOLEAN
Definition
BasicTypes.h:35
UINT32
unsigned int UINT32
Definition
BasicTypes.h:54
PSYMBOL
struct SYMBOL * PSYMBOL
PSYMBOL_BUFFER
struct SYMBOL_BUFFER * PSYMBOL_BUFFER
PSCRIPT_ENGINE_TOKEN
struct _SCRIPT_ENGINE_TOKEN * PSCRIPT_ENGINE_TOKEN
PSCRIPT_ENGINE_TOKEN_LIST
struct _SCRIPT_ENGINE_TOKEN_LIST * PSCRIPT_ENGINE_TOKEN_LIST
PUSER_DEFINED_FUNCTION_NODE
struct _USER_DEFINED_FUNCTION_NODE * PUSER_DEFINED_FUNCTION_NODE
LalrGetRhsSize
int LalrGetRhsSize(int RuleId)
Returns the size of Right Hand Side (RHS) of a rule.
Definition
script-engine.c:4571
GetUserDefinedFunctionNode
PUSER_DEFINED_FUNCTION_NODE GetUserDefinedFunctionNode(PSCRIPT_ENGINE_TOKEN Token)
Definition
script-engine.c:4549
GetLocalIdentifierVal
int GetLocalIdentifierVal(PSCRIPT_ENGINE_TOKEN PTOKEN)
Returns the integer assigned to local variable.
Definition
script-engine.c:4383
GetLocalIdentifierVariableType
VARIABLE_TYPE * GetLocalIdentifierVariableType(PSCRIPT_ENGINE_TOKEN Token)
Definition
script-engine.c:4493
FuncGetNumberOfOperands
BOOLEAN FuncGetNumberOfOperands(UINT64 FuncType, UINT32 *NumberOfGetOperands, UINT32 *NumberOfSetOperands)
Script Engine get number of operands.
Definition
script-engine.c:4688
SetLocalIdentifierVariableType
VOID SetLocalIdentifierVariableType(PSCRIPT_ENGINE_TOKEN Token, VARIABLE_TYPE *VariableType)
Definition
script-engine.c:4473
ShowMessages
VOID ShowMessages(const char *Fmt,...)
Show messages.
Definition
messaging.cpp:84
RegisterToInt
unsigned long long int RegisterToInt(char *str)
Converts register string to integer.
Definition
script-engine.c:4112
NewFunctionParameterIdentifier
int NewFunctionParameterIdentifier(PSCRIPT_ENGINE_TOKEN Token)
Definition
script-engine.c:4514
NewGlobalIdentifier
int NewGlobalIdentifier(PSCRIPT_ENGINE_TOKEN PTOKEN)
Allocates a new global variable and returns the integer assigned to it.
Definition
script-engine.c:4404
PushSymbol
PSYMBOL_BUFFER PushSymbol(PSYMBOL_BUFFER SymbolBuffer, const PSYMBOL Symbol)
Gets a symbol and push it into the symbol buffer.
Definition
script-engine.c:3966
NewStringSymbol
PSYMBOL NewStringSymbol(PSCRIPT_ENGINE_TOKEN Token)
Allocates a new SYMBOL with string type and returns the reference to it.
Definition
script-engine.c:3692
SemanticRuleToInt
unsigned long long int SemanticRuleToInt(char *str)
Converts a sematinc rule token to integer.
Definition
script-engine.c:4232
NewLocalIdentifier
unsigned long long NewLocalIdentifier(PSCRIPT_ENGINE_TOKEN PTOKEN, unsigned int VariableSize)
Allocates a new local variable and returns the integer assigned to it.
Definition
script-engine.c:4457
GetGlobalIdentifierVariableType
VARIABLE_TYPE * GetGlobalIdentifierVariableType(PSCRIPT_ENGINE_TOKEN Token)
Definition
script-engine.c:4436
NewSymbol
PSYMBOL NewSymbol(void)
Allocates a new SYMBOL and returns the reference to it.
Definition
script-engine.c:3666
BooleanExpressionExtractEnd
UINT64 BooleanExpressionExtractEnd(char *str, BOOL *WaitForWaitStatementBooleanExpression, PSCRIPT_ENGINE_TOKEN CurrentIn)
Computes the boolean expression length starting from the current input position.
Definition
script-engine.c:3439
PseudoRegToInt
unsigned long long int PseudoRegToInt(char *str)
Converts pseudo register string to integer.
Definition
script-engine.c:4213
LalrIsOperandType
BOOL LalrIsOperandType(PSCRIPT_ENGINE_TOKEN PTOKEN)
Returns TRUE if the Token can be the operand of an operator.
Definition
script-engine.c:4592
NewWstringSymbol
PSYMBOL NewWstringSymbol(PSCRIPT_ENGINE_TOKEN Token)
Allocates a new SYMBOL with wstring type and returns the reference to it.
Definition
script-engine.c:3719
GetFunctionParameterIdentifier
int GetFunctionParameterIdentifier(PSCRIPT_ENGINE_TOKEN Token)
Definition
script-engine.c:4528
SetGlobalIdentifierVariableType
VOID SetGlobalIdentifierVariableType(PSCRIPT_ENGINE_TOKEN Token, VARIABLE_TYPE *VariableType)
Definition
script-engine.c:4417
ScriptEngineBooleanExpresssionParse
void ScriptEngineBooleanExpresssionParse(UINT64 BooleanExpressionSize, PSCRIPT_ENGINE_TOKEN FirstToken, PSCRIPT_ENGINE_TOKEN_LIST MatchedStack, PSYMBOL_BUFFER CodeBuffer, char *str, char *c, PSCRIPT_ENGINE_ERROR_TYPE Error)
LALR parser used for parsing boolean expression.
Definition
script-engine.c:3490
GetSymbolHeapSize
unsigned int GetSymbolHeapSize(PSYMBOL Symbol)
Returns the number of SYMBOL objects (24 bytes) allocated by string or wstring sybmol.
Definition
script-engine.c:3752
RemoveSymbol
void RemoveSymbol(PSYMBOL *Symbol)
Frees the memory allocate by this Symbol.
Definition
script-engine.c:3764
NewSymbolBuffer
PSYMBOL_BUFFER NewSymbolBuffer(void)
allocates a new Symbol Buffer and returns the reference to it
Definition
script-engine.c:3923
HandleError
char * HandleError(PSCRIPT_ENGINE_ERROR_TYPE Error, char *str)
Prints some information about the error.
Definition
script-engine.c:4252
GetGlobalIdentifierVal
int GetGlobalIdentifierVal(PSCRIPT_ENGINE_TOKEN PTOKEN)
Returns the integer assigned to global variable.
Definition
script-engine.c:4362
CodeGen
void CodeGen(PSCRIPT_ENGINE_TOKEN_LIST MatchedStack, PSYMBOL_BUFFER CodeBuffer, PSCRIPT_ENGINE_TOKEN Operator, PSCRIPT_ENGINE_ERROR_TYPE Error, char **ScriptSource)
Script Engine code generator.
Definition
script-engine.c:709
ToSymbol
PSYMBOL ToSymbol(PSCRIPT_ENGINE_TOKEN PTOKEN, PSCRIPT_ENGINE_ERROR_TYPE Error)
Converts Token to Symbol and returns the reference to it.
Definition
script-engine.c:3815
type.h
Variable type definitions for the script engine.
PSCRIPT_ENGINE_ERROR_TYPE
enum _SCRIPT_ENGINE_ERROR_TYPE * PSCRIPT_ENGINE_ERROR_TYPE
VARIABLE_TYPE
struct _VARIABLE_TYPE VARIABLE_TYPE
hyperdbg
script-engine
header
script-engine.h
Generated by
1.17.0