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的更多相关文章

  1. SEH结构

    首先有几点问题 1.在后文中看到的PE的节中的配置信息表Load configuration是对SEH回调函数的注册,那么Exception Table是加载的什么信息. 2.什么时候走进系统异常,什 ...

随机推荐

  1. Python骚操作(一)

    1. 交换变量值 2. 将列表中所有元素组合成字符串 3. 查找列表中频率最高的值 4. 检查连个字符串是不是由相同字母不同顺序组成 5. 反转字符串 6. 反转列表 7. 转置二维数组 8. 链式比 ...

  2. 【ARC072E】Alice in linear land

    题目 瑟瑟发抖,这竟然只是个蓝题 题意大概就是初始在\(0\),要到坐标为\(D\)的地方去,有\(n\)条指令,第\(i\)条为\(d_i\).当收到一条指令\(x\)后,如果向\(D\)方向走\( ...

  3. 字符串KMP算法

    讲解:http://blog.csdn.net/starstar1992/article/details/54913261 #include <bits/stdc++.h> using n ...

  4. 次梯度(Subgradient)

    参考链接:https://closure11.com/subgradient/

  5. java编程——数据的加法

    设计思想: 第一步:从键盘上输入一定个数的整数. 第二步:因为在main()方法中的参数是String类型的,所以第一步中输入的其实是字符类型,在这一步要把String转化成int. 第三步:初始化s ...

  6. 2018-8-10-win10-uwp-如何让一个集合按照需要的顺序进行排序

    title author date CreateTime categories win10 uwp 如何让一个集合按照需要的顺序进行排序 lindexi 2018-08-10 19:16:50 +08 ...

  7. JS函数 有参数的函数 参数可以多个,根据需要增减参数个数。参数之间用(逗号,)隔开

    有参数的函数 上节中add2()函数不能实现任意指定两数相加.其实,定义函数还可以如下格式: function 函数名(参数1,参数2) { 函数代码 } 注意:参数可以多个,根据需要增减参数个数.参 ...

  8. GoDaddy商务主机建站具有的优势

    GoDaddy是世界第一域名注册服务商,近年来凭借着优异的性能受到国内站长的欢迎,其中Godaddy商务主机得到了很多站长的喜爱,那么为什么GoDaddy商务主机可以受到那么多站长的喜爱呢?下面就带大 ...

  9. vagrant virtualbox 导入已导出的包和导出笔记

    导入 安装好virtualbox,vagrant软件之后, 将预先打包的 box 镜像导入到 vagrant 中 命令格式 vagrant box add <name> <boxpa ...

  10. Neo4j 因果集群搭建及neo4j-java-driver连接

    搭建Neo4j因果集群 1.下载企业版,当前是3,5,9版本 https://neo4j.com/download-center/#enterprise 2.配置,三个核心集群为例 配置文件,conf ...