博客
关于我
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/

你可能感兴趣的文章
PLC通讯方式
查看>>
PyTorch 的 10 条顶级知识点
查看>>
PS辅助工具Assistor PS
查看>>
pt-archiver 归档历史数据及参数详解
查看>>
Pytest框架环境切换实战教程!赶快收藏
查看>>
python - 将字符串中的日期与今天的日期进行比较
查看>>
python ctypes库中动态链接库加载方式
查看>>
python datetime笔记
查看>>
python day10
查看>>
python file
查看>>
Python FileDialog获取文件夹路径不是文件
查看>>
python filter过滤器的使用_python基础知识分享:zip()、filter函数和reduce如何使用?...
查看>>
python flask 请求code 400, message Bad request version
查看>>
Python Flink Stateful函数入口上的Kafka键访问
查看>>
Python float - str - 浮动怪异
查看>>
Python Flower库:分布式任务管理与监控
查看>>
Python for 循环和迭代器行为
查看>>
Python For循环多次返回
查看>>
Python ftplib - 指定端口
查看>>
Python furl库:一键搞定复杂URL操作
查看>>