MCH 3x: Small bug in GetCallingModule
Posted: Wed Apr 18, 2018 6:24 am
Hi,
I discovered small bug in your GetCallingModule function code (ModuleTools.cpp, 379).
This line should look like:
or like:
Otherwise it can lead to invalid memory access excetion. Thx for fixing it.
EaSy
I discovered small bug in your GetCallingModule function code (ModuleTools.cpp, 379).
Code: Select all
...
if ( ((*g_pHookCollection)[i].pCodeHook != NULL) &&
((*g_pHookCollection)[i].pCodeHook->mpInUseCodeArray != NULL) &&
(pReturnAddress >= (*g_pHookCollection)[i].pCodeHook->mpInUseCodeArray) &&
/*HERE----->*/ (pReturnAddress < (*g_pHookCollection)[i].pCodeHook->mpInUseCodeArray + IN_USE_COUNT * IN_USE_SIZE) )
{
...
Code: Select all
(pReturnAddress < ((BYTE*)(*g_pHookCollection)[i].pCodeHook->mpInUseCodeArray) + IN_USE_COUNT * IN_USE_SIZE) )
Code: Select all
(pReturnAddress < (*g_pHookCollection)[i].pCodeHook->mpInUseCodeArray + IN_USE_COUNT) )
EaSy