From 37b860362ea585a96b129b05bd30b0785dcd142e Mon Sep 17 00:00:00 2001 From: SinaKarvandi Date: Tue, 26 Oct 2021 22:28:32 +0330 Subject: [PATCH] add local variables environment for script engine --- .../script-engine-wrapper.cpp | 23 +- hyperdbg/hprdbgctrl/header/globals.h | 6 + hyperdbg/hprdbghv/code/common/Logging.c | 2 +- .../hprdbghv/code/debugger/core/Debugger.c | 53 ++- hyperdbg/hprdbghv/code/driver/Driver.c | 19 +- .../hprdbghv/header/debugger/core/Debugger.h | 1 + hyperdbg/include/ScriptEngineEval.h | 350 +++++++++--------- 7 files changed, 272 insertions(+), 182 deletions(-) diff --git a/hyperdbg/hprdbgctrl/code/debugger/script-engine-wrapper/script-engine-wrapper.cpp b/hyperdbg/hprdbgctrl/code/debugger/script-engine-wrapper/script-engine-wrapper.cpp index 098320b7..7d7005b6 100644 --- a/hyperdbg/hprdbgctrl/code/debugger/script-engine-wrapper/script-engine-wrapper.cpp +++ b/hyperdbg/hprdbgctrl/code/debugger/script-engine-wrapper/script-engine-wrapper.cpp @@ -22,6 +22,7 @@ // Global Variables // extern UINT64 * g_ScriptGlobalVariables; +extern UINT64 * g_ScriptLocalVariables; // // *********************** Pdb parse wrapper *********************** @@ -247,6 +248,8 @@ VOID ScriptEngineEvalWrapper(PGUEST_REGS GuestRegs, string Expr) { + SCRIPT_ENGINE_VARIABLES_LIST VariablesList = {0}; + // // Allocate global variables holder // @@ -256,6 +259,17 @@ ScriptEngineEvalWrapper(PGUEST_REGS GuestRegs, RtlZeroMemory(g_ScriptGlobalVariables, MAX_VAR_COUNT * sizeof(UINT64)); } + // + // Allocate local variables holder, actually in reality each core should + // have its own set of local variables but as we never run multi-core scripts + // in user-mode, thus, it's okay to just have one buffer for local variables + // + if (!g_ScriptLocalVariables) + { + g_ScriptLocalVariables = (UINT64 *)malloc(MAX_VAR_COUNT * sizeof(UINT64)); + RtlZeroMemory(g_ScriptLocalVariables, MAX_VAR_COUNT * sizeof(UINT64)); + } + // // Run Parser // @@ -283,10 +297,17 @@ ScriptEngineEvalWrapper(PGUEST_REGS GuestRegs, ActionBuffer.ImmediatelySendTheResults = FALSE; ActionBuffer.Tag = NULL; + // + // Fill the variables list for this run + // + VariablesList.TempList = g_TempList; + VariablesList.GlobalVariablesList = g_ScriptGlobalVariables; + VariablesList.LocalVariablesList = g_ScriptLocalVariables; + // // If has error, show error message and abort. // - if (ScriptEngineExecute(GuestRegs, ActionBuffer, (UINT64 *)g_TempList, (UINT64 *)g_ScriptGlobalVariables, CodeBuffer, &i, &ErrorSymbol) == TRUE) + if (ScriptEngineExecute(GuestRegs, ActionBuffer, &VariablesList, CodeBuffer, &i, &ErrorSymbol) == TRUE) { CHAR NameOfOperator[MAX_FUNCTION_NAME_LENGTH] = {0}; diff --git a/hyperdbg/hprdbgctrl/header/globals.h b/hyperdbg/hprdbgctrl/header/globals.h index 0e38a17b..aa4d9ced 100644 --- a/hyperdbg/hprdbgctrl/header/globals.h +++ b/hyperdbg/hprdbgctrl/header/globals.h @@ -261,6 +261,12 @@ CommandType g_CommandsList; */ UINT64 * g_ScriptGlobalVariables; +/** + * @brief Holder of local variables for script engine + * + */ +UINT64 * g_ScriptLocalVariables; + /** * @brief Is list of command initialized * diff --git a/hyperdbg/hprdbghv/code/common/Logging.c b/hyperdbg/hprdbghv/code/common/Logging.c index b91d30ed..75a1295a 100644 --- a/hyperdbg/hprdbghv/code/common/Logging.c +++ b/hyperdbg/hprdbghv/code/common/Logging.c @@ -717,7 +717,7 @@ LogPrepareAndSendMessageToQueue(UINT32 OperationCode, BOOLEAN IsImmediateMessage // Append time with previous message // SprintfResult = sprintf_s(LogMessage, PacketChunkSize - 1, "(%s - core : %d - vmx-root? %s)\t %s", TimeBuffer, KeGetCurrentProcessorNumberEx(0), IsVmxRootMode ? "yes" : "no", TempMessage); - + // // Check if the buffer passed the limit // diff --git a/hyperdbg/hprdbghv/code/debugger/core/Debugger.c b/hyperdbg/hprdbghv/code/debugger/core/Debugger.c index caa10091..9a22efd9 100644 --- a/hyperdbg/hprdbghv/code/debugger/core/Debugger.c +++ b/hyperdbg/hprdbghv/code/debugger/core/Debugger.c @@ -38,6 +38,10 @@ DebuggerGetRegValueWrapper(PGUEST_REGS GuestRegs, UINT32 /* REGS_ENUM */ RegId) BOOLEAN DebuggerInitialize() { + UINT32 ProcessorCount; + + ProcessorCount = KeQueryActiveProcessorCount(0); + // // Allocate buffer for saving events // @@ -124,6 +128,31 @@ DebuggerInitialize() // RtlZeroMemory(g_ScriptGlobalVariables, MAX_VAR_COUNT * sizeof(UINT64)); + // + // Intialize the local variables + // + for (size_t i = 0; i < ProcessorCount; i++) + { + if (!g_GuestState[i].DebuggingState.ScriptEngineCoreSpecificLocalVariable) + { + g_GuestState[i].DebuggingState.ScriptEngineCoreSpecificLocalVariable = + ExAllocatePoolWithTag(NonPagedPool, MAX_VAR_COUNT * sizeof(UINT64), POOLTAG); + } + + if (!g_GuestState[i].DebuggingState.ScriptEngineCoreSpecificLocalVariable) + { + // + // Out of resource, initialization of script engine's local varialbe holders failed + // + return FALSE; + } + + // + // Zero the local variables memory + // + RtlZeroMemory(g_GuestState[i].DebuggingState.ScriptEngineCoreSpecificLocalVariable, MAX_VAR_COUNT * sizeof(UINT64)); + } + // // Initialize the stepping mechanism // (USER-MODE STEPPING IS NOT SUPPORTED IN THIS VERSION) @@ -524,10 +553,6 @@ DebuggerAddActionToEvent(PDEBUGGER_EVENT Event, DEBUGGER_EVENT_ACTION_TYPE_ENUM BOOLEAN DebuggerRegisterEvent(PDEBUGGER_EVENT Event) { - UINT32 ProcessorCount; - - ProcessorCount = KeQueryActiveProcessorCount(0); - // // Register the event // @@ -1020,9 +1045,10 @@ DebuggerPerformRunScript(UINT64 Tag, PGUEST_REGS Regs, PVOID Context) { - SYMBOL_BUFFER CodeBuffer = {0}; - ACTION_BUFFER ActionBuffer = {0}; - SYMBOL ErrorSymbol = {0}; + SYMBOL_BUFFER CodeBuffer = {0}; + ACTION_BUFFER ActionBuffer = {0}; + SYMBOL ErrorSymbol = {0}; + SCRIPT_ENGINE_VARIABLES_LIST VariablesList = {0}; if (Action != NULL) { @@ -1068,6 +1094,13 @@ DebuggerPerformRunScript(UINT64 Tag, UINT64 g_TempList[MAX_TEMP_COUNT] = {0}; + // + // Fill the variables list for this run + // + VariablesList.TempList = g_TempList; + VariablesList.GlobalVariablesList = g_ScriptGlobalVariables; + VariablesList.LocalVariablesList = g_GuestState[6].DebuggingState.ScriptEngineCoreSpecificLocalVariable; + for (int i = 0; i < CodeBuffer.Pointer;) { // @@ -1075,8 +1108,7 @@ DebuggerPerformRunScript(UINT64 Tag, // if (ScriptEngineExecute(Regs, ActionBuffer, - (UINT64 *)g_TempList, - (UINT64 *)g_ScriptGlobalVariables, + &VariablesList, &CodeBuffer, &i, &ErrorSymbol) == TRUE) @@ -1703,13 +1735,10 @@ DebuggerRemoveAllActionsFromEvent(PDEBUGGER_EVENT Event) BOOLEAN DebuggerRemoveEvent(UINT64 Tag) { - UINT32 ProcessorCount; PDEBUGGER_EVENT Event; PLIST_ENTRY TempList = 0; PLIST_ENTRY TempList2 = 0; - ProcessorCount = KeQueryActiveProcessorCount(0); - // // First of all, we disable event // diff --git a/hyperdbg/hprdbghv/code/driver/Driver.c b/hyperdbg/hprdbghv/code/driver/Driver.c index cae95841..817d0d93 100644 --- a/hyperdbg/hprdbghv/code/driver/Driver.c +++ b/hyperdbg/hprdbghv/code/driver/Driver.c @@ -130,6 +130,9 @@ VOID DrvUnload(PDRIVER_OBJECT DriverObject) { UNICODE_STRING DosDeviceName; + UINT32 ProcessorCount; + + ProcessorCount = KeQueryActiveProcessorCount(0); RtlInitUnicodeString(&DosDeviceName, L"\\DosDevices\\HyperdbgHypervisorDevice"); IoDeleteSymbolicLink(&DosDeviceName); @@ -154,7 +157,21 @@ DrvUnload(PDRIVER_OBJECT DriverObject) // // Free g_ScriptGlobalVariables // - ExFreePoolWithTag(g_ScriptGlobalVariables, POOLTAG); + if (g_ScriptGlobalVariables != NULL) + { + ExFreePoolWithTag(g_ScriptGlobalVariables, POOLTAG); + } + + // + // Free core specific local variables + // + for (size_t i = 0; i < ProcessorCount; i++) + { + if (g_GuestState[i].DebuggingState.ScriptEngineCoreSpecificLocalVariable != NULL) + { + ExFreePoolWithTag(g_GuestState[i].DebuggingState.ScriptEngineCoreSpecificLocalVariable, POOLTAG); + } + } // // Free g_GuestState diff --git a/hyperdbg/hprdbghv/header/debugger/core/Debugger.h b/hyperdbg/hprdbghv/header/debugger/core/Debugger.h index bb9676c7..5979e6c0 100644 --- a/hyperdbg/hprdbghv/header/debugger/core/Debugger.h +++ b/hyperdbg/hprdbghv/header/debugger/core/Debugger.h @@ -123,6 +123,7 @@ typedef struct _PROCESSOR_DEBUGGING_STATE UINT16 InstructionLengthHint; PGUEST_REGS GuestRegs; UINT64 HardwareDebugRegisterForStepping; + UINT64 * ScriptEngineCoreSpecificLocalVariable; } PROCESSOR_DEBUGGING_STATE, PPROCESSOR_DEBUGGING_STATE; diff --git a/hyperdbg/include/ScriptEngineEval.h b/hyperdbg/include/ScriptEngineEval.h index 597ba508..d8fb8d94 100644 --- a/hyperdbg/include/ScriptEngineEval.h +++ b/hyperdbg/include/ScriptEngineEval.h @@ -131,6 +131,34 @@ typedef unsigned __int64 UINT64, *PUINT64; #define X86_FLAGS_RESERVED_BITS 0xffc38028 #define X86_FLAGS_FIXED 0x00000002 +#define LOWORD(l) ((WORD)(l)) +#define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF)) +#define LOBYTE(w) ((BYTE)(w)) +#define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF)) + +#define MAX_TEMP_COUNT 32 + +// TODO: Extract number of variables from input of ScriptEngine +// and allocate variableList Dynamically. +#define MAX_VAR_COUNT 512 + +#define MAX_FUNCTION_NAME_LENGTH 32 + +////////////////////////////////////////////////// +// Structures // +////////////////////////////////////////////////// + +/** + * @brief List of different variables + */ +typedef struct _SCRIPT_ENGINE_VARIABLES_LIST +{ + UINT64 * TempList; + UINT64 * GlobalVariablesList; + UINT64 * LocalVariablesList; + +} SCRIPT_ENGINE_VARIABLES_LIST, *PSCRIPT_ENGINE_VARIABLES_LIST; + /** * @brief Integer gp registers (this structure is defined in * two places, make sure to change it in two places) @@ -160,19 +188,6 @@ typedef struct _GUEST_REGS } GUEST_REGS, *PGUEST_REGS; #endif -#define LOWORD(l) ((WORD)(l)) -#define HIWORD(l) ((WORD)(((DWORD)(l) >> 16) & 0xFFFF)) -#define LOBYTE(w) ((BYTE)(w)) -#define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF)) - -#define MAX_TEMP_COUNT 32 - -// TODO: Extract number of variables from input of ScriptEngine -// and allocate variableList Dynamically. -#define MAX_VAR_COUNT 512 - -#define MAX_FUNCTION_NAME_LENGTH 32 - ////////////////////////////////////////////////// // Imports // ////////////////////////////////////////////////// @@ -216,12 +231,11 @@ __declspec(dllimport) VOID // Definition // UINT64 -GetValue(PGUEST_REGS GuestRegs, - ACTION_BUFFER ActionBuffer, - UINT64 * g_TempList, - UINT64 * g_VariableList, - PSYMBOL Symbol, - BOOLEAN ReturnReference); +GetValue(PGUEST_REGS GuestRegs, + ACTION_BUFFER ActionBuffer, + SCRIPT_ENGINE_VARIABLES_LIST * VariablesList, + PSYMBOL Symbol, + BOOLEAN ReturnReference); // // *** Pseudo registers *** // @@ -1470,16 +1484,15 @@ ApplyStringFormatSpecifier(const CHAR * CurrentSpecifier, CHAR * FinalBuffer, PU } VOID -ScriptEngineFunctionPrintf(PGUEST_REGS GuestRegs, - ACTION_BUFFER ActionDetail, - UINT64 * g_TempList, - UINT64 * g_VariableList, - UINT64 Tag, - BOOLEAN ImmediateMessagePassing, - char * Format, - UINT64 ArgCount, - PSYMBOL FirstArg, - BOOLEAN * HasError) +ScriptEngineFunctionPrintf(PGUEST_REGS GuestRegs, + ACTION_BUFFER ActionDetail, + SCRIPT_ENGINE_VARIABLES_LIST * VariablesList, + UINT64 Tag, + BOOLEAN ImmediateMessagePassing, + char * Format, + UINT64 ArgCount, + PSYMBOL FirstArg, + BOOLEAN * HasError) { // // The printf function @@ -1512,7 +1525,7 @@ ScriptEngineFunctionPrintf(PGUEST_REGS GuestRegs, memcpy(&TempSymbol, Symbol, sizeof(SYMBOL)); TempSymbol.Type &= 0x7fffffff; - Val = GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, &TempSymbol, FALSE); + Val = GetValue(GuestRegs, ActionDetail, VariablesList, &TempSymbol, FALSE); CHAR PercentageChar = Format[Position]; @@ -2667,21 +2680,20 @@ GetPseudoRegValue(PSYMBOL Symbol, ACTION_BUFFER ActionBuffer) } UINT64 -GetValue(PGUEST_REGS GuestRegs, - ACTION_BUFFER ActionBuffer, - UINT64 * g_TempList, - UINT64 * g_VariableList, - PSYMBOL Symbol, - BOOLEAN ReturnReference) +GetValue(PGUEST_REGS GuestRegs, + ACTION_BUFFER ActionBuffer, + SCRIPT_ENGINE_VARIABLES_LIST * VariablesList, + PSYMBOL Symbol, + BOOLEAN ReturnReference) { switch (Symbol->Type) { case SYMBOL_ID_TYPE: if (ReturnReference) - return ((UINT64)(&g_VariableList[Symbol->Value])); + return ((UINT64)(&VariablesList->GlobalVariablesList[Symbol->Value])); else - return g_VariableList[Symbol->Value]; + return VariablesList->GlobalVariablesList[Symbol->Value]; case SYMBOL_NUM_TYPE: @@ -2707,9 +2719,9 @@ GetValue(PGUEST_REGS GuestRegs, case SYMBOL_TEMP_TYPE: if (ReturnReference) - return ((UINT64)&g_TempList[Symbol->Value]); + return ((UINT64)&VariablesList->TempList[Symbol->Value]); else - return g_TempList[Symbol->Value]; + return VariablesList->TempList[Symbol->Value]; } } @@ -3729,15 +3741,15 @@ SetRegValue(PGUEST_REGS GuestRegs, PSYMBOL Symbol, UINT64 Value) } VOID -SetValue(PGUEST_REGS GuestRegs, UINT64 * g_TempList, UINT64 * g_VariableList, PSYMBOL Symbol, UINT64 Value) +SetValue(PGUEST_REGS GuestRegs, SCRIPT_ENGINE_VARIABLES_LIST * VariablesList, PSYMBOL Symbol, UINT64 Value) { switch (Symbol->Type) { case SYMBOL_ID_TYPE: - g_VariableList[Symbol->Value] = Value; + VariablesList->GlobalVariablesList[Symbol->Value] = Value; return; case SYMBOL_TEMP_TYPE: - g_TempList[Symbol->Value] = Value; + VariablesList->TempList[Symbol->Value] = Value; return; case SYMBOL_REGISTER_TYPE: SetRegValue(GuestRegs, Symbol, Value); @@ -3778,7 +3790,12 @@ ScriptEngineGetOperatorName(PSYMBOL OperatorSymbol, CHAR * BufferForName) } BOOL -ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * g_TempList, UINT64 * g_VariableList, PSYMBOL_BUFFER CodeBuffer, int * Indx, PSYMBOL ErrorOperator) +ScriptEngineExecute(PGUEST_REGS GuestRegs, + ACTION_BUFFER ActionDetail, + SCRIPT_ENGINE_VARIABLES_LIST * VariablesList, + PSYMBOL_BUFFER CodeBuffer, + int * Indx, + PSYMBOL ErrorOperator) { PSYMBOL Operator; PSYMBOL Src0; @@ -3814,14 +3831,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); @@ -3829,7 +3846,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * DesVal = ScriptEngineFunctionEd(SrcVal1, SrcVal0, &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -3838,14 +3855,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); @@ -3853,7 +3870,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * DesVal = ScriptEngineFunctionEb(SrcVal1, SrcVal0, &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -3862,14 +3879,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); @@ -3877,7 +3894,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * DesVal = ScriptEngineFunctionEq(SrcVal1, SrcVal0, &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -3886,21 +3903,21 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = ScriptEngineFunctionInterlockedExchange((volatile long long *)&SrcVal1, SrcVal0, &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -3909,14 +3926,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); @@ -3924,7 +3941,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * DesVal = ScriptEngineFunctionInterlockedExchangeAdd((volatile long long *)SrcVal1, SrcVal0, &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -3933,21 +3950,21 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Src2 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal2 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); @@ -3955,7 +3972,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * DesVal = ScriptEngineFunctionInterlockedCompareExchange((volatile long long *)SrcVal2, SrcVal1, SrcVal0, &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -3964,14 +3981,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); ScriptEngineFunctionSpinlockLockCustomWait((volatile long *)SrcVal1, SrcVal0, &HasError); @@ -3989,21 +4006,21 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 | SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4012,13 +4029,13 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); DesVal = SrcVal0 + 1; Des = Src0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4027,13 +4044,13 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); DesVal = SrcVal0 - 1; Des = Src0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4042,21 +4059,21 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 ^ SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4065,21 +4082,21 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 & SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4088,21 +4105,21 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 >> SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4111,21 +4128,21 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 << SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4134,20 +4151,20 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 + SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4156,20 +4173,20 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 - SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; case FUNC_MUL: @@ -4177,20 +4194,20 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 * SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4199,13 +4216,13 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); @@ -4218,7 +4235,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * DesVal = SrcVal1 / SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; case FUNC_MOD: @@ -4226,13 +4243,13 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); @@ -4243,7 +4260,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * return HasError; } DesVal = SrcVal1 % SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4252,20 +4269,20 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 > SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4274,20 +4291,20 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 < SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4296,20 +4313,20 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 >= SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4318,20 +4335,20 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 <= SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4341,20 +4358,20 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 == SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4363,20 +4380,20 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal1 != SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4385,15 +4402,15 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; - DesVal = ScriptEngineKeywordPoi((PUINT64)GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE), + DesVal = ScriptEngineKeywordPoi((PUINT64)GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE), &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4402,15 +4419,15 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; - DesVal = ScriptEngineKeywordDb((PUINT64)GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE), + DesVal = ScriptEngineKeywordDb((PUINT64)GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE), &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; case FUNC_DW: @@ -4418,15 +4435,15 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; - DesVal = ScriptEngineKeywordDb((PUINT64)GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE), + DesVal = ScriptEngineKeywordDb((PUINT64)GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE), &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; case FUNC_DQ: @@ -4434,15 +4451,15 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; - DesVal = ScriptEngineKeywordDq((PUINT64)GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE), + DesVal = ScriptEngineKeywordDq((PUINT64)GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE), &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4451,14 +4468,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = ~SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4470,14 +4487,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * // // It's reference, we need an address // - SrcVal0 = GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, TRUE); + SrcVal0 = GetValue(GuestRegs, ActionDetail, VariablesList, Src0, TRUE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4486,7 +4503,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); @@ -4517,7 +4534,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * #endif // SCRIPT_ENGINE_USER_MODE - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4526,14 +4543,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = ScriptEngineFunctionStrlen((const char *)SrcVal0); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4542,14 +4559,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = ScriptEngineFunctionWcslen((const wchar_t *)SrcVal0); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4558,14 +4575,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = ScriptEngineFunctionInterlockedIncrement((volatile long long *)SrcVal0, &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4574,14 +4591,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = ScriptEngineFunctionInterlockedDecrement((volatile long long *)SrcVal0, &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4590,14 +4607,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = -(INT64)SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4606,15 +4623,15 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; - DesVal = ScriptEngineKeywordHi((PUINT64)GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE), + DesVal = ScriptEngineKeywordHi((PUINT64)GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE), &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4623,15 +4640,15 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; - DesVal = ScriptEngineKeywordLow((PUINT64)GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE), + DesVal = ScriptEngineKeywordLow((PUINT64)GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE), &HasError); - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; case FUNC_MOV: @@ -4639,14 +4656,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Des = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; DesVal = SrcVal0; - SetValue(GuestRegs, g_TempList, g_VariableList, Des, DesVal); + SetValue(GuestRegs, VariablesList, Des, DesVal); return HasError; @@ -4655,7 +4672,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); // // Call the target function @@ -4670,7 +4687,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); // // Call the target function @@ -4686,7 +4703,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); // // Call the target function @@ -4700,7 +4717,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); // // Call the target function @@ -4714,7 +4731,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); ScriptEngineFunctionDisableEvent( ActionDetail.Tag, @@ -4727,7 +4744,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); ScriptEngineFunctionEnableEvent( ActionDetail.Tag, ActionDetail.ImmediatelySendTheResults, @@ -4740,7 +4757,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); // // Call the target function @@ -4757,13 +4774,13 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); if (SrcVal1 == 0) { @@ -4779,14 +4796,14 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); Src1 = (PSYMBOL)((unsigned long long)CodeBuffer->Head + (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal1 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src1, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src1, FALSE); if (SrcVal1 != 0) { @@ -4800,7 +4817,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * (unsigned long long)(*Indx * sizeof(SYMBOL))); *Indx = *Indx + 1; SrcVal0 = - GetValue(GuestRegs, ActionDetail, g_TempList, g_VariableList, Src0, FALSE); + GetValue(GuestRegs, ActionDetail, VariablesList, Src0, FALSE); *Indx = SrcVal0; @@ -4837,8 +4854,7 @@ ScriptEngineExecute(PGUEST_REGS GuestRegs, ACTION_BUFFER ActionDetail, UINT64 * ScriptEngineFunctionPrintf( GuestRegs, ActionDetail, - g_TempList, - g_VariableList, + VariablesList, ActionDetail.Tag, ActionDetail.ImmediatelySendTheResults, (char *)&Src0->Value,