我在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);
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!