首页
社区
课程
招聘
大牛们~问个ssdt shadow驱动问题
发表于: 2011-6-1 16:33 4264

大牛们~问个ssdt shadow驱动问题

2011-6-1 16:33
4264
小弟刚接触ssdthook跟shadowhook~遇到点问题

看了sislcb大大的Hook Shadow SSDT文章

然后自己写的一个ssdthook

我想把两个合到一块

但是两个都定义了 ServiceDescriptorEntry

Hook Shadow SSDT的是
typedef struct ServiceDescriptorEntry {
        PVOID *ServiceTableBase;
        ULONG *ServiceCounterTableBase; //Used only in checked build
        ULONG NumberOfServices;
        PVOID *ParamTableBase;
} ServiceDescriptorTableEntry, *PServiceDescriptorTableEntry;

PServiceDescriptorTableEntry KeServiceDescriptorTableShadow;

SSDT的是
typedef struct ServiceDescriptorEntry {
        unsigned int *ServiceTableBase;
        unsigned int *ServiceCounterTableBase;
        unsigned int NumberOfServices;
        unsigned char *ParamTableBase;
} ServiceDescriptorTableEntry, *PServiceDescriptorTableEntry;
extern PServiceDescriptorTableEntry KeServiceDescriptorTable;

我改成
typedef struct ServiceDescriptorEntry {
        unsigned int *ServiceTableBase;
        unsigned int *ServiceCounterTableBase;
        unsigned int NumberOfServices;
        unsigned char *ParamTableBase;
} ServiceDescriptorTableEntry, *PServiceDescriptorTableEntry;
extern PServiceDescriptorTableEntry KeServiceDescriptorTable;
PServiceDescriptorTableEntry KeServiceDescriptorTableShadow;

编译报错提示
'KeServiceDescriptorTable' : 'ServiceDescriptorTableEntry' differs in levels of indirection from 'PServiceDescriptorTableEntry'

大牛们帮忙下

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (6)
雪    币: 111
活跃值: (25)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
2
SSDT的是
typedef struct ServiceDescriptorEntry {
unsigned int *ServiceTableBase;
unsigned int *ServiceCounterTableBase;
unsigned int NumberOfServices;
unsigned char *ParamTableBase;
} ServiceDescriptorTableEntry, *PServiceDescriptorTableEntry;
extern PServiceDescriptorTableEntry KeServiceDescriptorTable;


extern ServiceDescriptorTableEntry KeServiceDescriptorTable;
记得应该是这样吧,不需要再加一级指针了.没环境不能帮你测试下了.
2011-6-1 16:55
0
雪    币: 83
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
ULONG getShadowTable()
{
    KeServiceDescriptorTableShadow = (PServiceDescriptorTableEntry) getAddressOfShadowTable();

    if(KeServiceDescriptorTableShadow == NULL)
    {
        DbgPrint("hooker.sys: Couldnt find shadowtable!");
        
        return FALSE;
    }
    else
    {
        DbgPrint("hooker.sys: Shadowtable has been found!");
        
        DbgPrint("hooker.sys: Shadowtable entries: %d", KeServiceDescriptorTableShadow[1].NumberOfServices);
        return TRUE;
    }
}

需要用到KeServiceDescriptorTableShadow的
2011-6-1 17:13
0
雪    币: 1149
活跃值: (908)
能力值: ( LV13,RANK:260 )
在线值:
发帖
回帖
粉丝
4
http://bbs.pediy.com/showthread.php?t=42422   这个可以给你解决和扩展
2011-6-1 17:35
0
雪    币: 83
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5


两个总是有冲突。。。试了1天了
2011-6-2 03:23
0
雪    币: 111
活跃值: (25)
能力值: ( LV3,RANK:20 )
在线值:
发帖
回帖
粉丝
6
传源码我编译看看
2011-6-3 18:10
0
雪    币: 246
活跃值: (30)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
7
实验了下。我能编译。我vs2003 ,c++编译方式。
typedef struct ServiceDescriptorEntry {
  unsigned int *ServiceTableBase;
  unsigned int *ServiceCounterTableBase;
  unsigned int NumberOfServices;
  unsigned char *ParamTableBase;
} ServiceDescriptorTableEntry, *PServiceDescriptorTableEntry;
extern "C" PServiceDescriptorTableEntry KeServiceDescriptorTable;
PServiceDescriptorTableEntry KeServiceDescriptorTableShadow;
2011-6-4 21:11
0
游客
登录 | 注册 方可回帖
返回
//