|
[原创]求一份C++实习的工作
好女人的名字 |
|
[分享]A盾电脑防护(原名 3600safe)anti-rootkit开放源代码
来个BIN吧,用2010写的吧,搞回08怪麻烦的 |
|
[原创]windbg查看E.KTHREAD,E.KPROCESS
dd !PsActiveProcessHead ETHREAD,EPROCESS ,KTHREAD,KPROCESS 一个进程创建了5个线程。。。 DWORD threadID; for (int i=0;i<5;i++) { CreateThread(0,0,(LPTHREAD_START_ROUTINE)thread,0,0,&threadID); char strBuffer[100]; sprintf(strBuffer,"%d",threadID); OutputDebugString(strBuffer); // OutputDebugString("%d",threadID); printf("%d\n",threadID); } return 0; PROCESS 89c70da0 SessionId: 0 Cid: 0648 Peb: 7ffdb000 ParentCid: 05cc DirBase: 0c800300 ObjectTable: e10905c8 HandleCount: 48. Image: multhread.exe kd> dt !_KPROCESS 89c70da0 ntdll!_KPROCESS +0x000 Header : _DISPATCHER_HEADER +0x010 ProfileListHead : _LIST_ENTRY [ 0x89c70db0 - 0x89c70db0 ] +0x018 DirectoryTableBase : [2] 0xc800300 +0x020 LdtDescriptor : _KGDTENTRY +0x028 Int21Descriptor : _KIDTENTRY +0x030 IopmOffset : 0x20ac +0x032 Iopl : 0 '' +0x033 Unused : 0 '' +0x034 ActiveProcessors : 0 +0x038 KernelTime : 0xd +0x03c UserTime : 5 +0x040 ReadyListHead : _LIST_ENTRY [ 0x89c70de0 - 0x89c70de0 ] +0x048 SwapListEntry : _SINGLE_LIST_ENTRY +0x04c VdmTrapcHandler : (null) +0x050 ThreadListHead : _LIST_ENTRY [ 0x89e6c798 - 0x89de7700 ] ThreadListHead进程中线程链表头 每一个结构都是_LIST_ENTRY kd> dd 0x89e6c798 对应 +0x050 ThreadListHead : _LIST_ENTRY [ 0x89e6c798 - 0x89de7700 ] 89e6c798 89de0550 89c70df0 00000000 00000000 kd> dd 89de0550 89de0550 89c71a60 89e6c798 00000000 00000000 kd> dd 89c71a60 89c71a60 89e5fe00 89de0550 00000000 00000000 kd> dd 89e5fe00 89e5fe00 89e6c4c0 89c71a60 00000000 00000000 kd> dd 89e6c4c0 89e6c4c0 89de7700 89e5fe00 00000000 00000000 kd> dd 89de7700 89de7700 89c70df0 89e6c4c0 00000000 00000000 kd> dd 89c70df0 对应 +0x050 ThreadListHead : _LIST_ENTRY [ 0x89e6c798 - 0x89de7700 ] 89c70df0 89e6c798 89de7700 00000000 00000001 上面这一个是头!!!,他89c70df0 是EPROCESS中的地址,并不代表一个KTHREAD 89c70df0 – 50 = 89c70da0 符合KPROCESS的地址 主线程加5个线程正好6个线程对应6个线程循环 这里是KTHREAD里面的ThreadListHead ETHREAD里面也有一个,同样的方式就能看到其实都是一一对应的 EPROCESS的0x190对应了ETHREAD链 +0x190 ThreadListHead : _LIST_ENTRY [ 0x89e6c814 - 0x89de777c ] kd> dd 0x89e6c814 _LIST_ENTRY [ 0x89e6c814 - 0x89de777c ] 89e6c814 89de05cc 89c70f30 00000000 00000000 kd> dd 89de05cc 89de05cc 89c71adc 89e6c814 00000000 00000000 kd> dd 89c71adc 89c71adc 89e5fe7c 89de05cc 00000000 00000000 kd> dd 89e5fe7c 89e5fe7c 89e6c53c 89c71adc 00000000 00000000 kd> dd 89e6c53c 89e6c53c 89de777c 89e5fe7c 00000000 00000000 kd> dd 89de777c 89de777c 89c70f30 89e6c53c 00000000 00000000 kd> dd 89c70f30 _LIST_ENTRY [ 0x89e6c814 - 0x89de777c ] 89c70f30 89e6c814 89de777c 00000000 bac8b300 这个同样是一个头,对应ETHREAD 89c70f30 - 190 = 89C70DA0完全符合啊 而且两者对应的差都是7C,符合EPROCESS中的偏移差 0x89e6c814 - 0x89e6c798 = 7C 89de05cc - 89de0550 7C ETHREAD的22C处放了LIST_ENTRY,通过某一个LIST_ENTRY的地址 减去22c 可以得到ETHREAD kd> dd 0x89e6c814 - 22c = 89E6C5E8 kd> dt !_ethread 89E6C5E8 中的1EC出存放了进程ID和线程ID kd> dd 89E6C5E8 +1ec = 89e6c7d4 89e6c7d4 00000648 0000033c 00050005 00000000 进程ID1608线程ID 828 , 符合!!!!!!!!! 换一个测试下 89e6c53c -22c = 89E6C310 89E6C310 +1ec = 89E6C4FC kd> dd 89E6C4FC 89e6c4fc 00000648 000000d4 00050005 00000000 同样的进程ID 212也是一个线程的ID 前面通过减去22C,利用KTHREAD的 减去 1b0 获取 0x89e6c798 - 1b0 = 89E6C5E8,不用计算就知道是一致了 |
|
[讨论]内核汇编获取调用进程名称
我调试了下,发现如果不加上push 0x30,pop fs,FS原来的值也是0x30,但是这样会蓝,不知道为什么 |
|
[讨论]windbg查看GDT。。
算了清楚了,这东西要用DB看才方便 kd> db 8003f000 8003f000 00 00 00 00 00 00 00 00-ff ff 00 00 00 9b cf 00 ................ 8003f010 ff ff 00 00 00 93 cf 00-ff ff 00 00 00 fb cf 00 ................ 8003f020 ff ff 00 00 00 f3 cf 00-ab 20 00 20 04 8b 00 80 ......... . .... 8003f030 01 00 00 f0 df 93 c0 ff-ff 0f 00 00 00 f3 40 00 ..............@. 8003f040 ff ff 00 04 00 f2 00 00-00 00 00 00 00 00 00 00 ................ 8003f050 68 00 80 af 54 89 00 80-68 00 e8 af 54 89 00 80 h...T...h...T... 8003f060 ff ff 40 2f 02 93 00 00-ff 3f 00 80 0b 92 00 00 ..@/.....?...... 8003f070 ff 03 00 70 ff 92 00 ff-ff ff 00 00 40 9a 00 80 ...p........@... f0000001 ffc093df 3 4 1 2 数字对照高低位顺序 对照了!!! 右到左蓝色的合起来 ff df f0 00 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值