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.什么时候走进系统异常,什 ...
随机推荐
- uoj192 【UR #14】最强跳蚤
题目 和成爷达成一致,被卡随机的话就是过了 考虑一个完全平方数的所有质因子次幂一定是偶数,于是对于每一条边我们都只保留其出现次数为奇数的质因子 注意到有一个点的\(w\leq 80\),于是考虑状压质 ...
- 【洛谷】P1009阶乘之和
题目链接:https://www.luogu.org/problemnew/show/P1009 题意:给一个整数n(n<50),求$ \sum^{n}_{i=1} i! $ 题解:我..拿py ...
- [转]Visual Studio 各版本下载
原文地址:[置顶] Visual Studio 各版本下载 文件名称 文件大小 百度网盘下载 微软官方下载 Visual Studio 2015 Enterprise - 企业版 - 简体中文 3.8 ...
- JS 实现省市联动
使用 JavaScript 实现选择省份,后面联动改变成相应省份下的市 原理很简单: 首先创建两个select下拉框(省.市) 初始化的时候让省都显示出来,市为空 ................. ...
- Java 虚拟机 - GC机制
GC机制的一些总结 https://blog.csdn.net/super_qing_/article/details/85263991 https://blog.csdn.net/yhyr_ycy/ ...
- fiddler过滤其他网站请求
1.首先选择filters过滤器,之后选择使用,点击第二个下拉框选择只显示下方主机地址 2.填写需要过滤的IP或网址,点击Actions保存设置 3.最后就可以只抓取固定的数据包了.
- UML之类图、时序图、用例图 粗略版介绍
UML 概述 UML(Unified Modeling Language):统一(标准)建模语言,是一个支持模型化和软件系统开发的图形化语言,为软件开发的所有阶段提供模型化和可视化支持,包括由需求分析 ...
- 尚学python课程---13、python基础语法
尚学python课程---13.python基础语法 一.总结 一句话总结: legend2系统使我能够快速掌握一门语法,特别有用 pass 语句:空语句:是为了保持程序结构的完整性 :作用:比如: ...
- Arcmap中处理面图层中空白碎片
在面数据中,有时候在一个面要素中会出现碎片,而我们大多时候不希望这些碎片存在(图1),下面介绍通过Editor工具把这些碎片处理掉.
- PHP实现对短信验证码发送次数的限制
http://www.jb51.net/article/94878.htm 对用户获取短信验证码的手机号.ip.和浏览器(使用唯一标识)进行限制.本文介绍的方法是对用户每天只能通过同一浏览器或同一ip ...