interpret local hwdbg scripts

This commit is contained in:
SinaKarvandi 2024-10-02 18:00:34 +02:00
parent 595a78f776
commit fe97da65b7
11 changed files with 400 additions and 7 deletions

View file

@ -22,6 +22,8 @@ extern UINT64 * g_ScriptGlobalVariables;
extern UINT64 * g_ScriptStackBuffer;
extern UINT64 g_CurrentExprEvalResult;
extern BOOLEAN g_CurrentExprEvalResultHasError;
extern UINT64 * g_HwdbgPinsStatus;
extern BOOLEAN g_HwdbgInstanceInfoIsValid;
//
// Temporary structures used only for testing
@ -711,6 +713,32 @@ ScriptEngineWrapperTestParser(const string & Expr)
free(AllocationsForCastings.Buff6);
}
/**
* @brief test parser for hwdbg
* @param Expr
*
* @return VOID
*/
VOID
ScriptEngineWrapperTestParserForHwdbg(const string & Expr)
{
if (!g_HwdbgPinsStatus)
{
g_HwdbgPinsStatus = (UINT64 *)malloc(MAX_HWDBG_TESTING_PIN_COUNT * sizeof(UINT64));
if (g_HwdbgPinsStatus == NULL)
{
ShowMessages("err, could not allocate memory for hwdbg pins status");
return;
}
RtlZeroMemory(g_HwdbgPinsStatus, MAX_HWDBG_TESTING_PIN_COUNT * sizeof(UINT64));
}
ScriptEngineEvalWrapper((PGUEST_REGS)g_HwdbgPinsStatus, Expr);
}
/**
* @brief In the local debugging (VMI mode) environment, this function computes the expressions
* @details for example, if the user u ExAllocatePoolWithTag+0x10 this will evaluate the expr