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.什么时候走进系统异常,什 ...
随机推荐
- FCC知识点总结
1.DOMContentLoaded事件 2.延迟脚本 defer 3.异步脚本async 4.[找最长单词]—— 找出句子中最长的单词,并返回它的长度. 5.数组slice().splice() s ...
- sql count 函数用法
count(*) 会查询所有记录数,,包括为null值的数据: count(column)不会包含 column值为null的情况: count(1) 和 count(*)相同,,不同的是,,mysq ...
- .Net 动态编译(c# 脚本)
1 用.NET提供的类动态编译代码字符串,生成DLL存于内存中,加载到程序域 2 用反射的方式调用这个DLL 将要被编译和执行的代码读入并以字符串方式保存声明CSharpCodeProvider对象实 ...
- leetcood学习笔记-38-报数
---恢复内容开始--- 题目描述: 第一次提交: class Solution: def countAndSay(self, n: int) -> str: f = " for i ...
- scala 中List的简单使用
/** * scala 中List的使用 * */ object ListUse { def main(args: Array[String]): Unit = { def decorator(l:L ...
- PHP跨服务器提交数据
关于类似的问题,百度上一搜一大堆,这只是我自己实际用过的两个方法,不多BB直接上代码 1.第一种: 2.第二种 可以随意切换POST和GET提交方式
- OBJC依赖库管理利器cocoapods 安装及使用详细图解
cocoapods: github:https://github.com/CocoaPods/CocoaPods 官方网站:http://www.cocoapods.org/ 1.安装 RubyGem ...
- vue中export和export default的使用
1 export的使用 比喻index.js要使用test.js中的数据 首先在test.js文件中进行导出操作 在index.js文件进行导入操作 第一种方法: 此时的输出结果是: 注意: expo ...
- python元组与字典
一.元组 1.元组的表达 (1,2,3,4) ('olive',123) ("python",) 创建元组: a=tuple((1,2,3,)) b=("python&q ...
- ArrayList 和linkedList 插入比较
从学Java开始, 就一直大脑记着 arrayList 底层是数组 ,查询快, 插入慢, 有移动的动作.linkedList 底层链表, 插入快 查询慢,今天写了例子跑了跑, 果然. public ...