博客
关于我
SSDT——框架编写与hook实例
阅读量:205 次
发布时间:2019-02-28

本文共 1424 字,大约阅读时间需要 4 分钟。

SSDT Hook??????????? .Net ??? MVC ?????????????? .cpp ? .h ???????????? API ?????????

SSDT ??????? Service Descriptor Table?SSDT????????????????????????????????????Hook?????????????? ServiceTableBase??????????????????????????

SSDT ??????????????

  • ServiceTableBase?SSDT ??????
  • ServiceCounterTableBase?????????????
  • NumberOfServices?SSDT ???????
  • ParamTableBase????????

??????????????????????????????cli????????? sti???????????????????Cr0 ?????????????????????????????????

???????????????

void PageProtectOff() {    __asm {        cli        mov eax, cr0        and eax, not 10000h        mov cr0, eax    }}

????????????????

void PageProtectOn() {    __asm {        mov eax, cr0        or eax, 10000h        mov cr0, eax        sti    }}

???Hook?????????????? SSDT ?????????????????????????????????

? OpenProcess ??????????????????????????? Hook ??????????????????????????????????????? OpenProcess ???

??? OpenProcess Hook ????????

NTSTATUS ssdt_hook() {    O_NtOpenProcess = KeServiceDescriptorTable.ServiceTableBase[122];    PageProtectOff();    KeServiceDescriptorTable.ServiceTableBase[122] = (unsigned int)MyNtOpenProcess;    PageProtectOn();    return STATUS_SUCCESS;}

MyNtOpenProcess ?????????????????????????? OpenProcess ????????????? ClientId ?????????????

CLIENT_ID ???????

typedef struct _CLIENT_ID {    HANDLE UniqueProcess;    HANDLE UniqueThread;} CLIENT_ID;

??????????????????? Hook ??????????????????????????????

转载地址:http://rzri.baihongyu.com/

你可能感兴趣的文章
Python 数据采集、清洗、整理、分析以及可视化实战
查看>>
Python 数据预处理
查看>>
Python 无法安装包
查看>>
python 日历小部件 - 返回用户选择的日期
查看>>
Python 日志管理封装
查看>>
python 时间函数小总结
查看>>
Python 是否优化尾递归?
查看>>
Python 更新set
查看>>
Python 最强 IDE 详细使用指南!
查看>>
Python 有一个不可变的列表吗?
查看>>
Python 机器学习入门之 pandas 的使用
查看>>
Python 机器学习实战
查看>>
python 杀死子进程_subprocess.popen.kill杀死所有子进程
查看>>
Python 条件语句与循环结构详解
查看>>
Python 条件运算符解决方法如何工作?
查看>>
python 枚举类型
查看>>
Python 查询 Mongodb数据库
查看>>
python 查询Neo4j多节点的多层关系
查看>>
python多处理参数:深拷贝?
查看>>
Python多处理使用队列写入同一个文件
查看>>