RandName Newbie cheater Reputation: 0
Joined: 19 Jun 2015 Posts: 22
|
Posted: Sun Jun 26, 2016 1:15 am Post subject: Hooking GetThreadContext ASM/Lua |
|
|
Hey folks,
I am trying to hook GetThreadContext, so that it always returns 'clean' Context Flags (Dr0 - Dr7).
I know how to do it in C++ but I didn't manage to do the same with ASM or Lua.
This would be the C++ equivalent:
Code: |
BOOL WINAPI hkGetThreadContext(
_In_ HANDLE hThread,
_Inout_ LPCONTEXT lpContext
) {
BOOL result = (*oGetThreadContext)(hThread, lpContext);
if (lpContext) {
lpContext->ContextFlags &= ~0x7F;
lpContext->Dr0 = 0;
lpContext->Dr1 = 0;
lpContext->Dr2 = 0;
lpContext->Dr3 = 0;
lpContext->Dr6 = 0;
lpContext->Dr7 = 0;
}
return result;
};
|
Does anyone of you know how to do it or alternatives with the same result?
Greetings,
Randshot
|
|