Doesn't work MidHookRegisters.Store have this code:
Code:
mprotect(pBase, iSize);
fill_nop(pBase, iSize);
new MidHook(pBase, MidHookCB_IsVisible);
...
static stock void MidHookCB_IsVisible(MidHookRegisters hRegs)
{
hRegs.Store(DHookRegister_ESP, MASK_VISIBLE_AND_NPCS, 0x08);
}
Noping this part of code:
Code:
C7 44 24 08 81 60 00 02 mov dword ptr [esp+8], 2006081h
So, detour now:
Code:
0xf26013c6 <+694>: e9 09 48 8f fb jmp 0xedef5bd4
0xf26013cb <+699>: 90 nop
0xf26013cc <+700>: 90 nop
0xf26013cd <+701>: 90 nop
But when i try check esp+0x08 (used GDB)
Code:
x/wx $esp + 0x08
0xffff9198: 0x00000000
Via push ****
And set register value is good working order, example:
Code:
...
mprotect(pBase, iSize);
fill_nop(pBase, iSize);
StoreToAddress(pBase, 0x57, NumberType_Int8); // push edi
new MidHook(pBase, MidHookCB_IsVisible);
}
}
}
}
static stock void MidHookCB_IsVisible(MidHookRegisters hRegs)
{
hRegs.Set(DHookRegister_EDI, MASK_VISIBLE_AND_NPCS);
}