我在HOOK一个地方的时候通过写LOG可以看到有N次被记录下来,后来由于CRC的原因,由直接HOOK改为硬件断点HOOK,但这个时候写LOG的次数只有N/5次,可以很明显的看到大量的数据没有被HOOK下来
请大家帮忙看看问题出在哪,先谢谢了
代码大概如下:
LONG WINAPI ExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo)
{
if(ExceptionInfo->ExceptionRecord->ExceptionCode == EXCEPTION_SINGLE_STEP)
{
if((DWORD)ExceptionInfo->ExceptionRecord->ExceptionAddress == HookAddr)
{
PCONTEXT debug_context = ExceptionInfo->ContextRecord;
debug_context->Eip = (DWORD)&NakeWork;
return EXCEPTION_CONTINUE_EXECUTION;
}
}
return EXCEPTION_CONTINUE_SEARCH;
}
AddVectoredExceptionHandler(1, ExceptionFilter);
SuspendThread(hMainThread);
CONTEXT thread_context;
thread_context.ContextFlags = CONTEXT_DEBUG_REGISTERS;
GetThreadContext(hMainThread,&thread_context);
thread_context.ContextFlags = CONTEXT_DEBUG_REGISTERS;
thread_context.Dr0 = HookAddr;
thread_context.Dr7 = (1 << 0);
SetThreadContext(hMainThread, &thread_context);
ResumeThread(hMainThread);
CloseHandle(hMainThread);
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)