type
status
date
slug
summary
tags
category
icon
password
保护模式
段
段寄存器
段寄存器结构
我们在OD当中查看段寄存器,上面显示32位,但真的是32位吗?

Intel白皮书介绍段寄存器结构为如下16位可见部分(selector),80位隐藏部分

对应结构图如下:

Win7 x86 R3 Segment
Segment | Selector | Base | limit | Attribute |
CS | 0x001B | 0 | 0xFFFFFFFF | 可读,可执行 |
DS | 0x0023 | 0 | 0xFFFFFFFF | 可读,可写 |
SS | 0x0023 | 0 | 0xFFFFFFFF | 可读,可写 |
ES | 0x0023 | 0 | 0xFFFFFFFF | 可读,可写 |
FS | 0x003B | 0x7FFDF000 | 0xFFF | 可读,可写 |
GS | - | - | - | - |
段寄存器的读写
读取段寄存器


写入段寄存器



段寄存器属性探测
我们在前面了解到了段寄存器的结构,它不仅有值还有属性

Attribute
我们拿cs这个段寄存器进行实验,因为的它是可读可执行,那我们先将cs的地址赋值为ax这个寄存器,然后让gs寄存器的地址指向cs寄存器
我们可以在这里设置断点,然后直接运行

正好验证CS寄存器是可读可执行,并且是不可写入的.

Base

limit
如果超过了限制大小会读取失败

📎 参考文章
有关学习上的问题,欢迎您在底部评论区留言,一起交流~
- Author:5m10v3
- URL:https://5m10v3.top/article/12b533f9-4e40-80bc-b8ab-e4321f687942
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!