-
-
SEH异常捕获不了?
-
发表于:
2013-12-15 14:21
9086
-
win 7 64位系统下为什么捕获不了异常?访问异常直接崩溃
DWORD abcd;
EXCEPTION_DISPOSITION
__cdecl
_except_handler(struct _EXCEPTION_RECORD * ExceptionRecord,
void * EstablisherFrame,
struct _CONTEXT * ContextRecord,
void * DispatcherContext)
{
ContextRecord->Eax = (DWORD)&abcd;
return ExceptionContinueExecution;
}
int main()
{
DWORD handler = (DWORD)_except_handler;
__asm
{
push handler
push dword ptr fs:[0]
mov dword ptr fs:[0],esp
xor eax,eax
mov [eax],0 //异常
pop dword ptr fs:[0]
add esp,4
}
return 0;
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!