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.什么时候走进系统异常,什 ...
随机推荐
- linux下使用scp在服务器之间拷贝文件 (转载)
CentOS, 本地服务器,ip: 192.168.1.111Ubuntu, 远程服务器,ip: 192.168.1.112 1.拷贝远程服务器的目录到本地服务器远程服务器192.168.1.112上 ...
- selenium基础-图形验证码
selenium基础-图形验证码 一.图形验证码作用 设计的初衷其实就是为了防自动化,防止一些人利用自动工具恶意攻击网站 二.图形验证码是由客户端生成还是由服务器端生成的? 图形验证码是由服务器端生成 ...
- docker 挂载文件出错
docker不能挂载文件,只能挂载文件夹,所以先从一个容器中复制一份配置文件. docker run --name test -d idp docker cp test:/app/appsetting ...
- (十七)从UML角度来理解依赖
UML软件建模 什么是依赖?简单理解就是一个类A用到了类B,但是这种使用关系是偶然性的.临时性的.非常弱的,类B的变化会影响到类A 显示依赖与隐式依赖 依赖倒置:我们要依赖于高层业务,不依赖于低层业务 ...
- C#学习笔记----反射基础
反射基础 反射用于在程序运行过程中,获取类里面的信息或发现程序集并运行的一个过程.通过反射可以获得.dll和.exe后缀的程序集里面的信息.使用反射可以看到一个程序集内部的类,接口,字段,属性,方法, ...
- cmd命令符
运行操作 CMD命令:开始->运行->键入cmd或command(在命令行里可以看到系统版本.文件系统版本) CMD命令锦集 1. gpedit.msc-----组策略 2. ...
- LeetCode第九题—— Palindrome Number(判断回文数)
题目描述 Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same ...
- 暴力贪心+预处理自动机——cf990E
枚举每种灯管,然后找到代价最小的那种灯管 贪心策略:灯管从0开始向右放置,如果末尾是不能放置灯管的结点,那么要往回找到最近一个可以放置灯管的结点,在那里放置灯管 所以先预处理每个不能放置灯管的结点对应 ...
- Java 基础数据类型
Java 提供的基础数据类型(也称内置数据类型)包含:整数类型.浮点类型.字符类型.布尔类型. 整数类型 整数类型变量用来表示整数的数据类型.整数类型又分为字节型(byte).短整型(short).整 ...
- php 扫描url死链接 \033[31m ANSI Linux终端输出带颜色
* 从Packagist上搜索需要的包 https://packagist.org/ * 通过composer下载依赖包 composer require guzzlehttp/guzzlecompo ...