首页
社区
课程
招聘
win7下的MPspTerminateThreadByPointer....
发表于: 2010-1-24 11:55 4257

win7下的MPspTerminateThreadByPointer....

2010-1-24 11:55
4257
代码先贴上:
ULONG funAddr;
                PEPROCESS pEProc;
                ULONG pTempThread;
                ULONG pid=*(PULONG)pInputBuffer;
                *(PULONG)pOutputBuffer=0;
                ULONG pNextEntry, pListHead, pThNextEntry,pThListHead; 
                if (NT_SUCCESS(PsLookupProcessByProcessId((HANDLE)pid,&pEProc)))
                {
                    funAddr=(ULONG)GetKillFunAddr(FindPspTerminateThreadByPointer);
                    if (funAddr)
                    {
                        MPspTerminateThreadByPointer=(PSPTERMINATETHREADBYPOINTER)funAddr;
                        pThListHead=(ULONG)pEProc+GetOffset(ThreadListHead_OFFSET);
                        pThNextEntry=*(PULONG)pThListHead;
                        while(pThNextEntry!=pThListHead){
                            pTempThread=pThNextEntry-GetOffset(ThreadListEntry_OFFSET);
                            if (!(*(PDWORD)(pTempThread+GetOffset(Terminated_OFFSET))&1))
                            {
                                MPspTerminateThreadByPointer((PETHREAD)pTempThread,0);
                            }
                            pThNextEntry = *(PULONG)pThNextEntry;
                        }
                        *(PULONG)pOutputBuffer=1;
                    }
                }
                sizeofWrite = OutputBuffLength;
                break;

PspTerminateThreadByPointer在WIN7下也找到了,但有时结束线程时机子就挂了....各位大大请问是什么原因?

各偏移都是对的

刚学驱动,代码写的不是很好,请见谅.

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

收藏
免费 0
支持
分享
最新回复 (3)
雪    币: 0
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
thanks.......
2010-1-24 12:11
0
雪    币: 25
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
路过  看看 并非恶意灌水
2010-1-24 12:22
0
雪    币: 4
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
.......
2010-1-25 13:09
0
游客
登录 | 注册 方可回帖
返回
//