|
|
|
|
|
[原创]娱乐,扩展一下ProcessNotify~~
好帖子,类似于地址总线扩展的概念,支持~~~ |
|
[讨论]学逆向前途
要看等级的,努力中...... |
|
[原创]MTK 手机BIN文件加密的一点心得
可怜的联发科技~~~ |
|
[建议]请问坛主能否开个汇编语言的板块
涵盖x86,ARM,51,Microchip PIC,TI DSP,......就比较拽了 |
|
[求助]你们一般聊天能聊多久?
谁扯淡比较厉害的,也发我点~~~ |
|
[求助]驱动里ZwQuerySystemInformation怎么调用啊?
__declspec(dllimport) ZWQUERYSYSTEMINFORMATION ZwQuerySystemInformation(........); |
|
[解决]晕啊,pspCidTable中的Object[解决代码见四楼]
Orz, 呵呵,大侠还是真身的好啊~~~ |
|
[解决]晕啊,pspCidTable中的Object[解决代码见四楼]
ULONG GetPspCidTable() /*++ 获取系统中未导出的pspCidTable --*/ { ULONG pAddr; ULONG Len; PUCHAR opcode; ULONG ulFunc = (ULONG)PsLookupProcessByProcessId; __try { // //如果是调试模式,需要计算一下真实位置 //用来校正jmp thunk // if(*(PUSHORT)PsLookupProcessByProcessId==0x25ff) { ulFunc = **(ULONG**)((ULONG)PsLookupProcessByProcessId+2); } //DbgPrint("[My1st] ulFunc: 0X&08X\n", ulFunc); for(pAddr=ulFunc; pAddr<ulFunc+0x60; pAddr+=Len) { Len = SizeOfCode((PUCHAR)pAddr, &opcode); if(!Len) { break; } if( *(PUSHORT)pAddr==0x35ff && *(PUCHAR)(pAddr+6)==0xe8 ) { return **(ULONG**)(opcode+2); } } return 0; } __except(1) { return 0; } } /*++ 通过进程的id,获取进程的EPROCESS结构 --*/ PEPROCESS GetProcessById(ULONG id) { PHANDLE_TABLE pspCidTable; ULONG Eprocess; ULONG* pEprocess; // //如果查找pspCidTable失败,直接返回NULL // pspCidTable = (PHANDLE_TABLE)GetPspCidTable(); if(!pspCidTable) { return NULL; } // //越界检查 // id &= 0xfffffffc; //忽略id的后两位 if(id>=pspCidTable->NextHandleNeedingPool) { return NULL; } // //由于pspCidTable只是一个简单的0级表,所以检索很容易 // pEprocess = (ULONG*)(pspCidTable->TableCode + id*2); if(!MmIsAddressValid(pEprocess)) //检查一下地址的有效性,参考KsBinSword的源代码,原来在内核中检查地址的函数是这个 { //同时感谢2楼 return NULL; } Eprocess = (*pEprocess) & 0xfffffffc; if(!MmIsAddressValid((PVOID)Eprocess)) { return NULL; } // //检查获取的对象是不是EPROCESS // if(*(UCHAR*)Eprocess==0x03 && *(ULONG*)(Eprocess+0x1a4)!=0) //&& ObReferenceObjectSafe((PVOID)Eprocess)) { return (PEPROCESS)Eprocess; } return NULL; } /*++ 通过线程的id,获取进程的ETHREAD结构 --*/ PETHREAD GetThreadById(ULONG id) { PHANDLE_TABLE pspCidTable; ULONG Ethread; ULONG* pEthread; // //如果查找pspCidTable失败,直接返回NULL // pspCidTable = (PHANDLE_TABLE)GetPspCidTable(); if(!pspCidTable) { return NULL; } // //越界检查 // id &= 0xfffffffc; //忽略id的后两位 if(id>=pspCidTable->NextHandleNeedingPool) { return NULL; } // //由于pspCidTable只是一个简单的0级表,所以检索很容易 // pEthread = (ULONG*)((pspCidTable->TableCode + id*2) & 0xfffffffc); if(!MmIsAddressValid(pEthread)) { return NULL; } Ethread = (*pEthread) & 0xfffffffc; if(!MmIsAddressValid((PVOID)Ethread)) { return NULL; } // //检查获取的对象是不是ETHREAD // if(*(UCHAR*)Ethread==0x06 && *(ULONG*)(Ethread+0x244)!=0) //&& ObReferenceObjectSafe((PVOID)Ethread)) { return (PETHREAD)Ethread; } return NULL; } /*++ 通过id,获取对象的指针 --*/ ULONG GetObjectById(ULONG id) { PHANDLE_TABLE pspCidTable; ULONG Eobject; ULONG* pEobject; // //如果查找pspCidTable失败,直接返回NULL // pspCidTable = (PHANDLE_TABLE)GetPspCidTable(); if(!pspCidTable) { return 0; } // //越界检查 // id &= 0xfffffffc; //忽略id的后两位 if(id>=pspCidTable->NextHandleNeedingPool) { return 0; } // //由于pspCidTable只是一个简单的0级表,所以检索很容易 // pEobject = (ULONG*)((pspCidTable->TableCode + id*2) & 0xfffffffc); if(!MmIsAddressValid(pEobject)) { return 0; } Eobject = (*pEobject) & 0xfffffffc; if(!MmIsAddressValid((PVOID)Eobject)) { return 0; } //if(ObReferenceObjectSafe((PVOID)Eobject)) //{ return Eobject; //} return 0; } void DisplayProcessNameById(ULONG id) { ULONG ulProcessName; ULONG ulProcess; ulProcess = (ULONG)GetProcessById(id); if(!ulProcess) { return; } ulProcessName = ulProcess + 0x174; //Windows XP dprintf("[My1st] %s\n", (PUCHAR)ulProcessName); } void EnumerateProcesses() { ULONG ulIte; for(ulIte=1;ulIte<0x800;ulIte++) { DisplayProcessNameById(ulIte<<2); } } 效果如下: [My1st] DriverEntry |
|
|
|
[半原创]贴点内核态中创建用户态进程的代码
支持一个!!! |
|
[推荐]《代码之美》获奖人名单
大牛您可是能选两本的啊。。。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值