mirror of
https://github.com/HyperDbg/HyperDbg.git
synced 2026-08-25 08:22:58 +00:00
allocate buffer for temporary variables
This commit is contained in:
parent
84b93ef2a6
commit
22b17d1ac1
5 changed files with 53 additions and 11 deletions
|
|
@ -22,6 +22,7 @@
|
|||
//
|
||||
extern UINT64 * g_ScriptGlobalVariables;
|
||||
extern UINT64 * g_ScriptLocalVariables;
|
||||
extern UINT64 * g_ScriptTempVariables;
|
||||
|
||||
//
|
||||
// *********************** Pdb parse wrapper ***********************
|
||||
|
|
@ -285,6 +286,17 @@ ScriptEngineEvalWrapper(PGUEST_REGS GuestRegs,
|
|||
RtlZeroMemory(g_ScriptLocalVariables, MAX_VAR_COUNT * sizeof(UINT64));
|
||||
}
|
||||
|
||||
//
|
||||
// Allocate temp variables holder, actually in reality each core should
|
||||
// have its own set of temp variables but as we never run multi-core scripts
|
||||
// in user-mode, thus, it's okay to just have one buffer for temp variables
|
||||
//
|
||||
if (!g_ScriptTempVariables)
|
||||
{
|
||||
g_ScriptTempVariables = (UINT64 *)malloc(MAX_TEMP_COUNT * sizeof(UINT64));
|
||||
RtlZeroMemory(g_ScriptTempVariables, MAX_TEMP_COUNT * sizeof(UINT64));
|
||||
}
|
||||
|
||||
//
|
||||
// Run Parser
|
||||
//
|
||||
|
|
@ -295,9 +307,8 @@ ScriptEngineEvalWrapper(PGUEST_REGS GuestRegs,
|
|||
//
|
||||
//PrintSymbolBuffer(CodeBuffer);
|
||||
|
||||
UINT64 g_TempList[MAX_TEMP_COUNT] = {0};
|
||||
ACTION_BUFFER ActionBuffer = {0};
|
||||
SYMBOL ErrorSymbol = {0};
|
||||
ACTION_BUFFER ActionBuffer = {0};
|
||||
SYMBOL ErrorSymbol = {0};
|
||||
|
||||
if (CodeBuffer->Message == NULL)
|
||||
{
|
||||
|
|
@ -315,7 +326,7 @@ ScriptEngineEvalWrapper(PGUEST_REGS GuestRegs,
|
|||
//
|
||||
// Fill the variables list for this run
|
||||
//
|
||||
VariablesList.TempList = g_TempList;
|
||||
VariablesList.TempList = g_ScriptTempVariables;
|
||||
VariablesList.GlobalVariablesList = g_ScriptGlobalVariables;
|
||||
VariablesList.LocalVariablesList = g_ScriptLocalVariables;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue