Loading... ``` typedef struct _ServiceDescriptorTable { //System Service Dispatch Table的基地址 ULONG* ServiceTableBase; //SSDT中每个服务被调用次数的计数器。这个计数器一般由sysenter 更新。 ULONG* ServiceCounterTable; //由 ServiceTableBase 描述的服务的数目。 ULONG NumberOfServices; //每个系统服务参数字节数表的基地址-系统服务参数表SSPT UCHAR* ParamTableBase; }*PServiceDescriptorTable; //获取SSDT表指针 extern PServiceDescriptorTable KeServiceDescriptorTable; PServiceDescriptorTable g_ServiceDescriptorTable; ``` ``` //指针方式获取函数地址 LONG GetFunticonAddr(PServiceDescriptorTable ServiceDescriptorTable, LONG lgSsdtIndex) { LONG lSsdtAddr = 0; //获取SSDT基址 lSsdtAddr = (LONG)ServiceDescriptorTable->ServiceTableBase; //获取内核函数地址指针 PLONG plgSsdFunAddr = 0; plgSsdFunAddr = (PLONG)(lSsdtAddr + lgSsdtIndex * 4); //返回内核函数地址 return *plgSsdFunAddr; } //遍历SSDT NTSTATUS EnumFunctionSSDT(PDRIVER_OBJECT pDriverObj) { //SSDT表的范围 LONG lgSsdtNumber = -1; int i; UNICODE_STRING wsNtDllString; ULONG ulNtDllModuleBase = 0; //获取SSDT表的范围 lgSsdtNumber = KeServiceDescriptorTable->NumberOfServices; //虽说0x100但是最好以全0的结构体为结束项 KdPrint(("遍历SSDT\r\n")); for (i = 0; i < lgSsdtNumber; i++) { KdPrint(("Index:%04X--FunAddr:%08X\r\n", i, GetFunticonAddr(KeServiceDescriptorTable, i))); } return STATUS_SUCCESS; } ``` 最后修改:2021 年 03 月 16 日 © 允许规范转载 赞 0 如果觉得我的文章对你有用,请随意赞赏