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.什么时候走进系统异常,什 ...
随机推荐
- DLL相关下断点
加载DLL 的时候断: sxe ld:[dll] 卸载DLL 的时候断: sxe ud:[dll] 比如: sxe ld:wininet.dll (在wininet.dll 被装载的时候断点) 这里 ...
- Window sevice +OWIN+webapi
webapi正常都托管在iis上,这里引入owin,将其托管在window服务上. 第一步:创建一个服务,这里就不多描述. 第二步:引入OWIN 2.1引入bll 2.2加入api路由配置 publi ...
- 用Jquery写返回顶部代码
<!DOCTYPE html><html><head><meta charset="utf-8" /><title>jq ...
- 尝试 zabbix 小记
server : Ubuntu 16.04 zabbix: 2.2.23源码包 安装 gcc,curl,make,snmp 软件和zabbix依赖一些php 扩展包 sudo apt-get inst ...
- SpringBatch批处理框架
1.前言:本博客是对于刘相SpringBatch批处理框架的学习 1.1.参考网站:https://docs.spring.io/spring-batch/4.2.x/reference/html/i ...
- excel破解工作簿与工作表保护
1.工作簿保护 1.1.使用压缩文件打开文件
- java在使用equals的时候一种习惯帮忙隔离大部分空指针
相同的一段代码: 所以,在平时编码的时候,尽量把需要比对的不为空的放在equal前面,比如判断 i 是否等于 1,那么使用 1.equals(i) 更为合适,在equals源码中 传入的是object ...
- window 下kafka 配置测试
1.准备工作 1.1 java环境 1.2 下载并解压到D:\zookeeper-3.4.13 下载并解压到 D:\kafka_2.12-2.1.0 2.安装zookeeper .kafka 我安装 ...
- XAMPP的安装及使用教程
https://blog.csdn.net/qq_36595013/article/details/80373597#3%E9%85%8D%E7%BD%AEapache
- python相关软件安装流程图解——linux 安装python3——Python-3.7.1
请先确保已经安装了虚拟机 python相关软件安装流程图解——虚拟机安装——CentOS-7-x86_64-DVD-1810——CentOS-01下载 https://www.cnblogs.com/ ...