|
HyperDbg Debugger
|
Go to the source code of this file.
Classes | |
| struct | _SCRIPT_ENGINE_TOKEN |
| read tokens from input stored in this structure More... | |
| struct | _SCRIPT_ENGINE_TOKEN_LIST |
| this structure is a dynamic container of TOKENS More... | |
| struct | _USER_DEFINED_FUNCTION_NODE |
| User-defined function linked list node. More... | |
| struct | _INCLUDE_NODE |
| Include file linked list node. More... | |
Macros | |
| #define | COMMON_H |
| #define | SYMBOL_BUFFER_INIT_SIZE 64 |
| #define | TOKEN_VALUE_MAX_LEN 8 |
| maximum length of string in the token | |
| #define | TOKEN_LIST_INIT_SIZE 256 |
| init size of token list | |
Typedefs | |
| typedef enum _SCRIPT_ENGINE_TOKEN_TYPE | SCRIPT_ENGINE_TOKEN_TYPE |
| enumerates possible types for token | |
| typedef struct _SCRIPT_ENGINE_TOKEN | SCRIPT_ENGINE_TOKEN |
| read tokens from input stored in this structure | |
| typedef struct _SCRIPT_ENGINE_TOKEN * | PSCRIPT_ENGINE_TOKEN |
| typedef struct _SCRIPT_ENGINE_TOKEN_LIST | SCRIPT_ENGINE_TOKEN_LIST |
| this structure is a dynamic container of TOKENS | |
| typedef struct _SCRIPT_ENGINE_TOKEN_LIST * | PSCRIPT_ENGINE_TOKEN_LIST |
| typedef struct _USER_DEFINED_FUNCTION_NODE | USER_DEFINED_FUNCTION_NODE |
| User-defined function linked list node. | |
| typedef struct _USER_DEFINED_FUNCTION_NODE * | PUSER_DEFINED_FUNCTION_NODE |
| typedef struct _INCLUDE_NODE | INCLUDE_NODE |
| Include file linked list node. | |
| typedef struct _INCLUDE_NODE * | PINCLUDE_NODE |
Enumerations | |
| enum | _SCRIPT_ENGINE_TOKEN_TYPE { LOCAL_ID , LOCAL_UNRESOLVED_ID , GLOBAL_ID , GLOBAL_UNRESOLVED_ID , DECIMAL , STATE_ID , HEX , OCTAL , BINARY , SPECIAL_TOKEN , KEYWORD , WHITE_SPACE , COMMENT , REGISTER , PSEUDO_REGISTER , NON_TERMINAL , SEMANTIC_RULE , END_OF_STACK , EPSILON , TEMP , STRING , WSTRING , FUNCTION_ID , FUNCTION_PARAMETER_ID , SCRIPT_VARIABLE_TYPE , DEFERENCE_TEMP , UNKNOWN } |
| enumerates possible types for token More... | |
Functions | |
| PSCRIPT_ENGINE_TOKEN | NewUnknownToken (void) |
| Allocates a new token. | |
| PSCRIPT_ENGINE_TOKEN | NewToken (SCRIPT_ENGINE_TOKEN_TYPE Type, char *Value) |
| Allocates a new token with given type and value. | |
| VOID | RemoveToken (PSCRIPT_ENGINE_TOKEN *Token) |
| Removes allocated memory of a token. | |
| VOID | PrintToken (PSCRIPT_ENGINE_TOKEN Token) |
| Prints token. | |
| VOID | AppendByte (PSCRIPT_ENGINE_TOKEN Token, CHAR c) |
| Appends char to the token value. | |
| VOID | AppendWchar (PSCRIPT_ENGINE_TOKEN Token, wchar_t c) |
| Appends wchar_t to the token value. | |
| PSCRIPT_ENGINE_TOKEN | CopyToken (PSCRIPT_ENGINE_TOKEN Token) |
| Copies a PTOKEN. | |
| PSCRIPT_ENGINE_TOKEN | NewTemp (PSCRIPT_ENGINE_ERROR_TYPE) |
| Allocates a new temporary variable and returns it. | |
| VOID | FreeTemp (PSCRIPT_ENGINE_TOKEN Temp) |
| Frees the memory allocated by Temp. | |
| VARIABLE_TYPE * | HandleType (PSCRIPT_ENGINE_TOKEN_LIST PtokenStack) |
| Return a variable type based on the token stack. | |
| VARIABLE_TYPE * | GetCommonVariableType (VARIABLE_TYPE *Ty1, VARIABLE_TYPE *Ty2) |
| Returns the common variable type between two types. | |
| PSCRIPT_ENGINE_TOKEN_LIST | NewTokenList (void) |
| Allocates a new SCRIPT_ENGINE_TOKEN_LIST. | |
| VOID | RemoveTokenList (PSCRIPT_ENGINE_TOKEN_LIST TokenList) |
| Removes allocated memory of a SCRIPT_ENGINE_TOKEN_LIST. | |
| VOID | PrintTokenList (PSCRIPT_ENGINE_TOKEN_LIST TokenList) |
| Prints each Token inside a TokenList. | |
| PSCRIPT_ENGINE_TOKEN_LIST | Push (PSCRIPT_ENGINE_TOKEN_LIST TokenList, PSCRIPT_ENGINE_TOKEN Token) |
| Adds Token to the last empty position of TokenList. | |
| PSCRIPT_ENGINE_TOKEN | Pop (PSCRIPT_ENGINE_TOKEN_LIST TokenList) |
| Removes last Token of a TokenList and returns it. | |
| PSCRIPT_ENGINE_TOKEN | Top (PSCRIPT_ENGINE_TOKEN_LIST TokenList) |
| Returns last Token of a TokenList. | |
| PSCRIPT_ENGINE_TOKEN | TopIndexed (PSCRIPT_ENGINE_TOKEN_LIST TokenList, int Index) |
| Returns the token at a specific index from the top of the token list. | |
| char | IsNoneTerminal (PSCRIPT_ENGINE_TOKEN Token) |
| Checks whether this Token is noneterminal NoneTerminal token starts with capital letter. | |
| char | IsSemanticRule (PSCRIPT_ENGINE_TOKEN Token) |
| Checks whether this Token is semantic rule SemanticRule token starts with '@'. | |
| char | IsEqual (const PSCRIPT_ENGINE_TOKEN Token1, const PSCRIPT_ENGINE_TOKEN Token2) |
| Checks whether the value and type of Token1 and Token2 are the same. | |
| int | GetNonTerminalId (PSCRIPT_ENGINE_TOKEN Token) |
| Gets the Non Terminal Id object. | |
| int | GetTerminalId (PSCRIPT_ENGINE_TOKEN Token) |
| Gets the Terminal Id object. | |
| int | LalrGetNonTerminalId (PSCRIPT_ENGINE_TOKEN Token) |
| Gets the Non Terminal Id object. | |
| int | LalrGetTerminalId (PSCRIPT_ENGINE_TOKEN Token) |
| Gets the Terminal Id object. | |
| char | IsHex (char c) |
| Checks whether input char belongs to hexadecimal digit-set or not. | |
| char | IsDecimal (char c) |
| Checks whether input char belongs to decimal digit-set or not. | |
| char | IsLetter (char c) |
| Checks whether input char belongs to alphabet set or not. | |
| char | IsUnderscore (char c) |
| Checks whether input char is underscore (_) or not. | |
| char | IsBinary (char c) |
| Checks whether input char belongs to binary digit-set or not. | |
| char | IsOctal (char c) |
| Checks whether input char belongs to octal digit-set or not. | |
| VOID | SetType (unsigned long long *Val, unsigned char Type) |
| Set the Type object. | |
| unsigned long long | DecimalToInt (char *str) |
| Converts an decimal string to a integer. | |
| unsigned long long | DecimalToSignedInt (char *str) |
| Converts an decimal string to a signed integer. | |
| unsigned long long | HexToInt (char *str) |
| Converts an hexadecimal string to integer. | |
| unsigned long long | OctalToInt (char *str) |
| Converts an octal string to integer. | |
| unsigned long long | BinaryToInt (char *str) |
| Converts a binary string to integer. | |
| VOID | RotateLeftStringOnce (char *str) |
| Rotate a character array to the left by one time. | |
| char | IsType1Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is OneOpFunc1. | |
| char | IsType2Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is OneOpFunc2. | |
| char | IsType4Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is VarArgFunc1. | |
| char | IsType5Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is ZeroOpFunc1. | |
| char | IsType6Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is TwoOpFunc1. | |
| char | IsType7Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is TwoOpFunc2. | |
| char | IsType8Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is ThreeOpFunc1. | |
| char | IsType9Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is OneOpFunc3. | |
| char | IsType10Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is TwoOpFunc3. | |
| char | IsType11Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is ThreeOpFunc3. | |
| char | IsType12Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is OneOpFunc4. | |
| char | IsType13Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is TwoOpFunc4. | |
| char | IsType14Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is ThreeOpFunc2. | |
| char | IsType15Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is ThreeOpFunc4. | |
| char | IsType16Func (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is ZeroOpFunc2. | |
| char | IsAssignmentOperator (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is assignment operator. | |
| char | IsTwoOperandOperator (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is OperatorsTwoOperandList. | |
| char | IsOneOperandOperator (PSCRIPT_ENGINE_TOKEN Operator) |
| Checks whether this Token type is OperatorsOneOperandList. | |
Common routines header
| #define COMMON_H |
| #define SYMBOL_BUFFER_INIT_SIZE 64 |
initial size of symbol buffer
| #define TOKEN_LIST_INIT_SIZE 256 |
init size of token list
| #define TOKEN_VALUE_MAX_LEN 8 |
maximum length of string in the token
| typedef struct _INCLUDE_NODE INCLUDE_NODE |
Include file linked list node.
| typedef struct _INCLUDE_NODE * PINCLUDE_NODE |
| typedef struct _SCRIPT_ENGINE_TOKEN * PSCRIPT_ENGINE_TOKEN |
| typedef struct _SCRIPT_ENGINE_TOKEN_LIST * PSCRIPT_ENGINE_TOKEN_LIST |
| typedef struct _USER_DEFINED_FUNCTION_NODE * PUSER_DEFINED_FUNCTION_NODE |
| typedef struct _SCRIPT_ENGINE_TOKEN SCRIPT_ENGINE_TOKEN |
read tokens from input stored in this structure
| typedef struct _SCRIPT_ENGINE_TOKEN_LIST SCRIPT_ENGINE_TOKEN_LIST |
this structure is a dynamic container of TOKENS
| typedef enum _SCRIPT_ENGINE_TOKEN_TYPE SCRIPT_ENGINE_TOKEN_TYPE |
enumerates possible types for token
| typedef struct _USER_DEFINED_FUNCTION_NODE USER_DEFINED_FUNCTION_NODE |
User-defined function linked list node.
enumerates possible types for token
| VOID AppendByte | ( | PSCRIPT_ENGINE_TOKEN | Token, |
| char | c ) |
Appends char to the token value.
| Token | |
| c | the character to append |
| VOID AppendWchar | ( | PSCRIPT_ENGINE_TOKEN | Token, |
| wchar_t | c ) |
Appends wchar_t to the token value.
| Token | |
| c | the wide character to append |
| unsigned long long BinaryToInt | ( | char * | str | ) |
Converts a binary string to integer.
| str | the binary string to convert |
| PSCRIPT_ENGINE_TOKEN CopyToken | ( | PSCRIPT_ENGINE_TOKEN | Token | ) |
Copies a PTOKEN.
| Token | the token to copy |
| unsigned long long DecimalToInt | ( | char * | str | ) |
Converts an decimal string to a integer.
| str | the decimal string to convert |
| unsigned long long DecimalToSignedInt | ( | char * | str | ) |
Converts an decimal string to a signed integer.
| str | the decimal string to convert |
| VOID FreeTemp | ( | PSCRIPT_ENGINE_TOKEN | Temp | ) |
Frees the memory allocated by Temp.
| Temp | the token representing the temporary variable |
| VARIABLE_TYPE * GetCommonVariableType | ( | VARIABLE_TYPE * | Ty1, |
| VARIABLE_TYPE * | Ty2 ) |
Returns the common variable type between two types.
| Ty1 | the first variable type |
| Ty2 | the second variable type |
| int GetNonTerminalId | ( | PSCRIPT_ENGINE_TOKEN | Token | ) |
Gets the Non Terminal Id object.
| Token | the token to get the non-terminal ID of |
| int GetTerminalId | ( | PSCRIPT_ENGINE_TOKEN | Token | ) |
Gets the Terminal Id object.
| Token | the token to get the terminal ID of |
| VARIABLE_TYPE * HandleType | ( | PSCRIPT_ENGINE_TOKEN_LIST | PtokenStack | ) |
Return a variable type based on the token stack.
| PtokenStack | the token stack containing type tokens |
| unsigned long long HexToInt | ( | char * | str | ) |
Converts an hexadecimal string to integer.
| str | the hexadecimal string to convert |
| char IsAssignmentOperator | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is assignment operator.
| Operator | the token to check |
| char IsBinary | ( | char | c | ) |
Checks whether input char belongs to binary digit-set or not.
| c | the character to check |
| char IsDecimal | ( | char | c | ) |
Checks whether input char belongs to decimal digit-set or not.
| c | the character to check |
| char IsEqual | ( | const PSCRIPT_ENGINE_TOKEN | Token1, |
| const PSCRIPT_ENGINE_TOKEN | Token2 ) |
Checks whether the value and type of Token1 and Token2 are the same.
| Token1 | the first token to compare |
| Token2 | the second token to compare |
| char IsHex | ( | char | c | ) |
Checks whether input char belongs to hexadecimal digit-set or not.
| c | the character to check |
| char IsLetter | ( | char | c | ) |
Checks whether input char belongs to alphabet set or not.
| c | the character to check |
| char IsNoneTerminal | ( | PSCRIPT_ENGINE_TOKEN | Token | ) |
| char IsOctal | ( | char | c | ) |
Checks whether input char belongs to octal digit-set or not.
| c | the character to check |
| char IsOneOperandOperator | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is OperatorsOneOperandList.
| Operator | the token to check |
| char IsSemanticRule | ( | PSCRIPT_ENGINE_TOKEN | Token | ) |
Checks whether this Token is semantic rule SemanticRule token starts with '@'.
| Token | the token to check |
| char IsTwoOperandOperator | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is OperatorsTwoOperandList.
| Operator | the token to check |
| char IsType10Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is TwoOpFunc3.
| Operator | the token to check |
| char IsType11Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is ThreeOpFunc3.
| Operator | the token to check |
| char IsType12Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is OneOpFunc4.
| Operator | the token to check |
| char IsType13Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is TwoOpFunc4.
| Operator | the token to check |
| char IsType14Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is ThreeOpFunc2.
| Operator | the token to check |
| char IsType15Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is ThreeOpFunc4.
| Operator | the token to check |
| char IsType16Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is ZeroOpFunc2.
| Operator | the token to check |
| char IsType1Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is OneOpFunc1.
| Operator | the token to check |
| char IsType2Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is OneOpFunc2.
| Operator | the token to check |
| char IsType4Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is VarArgFunc1.
| Operator | the token to check |
| char IsType5Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is ZeroOpFunc1.
| Operator | the token to check |
| char IsType6Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is TwoOpFunc1.
| Operator | the token to check |
| char IsType7Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is TwoOpFunc2.
| Operator | the token to check |
| char IsType8Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is ThreeOpFunc1.
| Operator | the token to check |
| char IsType9Func | ( | PSCRIPT_ENGINE_TOKEN | Operator | ) |
Checks whether this Token type is OneOpFunc3.
| Operator | the token to check |
| char IsUnderscore | ( | char | c | ) |
Checks whether input char is underscore (_) or not.
| c | the character to check |
| int LalrGetNonTerminalId | ( | PSCRIPT_ENGINE_TOKEN | Token | ) |
Gets the Non Terminal Id object.
| Token | the token to get the non-terminal ID of |
| int LalrGetTerminalId | ( | PSCRIPT_ENGINE_TOKEN | Token | ) |
Gets the Terminal Id object.
| Token | the token to get the terminal ID of |
| PSCRIPT_ENGINE_TOKEN NewTemp | ( | PSCRIPT_ENGINE_ERROR_TYPE | Error | ) |
Allocates a new temporary variable and returns it.
| Error | the error type pointer |
| PSCRIPT_ENGINE_TOKEN NewToken | ( | SCRIPT_ENGINE_TOKEN_TYPE | Type, |
| char * | Value ) |
Allocates a new token with given type and value.
| Type | the type of the token |
| Value | the value string of the token |
| PSCRIPT_ENGINE_TOKEN_LIST NewTokenList | ( | void | ) |
Allocates a new SCRIPT_ENGINE_TOKEN_LIST.
| PSCRIPT_ENGINE_TOKEN NewUnknownToken | ( | void | ) |
Allocates a new token.
| unsigned long long OctalToInt | ( | char * | str | ) |
Converts an octal string to integer.
| str | the octal string to convert |
| PSCRIPT_ENGINE_TOKEN Pop | ( | PSCRIPT_ENGINE_TOKEN_LIST | TokenList | ) |
Removes last Token of a TokenList and returns it.
| TokenList |
| VOID PrintToken | ( | PSCRIPT_ENGINE_TOKEN | Token | ) |
Prints token.
prints value and type of token
| Token | the token to print |
| VOID PrintTokenList | ( | PSCRIPT_ENGINE_TOKEN_LIST | TokenList | ) |
Prints each Token inside a TokenList.
| TokenList |
| PSCRIPT_ENGINE_TOKEN_LIST Push | ( | PSCRIPT_ENGINE_TOKEN_LIST | TokenList, |
| PSCRIPT_ENGINE_TOKEN | Token ) |
Adds Token to the last empty position of TokenList.
| TokenList | the token list to push into |
| Token | the token to add |
| VOID RemoveToken | ( | PSCRIPT_ENGINE_TOKEN * | Token | ) |
Removes allocated memory of a token.
| Token |
| VOID RemoveTokenList | ( | PSCRIPT_ENGINE_TOKEN_LIST | TokenList | ) |
Removes allocated memory of a SCRIPT_ENGINE_TOKEN_LIST.
| TokenList |
| VOID RotateLeftStringOnce | ( | char * | str | ) |
| VOID SetType | ( | unsigned long long * | Val, |
| unsigned char | Type ) |
Set the Type object.
| Val | |
| Type |
| PSCRIPT_ENGINE_TOKEN Top | ( | PSCRIPT_ENGINE_TOKEN_LIST | TokenList | ) |
Returns last Token of a TokenList.
| TokenList |
| PSCRIPT_ENGINE_TOKEN TopIndexed | ( | PSCRIPT_ENGINE_TOKEN_LIST | TokenList, |
| int | Index ) |
Returns the token at a specific index from the top of the token list.
| TokenList | the token list to index into |
| Index | the zero-based index from the top |