标题的另类并非什么高新技术, 说白了仍是满大街的inline hook, 只不过它为解决可patch空间不足提供了一种有限的解决方案, 本文以32位windows系统的KiFastSystemCall为例.
简言之, KiFastSystemCall是ring3程序进入内核的入口, hook KiFastSystemCall一次即可拦截大部分系统调用, 有时候甚至可以避免被检测到,但是inline较繁琐, 除了需要维护堆栈平衡, 还可能遇到可patch空间不足的问题, IDA结果如下:
.text:7C92E510 ; =============== S U B R O U T I N E =======================================
.text:7C92E510
.text:7C92E510
.text:7C92E510 public KiFastSystemCall
.text:7C92E510 KiFastSystemCall proc near ; DATA XREF: .text:off_7C923428o
.text:7C92E510 mov edx, esp
.text:7C92E512 sysenter
.text:7C92E512 KiFastSystemCall end