-
-
[求助]请教一段驱动代码
-
发表于:
2013-11-25 23:13
5420
-
ProbeForWrite 这个函数
判断指针是否可写
我申请了一段内存,执行起来的时候怎么还会抛出异常?
哪里出错了?
VOID MyTryAndExcept()
{
__try
{
KdPrint(("Entry __try\r\n"));
PVOID p = ExAllocatePool(PagedPool, 900);
//判断指针是否可写,显然会导致异常
ProbeForWrite(p, 100, 4);
//如果不发生异常 就会执行到这里 并且不会知道到__except里面
KdPrint(("Leaving __try __except\r\n"));
if ( p )
{
ExFreePool(p);
}
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
//发生异常了 执行到这里
KdPrint(("catch the exception!...\r\n"));
}
}
[课程]Android-CTF解题方法汇总!