Catching opcode 0xCC as an exception
问题 Say a C program might trigger an exception of opcode 0xCC How can I catch it? I tried: __try { ...some code } __except(GetExceptionCode()==EXCEPTION_EXECUTE_HANDLER) { _tprintf(_T("Error\n"),i); return 0; } This is not working for me. What am I doing wrong? Thanks! 回答1: You're not checking for the right exception code. int 3 throws EXCEPTION_SINGLE_STEP . You handle it this way : __try { // some code that might cause an int3 } __except(GetExceptionCode() == EXCEPTION_SINGLE_STEP ? EXCEPTION