当前位置:网站首页>SYSCALL SWAPGS
SYSCALL SWAPGS
2022-07-30 16:56:00 【ma_de_hao_mei_le】
友链
references:
swapgs指令会将GS寄存器的值和MSR地址为C0000102H(IA32_KERNEL_GS_BASE)的值进行交换
当时用SYSCALL实现系统调用的时候,不存在内核栈空间,也不存在指向保存了内核栈空间内核结构的指针
因此,内核没办法去保存通用寄存器的值或者引用的内存里的值
关于为什么要保存通用寄存器或者内存里的值到栈里面请参考这篇文章:https://blog.csdn.net/ma_de_hao_mei_le/article/details/124604874
SWAPGS指令不需要任何操作数
在使用该指令之前不需要保存任何通用寄存器,
在交换完毕之后就可以使用GS作为段地址来访问内核结构了
尝试给nt!KiSystemCall64函数下断点,下完断点之后g直接导致虚拟机崩溃了

后来网上搜可一下
https://stackoverflow.com/questions/65367333/breakpoint-setting-in-ntkisystemcall64-not-working
说是因为该函数的前三条指令是用于设置内核栈空间的,内核调试需要先执行这三条指令来设置栈空间,也就是说这三条指令上面是不能下断点的,需要往后偏移
还有就是如果断点一直不被触发,有可能是因为目标机器上装了什么杀软导致的,卸载再尝试一下

从push 2B那条指令开始调试,也就是bp nt!KiSystemCall64+0x15
边栏推荐
猜你喜欢
随机推荐
23. Please talk about the difference between IO synchronization, asynchronous, blocking and non-blocking
华为云数据治理生产线DataArts,让“数据‘慧’说话”
DLCM - 基于列表上下文信息的重排序模型
Daily practice------Generate 13-digit bar, Ean-13 code rule: The thirteenth digit is the check code obtained by the calculation of the first twelve digits.
华为云数据治理生产线DataArts,让“数据'慧'说话”
探究CSAPP实验二-bomb lab-第一节
onenote使用
Gvim order record
【SOC】Classic output hello world
vivo announced to extend the product warranty period, the system launched a variety of functional services
Go新项目-编译热加载使用和对比,让开发更自由(3)
升级Win11后不喜欢怎么退回Win10系统?
大厂面试官眼中的好简历到底长啥样
04、Activity的基本使用
[NCTF2019]Fake XML cookbook-1|XXE漏洞|XXE信息介绍
Rounding out the most practical way of several DLL injection
数组和指针(2)
Mirror stand to collect
olap——入门ClickHouse
huato hot update environment construction (DLL method hot update C# code)






![[Geek Challenge 2020] Roamphp1-Welcome](/img/3b/2fa91f7478b8abf6efe0feafd24e58.png)


