RasieException
RasieException是SEH API,SEH != 进内核,RasieException并不必然导致用户态内核态切换。事实上这个API被调用以后会首
先尝试在用户态进行处理,如果没有任何处理者可用,则直接调用ExitProcess退出进程,这个调用倒是要进内核。
Raising an exception causes the exception dispatcher to go through the following search for an exception handler:
1.The system first attempts to notify the process's debugger, if any.
2.If the process is not being debugged, or if the associated debugger does not handle the exception, the system attempts to locate a frame-based exception handler by searching the stack frames of the thread in which the exception occurred. The system searches
the current stack frame first, then proceeds backward through preceding stack frames.
3.If no frame-based handler can be found, or no frame-based handler handles the exception, the system makes a second attempt to notify the process's debugger.
4.If the process is not being debugged, or if the associated debugger does not handle the exception, the system provides default handling based on the exception type. For most exceptions, the default action is to call the ExitProcess function.
。
软件异常登记
软件异常是通过直接或者间接调用内核服务NtRaiseException而产生的。而用户态中可以通过RaiseException API,或者Try-catch等高级语言来调用这个内核服务,而通过RaiseException来登记软件异常的过程可以简单表述如下:
RaiseException在初始化一个EXCEPTION_RECORD结构体之后,开始调用NTDLL中的RtlRaiseException; RtlRaiseException在初始化CONTEXT结构体之后,开始调用内核中NtRaiseException, NtRaiseException再调用另外一个内核函数KiRaiseException。接下来KiRaiseException会调用KiDispatchException开始异常的分发。
如果是由 KiDispatchException 进行那4步处理的话,显然 Ki 前缀已经进内核态了。
RasieException的更多相关文章
- SEH结构
首先有几点问题 1.在后文中看到的PE的节中的配置信息表Load configuration是对SEH回调函数的注册,那么Exception Table是加载的什么信息. 2.什么时候走进系统异常,什 ...
随机推荐
- 【牛客提高训练营5B】旅游
题目 吉老师的题时过一年还是不会做 从\(1\)号点出发经过每条边至少一次并且还要回到\(1\)号点,这跟欧拉回路的条件非常像,但是欧拉回路的实际上是"经过每一条边恰好一次并且回到出发点&q ...
- USACO2005 City Skyline /// oj23401
题目大意: Input * Line 1: Two space separated integers: N and W * Lines 2..N+1: Two space separated inte ...
- **JLink Warning: Mis-aligned memory write: Address: 0x20000000, NumBytes: 2, Alignment: 2 (Halfword-aligned)
网上也有同学遇到这个问题,http://www.openedv.com/thread-113049-1-3.html 根据他的经验我也重新安装了Jlink驱动: 顺便注意Dialog DLL:TARM ...
- sparkStreaming结合SparkSql实例
SparkSQL结合SparkStreaming的使用 Flume+Kafka+SparkStreaming已经发展为一个比较成熟的实时日志收集与计算架构,利用Kafka,即可以支持将用于离线分析的数 ...
- PHP魔方解密
安装composer参考:https://www.runoob.com/w3cnote/composer-install-and-usage.html 常用的加密类型及特征 加密类型 加密特征 Zen ...
- 在Linux(centos)下,安装Apache和PHP环境
1001 ll /opt/lampp/modules/ 1002 history | grep httpd 1003 vim /etc/httpd/conf/httpd.conf 1004 v ...
- File转换为MultipartFile工具类
package cn.com.utils; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileu ...
- c++ strlen() 函数
{ char *buf = new char[1024]; ZeroMemory(buf,1024) for(int i = 0; i < 1023; i++) { buf[i] = '5'; ...
- 阿里云宣布 Serverless 容器服务 弹性容器实例 ECI 正式商业化
摘要: 阿里云宣布弹性容器实例 ECI(Elastic Container Instance)正式商业化,ECI 是阿里云践行普惠的云计算理念,将 Serverless 和 Container 技术结 ...
- tyvj 1194 划分大理石(多重背包)
传送门 解题思路 二进制优化多重背包裸题. 代码 #include<iostream> #include<cstdio> #include<cstring> #in ...