首页
社区
课程
招聘
[求助]Ring0列举每个进程路径
发表于: 2008-11-18 17:53 5033

[求助]Ring0列举每个进程路径

2008-11-18 17:53
5033
每个进程都有个EPROCESS,在这个结构里面保存了进程的大量的进程信息,请大侠们帮忙写个列举进程信息的程序(只要列举每个进程路径就行了)网上有这样的代码,可是在DRIVERENTRY中只能得到SYSTEM的信息,其他进程该怎么列举呢???????谢谢帮忙!!!!
PCWSTR GetCurrentProcessFileName()

{

       DWORD dwAddress = (DWORD)PsGetCurrentProcess();

       if(dwAddress == 0 || dwAddress == 0xFFFFFFFF)

              return NULL;

       dwAddress += 0x1B0;

       if((dwAddress = *(DWORD*)dwAddress) == 0) return 0;

       dwAddress += 0x10;

       if((dwAddress = *(DWORD*)dwAddress) == 0) return 0;

       dwAddress += 0x3C;

       if((dwAddress = *(DWORD*)dwAddress) == 0) return 0;

       KdPrint((“Current Process Full Path Name: %ws\n”,  (PCWSTR)dwAddress));

       return (PCWSTR)dwAddress;

}

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

收藏
免费 0
支持
分享
最新回复 (7)
雪    币: 182
活跃值: (12)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
help me!HELP!
2008-11-18 18:56
0
雪    币: 7651
活跃值: (523)
能力值: ( LV9,RANK:610 )
在线值:
发帖
回帖
粉丝
3
从system的EPROCESS开始遍历ActiveProcessLink就可以了嘛,进程路径可以从PEB里取,完整代码没时间写…
2008-11-18 19:07
0
雪    币: 182
活跃值: (12)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
我自己写了一下代码,怕蓝屏!!请大侠们帮忙检查!!!!!
#include<ntddk.h>

PCWSTR GetCurrentProcessFileName(DWORD dwAddress)

{

      

       if(dwAddress == 0 || dwAddress == 0xFFFFFFFF)

              return NULL;

       dwAddress += 0x1B0;

       if((dwAddress = *(DWORD*)dwAddress) == 0) return 0;

       dwAddress += 0x10;

       if((dwAddress = *(DWORD*)dwAddress) == 0) return 0;

       dwAddress += 0x3C;

       if((dwAddress = *(DWORD*)dwAddress) == 0) return 0;

       KdPrint((“Current Process Full Path Name: %ws\n”,  (PCWSTR)dwAddress));

       return (PCWSTR)dwAddress;

}

VOID CheckProcess()
{
DWORD eprocess;
DWORD activeprocesslink;
DWORD nextlink;
DWORD nexteprocess;

eprocess=(DWORD)PsGetCurrentProcess();
activeprocesslink=eprocess+0x088;
nextlink=*(DWORD*)activeprocesslink;
if(!nextlink)
{
return;
}
while(nextlink!=activeprocesslink)
{
nexteprocess=nextlink-0x088;

GetCurrentProcessFileName(nexteprocess);

nextlink=*(DWORD*)nextlink;

}

}

VOID
  DDKUnload(
    IN PDRIVER_OBJECT  DriverObject
    )
{

DbgPrint("UNloading.....");

}

NTSTATUS
  DriverEntry(
    IN PDRIVER_OBJECT  DriverObject,
    IN PUNICODE_STRING  RegistryPath
    )
{

DbgPrint("registrypath is: %S",RegistryPath->Buffer);
DriverObject->DriverUnload =DDKUnload;
CheckProcess();

return STATUS_SUCCESS;

}
2008-11-18 19:24
0
雪    币: 231
活跃值: (45)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
qdk
5
怕蓝屏就弄虚拟机。

不过有一回调试一个驱动,连虚拟机都挂了
2008-11-18 19:36
0
雪    币: 7651
活跃值: (523)
能力值: ( LV9,RANK:610 )
在线值:
发帖
回帖
粉丝
6
你怕蓝屏?这理由…那个别人就不怕了?写驱动就不要怕蓝
2008-11-18 21:01
0
雪    币: 170
活跃值: (90)
能力值: ( LV12,RANK:210 )
在线值:
发帖
回帖
粉丝
7
驱动是蓝出来的
2009-4-5 15:41
0
雪    币: 225
活跃值: (10)
能力值: ( LV5,RANK:60 )
在线值:
发帖
回帖
粉丝
8
光看你的代码,应该回蓝屏 ,你可以试试
2009-4-5 16:58
0
游客
登录 | 注册 方可回帖
返回
//