用过cad的人都知道cad经常出现莫名的崩溃情况:
致命错误: Unhandled Access Violation Writing 0x0034 Exception at 14727a6h
很多时候是图纸问题造成的,只能说是程序设计不完善。当然新版的2013已经解决该类问题,但2008快很多,所以很多人也就将就用低版,甚至还有人在用2002-2006。
本着craker的精神,我想尝试改造cad的异常处理机制。我发现大部分出错均在类函数中,这里类指针ecx莫名指向0x0000000,我在想能不能程序出现异常时函数直接eax置0,返回上一层调用者。因为上一层调用者会判断函数执行是否成功,这样虽然命令无法执行,但也不致程序崩溃,导致损失严重。
这是其中一个SEH的代码,其实我对__try ,__ecept语句还不太熟识,不知道ExceptionContinueExecution能不能实现哦。
.text:623E4B20 push ebp
.text:623E4B21 mov ebp, esp
.text:623E4B23 and esp, 0FFFFFFF8h
.text:623E4B26 push 0FFFFFFFFh
.text:623E4B28 push offset sub_62726998
.text:623E4B2D mov eax, large fs:0
.text:623E4B33 push eax
.text:623E4B34 sub esp, 58h
.text:623E4B37 push ebx
.text:623E4B38 push esi
.text:623E4B39 push edi
.text:623E4B3A mov eax, ___security_cookie
.text:623E4B3F xor eax, esp
.text:623E4B41 push eax
.text:623E4B42 lea eax, [esp+74h+var_C]
.text:623E4B46 mov large fs:0, eax ;安装SEH
.text:62726998 ; 异常处理程序
.text:62726998 sub_62726998 proc near
.text:62726998 arg_4 = dword ptr 8
.text:62726998
.text:62726998 mov edx, [esp+arg_4]
.text:6272699C lea eax, [edx-64h]
.text:6272699F mov ecx, [edx-68h]
.text:627269A2 xor ecx, eax
.text:627269A4 call @__security_check_cookie@4 ; __security_check_cookie(x)
.text:627269A9 mov eax, offset unk_62811654
.text:627269AE jmp __CxxFrameHandler3
.text:627269AE sub_62726998 endp
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课