1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| #include<windows.h>
LONG _stdcall RegVeh(PEXCEPTION_POINTERS ExceptionInfo);
int main() { PVOID handle = AddVectoredExceptionHandler(TRUE,RegVeh); _asm { xor eax,eax div eax } MessageBox(NULL,L"succ",L"WIN 7",MB_ICONINFORMATION); RemoveVectoredExceptionHandler(handle); return 0; } LONG _stdcall RegVeh(PEXCEPTION_POINTERS ExceptionInfo) { PCONTEXT pContext = ExceptionInfo->ContextRecord; pContext->Eip += 2; return EXCEPTION_CONTINUE_EXECUTION; }
|