-
-
[讨论]DT了一下KPROCESS和EPROCESS
-
发表于: 2013-1-26 16:25 4014
-
前两天犯傻 一直在寻找直接获取KPROCESS的例程~~~
因为KeStackAttachProcess的第一个参数PKPROCESS
很不理解为什么这样就转换成功了!
今天用windbg看了一下~!我二了!我还特意看了WRK源码···我真是····
才发现EPROCESS第一个成员就是_KPROCESS
下面贴下数据
0: kd> dt _kprocess 851A2460
ntdll!_KPROCESS
+0x000 Header : _DISPATCHER_HEADER
+0x010 ProfileListHead : _LIST_ENTRY [ 0x851a2470 - 0x851a2470 ]
+0x018 DirectoryTableBase : [2] 0x5e00300
+0x020 LdtDescriptor : _KGDTENTRY
+0x028 Int21Descriptor : _KIDTENTRY
+0x030 IopmOffset : 0x20ac
+0x032 Iopl : 0 ''
+0x033 Unused : 0 ''
+0x034 ActiveProcessors : 0
+0x038 KernelTime : 0x13
+0x03c UserTime : 2
+0x040 ReadyListHead : _LIST_ENTRY [ 0x851a24a0 - 0x851a24a0 ]
+0x048 SwapListEntry : _SINGLE_LIST_ENTRY
+0x04c VdmTrapcHandler : (null)
+0x050 ThreadListHead : _LIST_ENTRY [ 0x853981d0 - 0x853981d0 ]
+0x058 ProcessLock : 0
+0x05c Affinity : 3
+0x060 StackCount : 1
+0x062 BasePriority : 8 ''
+0x063 ThreadQuantum : 6 ''
+0x064 AutoAlignment : 0 ''
+0x065 State : 0 ''
+0x066 ThreadSeed : 0 ''
+0x067 DisableBoost : 0 ''
+0x068 PowerState : 0 ''
+0x069 DisableQuantum : 0 ''
+0x06a IdealNode : 0 ''
+0x06b Flags : _KEXECUTE_OPTIONS
+0x06b ExecuteOptions : 0x32 '2'
0: kd> dt _eprocess 851A2460
ntdll!_EPROCESS
+0x000 Pcb : _KPROCESS //这家伙就在EPROCESS的第一个成员中
+0x06c ProcessLock : _EX_PUSH_LOCK
+0x070 CreateTime : _LARGE_INTEGER 0x1cdfb9c`969c2d60
+0x078 ExitTime : _LARGE_INTEGER 0x0
+0x080 RundownProtect : _EX_RUNDOWN_REF
+0x084 UniqueProcessId : 0x00000bd0
+0x088 ActiveProcessLinks : _LIST_ENTRY [ 0x805648b8 - 0x85358470 ]
+0x090 QuotaUsage : [3] 0x820
+0x09c QuotaPeak : [3] 0x9f0
+0x0a8 CommitCharge : 0x125
+0x0ac PeakVirtualSize : 0x142b000
+0x0b0 VirtualSize : 0x1427000
+0x0b4 SessionProcessLinks : _LIST_ENTRY [ 0xf79af014 - 0x8535849c ]
+0x0bc DebugPort : (null)
+0x0c0 ExceptionPort : 0xe16f2d00
+0x0c4 ObjectTable : 0xe1749e98 _HANDLE_TABLE
+0x0c8 Token : _EX_FAST_REF
+0x0cc WorkingSetLock : _FAST_MUTEX
+0x0ec WorkingSetPage : 0x23d5c
+0x0f0 AddressCreationLock : _FAST_MUTEX
+0x110 HyperSpaceLock : 0
+0x114 ForkInProgress : (null)
+0x118 HardwareTrigger : 0
+0x11c VadRoot : 0x8518ff28
+0x120 VadHint : 0x851f7eb8
+0x124 CloneRoot : (null)
+0x128 NumberOfPrivatePages : 0xa5
+0x12c NumberOfLockedPages : 0
+0x130 Win32Process : 0xe1a0a008
+0x134 Job : (null)
+0x138 SectionObject : 0xe10bff80
+0x13c SectionBaseAddress : 0x00400000
+0x140 QuotaBlock : 0x8566b5b8 _EPROCESS_QUOTA_BLOCK
+0x144 WorkingSetWatch : (null)
+0x148 Win32WindowStation : 0x00000030
+0x14c InheritedFromUniqueProcessId : 0x00000228
+0x150 LdtInformation : (null)
+0x154 VadFreeHint : (null)
+0x158 VdmObjects : (null)
+0x15c DeviceMap : 0xe1bfe2a8
+0x160 PhysicalVadList : _LIST_ENTRY [ 0x851a25c0 - 0x851a25c0 ]
+0x168 PageDirectoryPte : _HARDWARE_PTE_X86
+0x168 Filler : 0
+0x170 Session : 0xf79af000
+0x174 ImageFileName : [16] "DNF.exe"
+0x184 JobLinks : _LIST_ENTRY [ 0x0 - 0x0 ]
+0x18c LockedPagesList : (null)
+0x190 ThreadListHead : _LIST_ENTRY [ 0x8539824c - 0x8539824c ]
+0x198 SecurityPort : (null)
+0x19c PaeTop : 0xf7a52300
+0x1a0 ActiveThreads : 1
+0x1a4 GrantedAccess : 0x1f0fff
+0x1a8 DefaultHardErrorProcessing : 0x8000
+0x1ac LastThreadExitStatus : 0
+0x1b0 Peb : 0x7ffd6000 _PEB
+0x1b4 PrefetchTrace : _EX_FAST_REF
+0x1b8 ReadOperationCount : _LARGE_INTEGER 0x0
+0x1c0 WriteOperationCount : _LARGE_INTEGER 0x0
+0x1c8 OtherOperationCount : _LARGE_INTEGER 0x67
+0x1d0 ReadTransferCount : _LARGE_INTEGER 0x0
+0x1d8 WriteTransferCount : _LARGE_INTEGER 0x0
+0x1e0 OtherTransferCount : _LARGE_INTEGER 0x248
+0x1e8 CommitChargeLimit : 0
+0x1ec CommitChargePeak : 0x125
+0x1f0 AweInfo : (null)
+0x1f4 SeAuditProcessCreationInfo : _SE_AUDIT_PROCESS_CREATION_INFO
+0x1f8 Vm : _MMSUPPORT
+0x238 LastFaultCount : 0
+0x23c ModifiedPageCount : 0xcd
+0x240 NumberOfVads : 0x34
+0x244 JobStatus : 0
+0x248 Flags : 0xd0800
+0x248 CreateReported : 0y0
+0x248 NoDebugInherit : 0y0
+0x248 ProcessExiting : 0y0
+0x248 ProcessDelete : 0y0
+0x248 Wow64SplitPages : 0y0
+0x248 VmDeleted : 0y0
+0x248 OutswapEnabled : 0y0
+0x248 Outswapped : 0y0
+0x248 ForkFailed : 0y0
+0x248 HasPhysicalVad : 0y0
+0x248 AddressSpaceInitialized : 0y10
+0x248 SetTimerResolution : 0y0
+0x248 BreakOnTermination : 0y0
+0x248 SessionCreationUnderway : 0y0
+0x248 WriteWatch : 0y0
+0x248 ProcessInSession : 0y1
+0x248 OverrideAddressSpace : 0y0
+0x248 HasAddressSpace : 0y1
+0x248 LaunchPrefetched : 0y1
+0x248 InjectInpageErrors : 0y0
+0x248 VmTopDown : 0y0
+0x248 Unused3 : 0y0
+0x248 Unused4 : 0y0
+0x248 VdmAllowed : 0y0
+0x248 Unused : 0y00000 (0)
+0x248 Unused1 : 0y0
+0x248 Unused2 : 0y0
+0x24c ExitStatus : 259
+0x250 NextPageColor : 0x447a
+0x252 SubSystemMinorVersion : 0 ''
+0x253 SubSystemMajorVersion : 0x4 ''
+0x252 SubSystemVersion : 0x400
+0x254 PriorityClass : 0x2 ''
+0x255 WorkingSetAcquiredUnsafe : 0 ''
+0x258 Cookie : 0x975e55a0
因为KeStackAttachProcess的第一个参数PKPROCESS
很不理解为什么这样就转换成功了!
今天用windbg看了一下~!我二了!我还特意看了WRK源码···我真是····
才发现EPROCESS第一个成员就是_KPROCESS
下面贴下数据
0: kd> dt _kprocess 851A2460
ntdll!_KPROCESS
+0x000 Header : _DISPATCHER_HEADER
+0x010 ProfileListHead : _LIST_ENTRY [ 0x851a2470 - 0x851a2470 ]
+0x018 DirectoryTableBase : [2] 0x5e00300
+0x020 LdtDescriptor : _KGDTENTRY
+0x028 Int21Descriptor : _KIDTENTRY
+0x030 IopmOffset : 0x20ac
+0x032 Iopl : 0 ''
+0x033 Unused : 0 ''
+0x034 ActiveProcessors : 0
+0x038 KernelTime : 0x13
+0x03c UserTime : 2
+0x040 ReadyListHead : _LIST_ENTRY [ 0x851a24a0 - 0x851a24a0 ]
+0x048 SwapListEntry : _SINGLE_LIST_ENTRY
+0x04c VdmTrapcHandler : (null)
+0x050 ThreadListHead : _LIST_ENTRY [ 0x853981d0 - 0x853981d0 ]
+0x058 ProcessLock : 0
+0x05c Affinity : 3
+0x060 StackCount : 1
+0x062 BasePriority : 8 ''
+0x063 ThreadQuantum : 6 ''
+0x064 AutoAlignment : 0 ''
+0x065 State : 0 ''
+0x066 ThreadSeed : 0 ''
+0x067 DisableBoost : 0 ''
+0x068 PowerState : 0 ''
+0x069 DisableQuantum : 0 ''
+0x06a IdealNode : 0 ''
+0x06b Flags : _KEXECUTE_OPTIONS
+0x06b ExecuteOptions : 0x32 '2'
0: kd> dt _eprocess 851A2460
ntdll!_EPROCESS
+0x000 Pcb : _KPROCESS //这家伙就在EPROCESS的第一个成员中
+0x06c ProcessLock : _EX_PUSH_LOCK
+0x070 CreateTime : _LARGE_INTEGER 0x1cdfb9c`969c2d60
+0x078 ExitTime : _LARGE_INTEGER 0x0
+0x080 RundownProtect : _EX_RUNDOWN_REF
+0x084 UniqueProcessId : 0x00000bd0
+0x088 ActiveProcessLinks : _LIST_ENTRY [ 0x805648b8 - 0x85358470 ]
+0x090 QuotaUsage : [3] 0x820
+0x09c QuotaPeak : [3] 0x9f0
+0x0a8 CommitCharge : 0x125
+0x0ac PeakVirtualSize : 0x142b000
+0x0b0 VirtualSize : 0x1427000
+0x0b4 SessionProcessLinks : _LIST_ENTRY [ 0xf79af014 - 0x8535849c ]
+0x0bc DebugPort : (null)
+0x0c0 ExceptionPort : 0xe16f2d00
+0x0c4 ObjectTable : 0xe1749e98 _HANDLE_TABLE
+0x0c8 Token : _EX_FAST_REF
+0x0cc WorkingSetLock : _FAST_MUTEX
+0x0ec WorkingSetPage : 0x23d5c
+0x0f0 AddressCreationLock : _FAST_MUTEX
+0x110 HyperSpaceLock : 0
+0x114 ForkInProgress : (null)
+0x118 HardwareTrigger : 0
+0x11c VadRoot : 0x8518ff28
+0x120 VadHint : 0x851f7eb8
+0x124 CloneRoot : (null)
+0x128 NumberOfPrivatePages : 0xa5
+0x12c NumberOfLockedPages : 0
+0x130 Win32Process : 0xe1a0a008
+0x134 Job : (null)
+0x138 SectionObject : 0xe10bff80
+0x13c SectionBaseAddress : 0x00400000
+0x140 QuotaBlock : 0x8566b5b8 _EPROCESS_QUOTA_BLOCK
+0x144 WorkingSetWatch : (null)
+0x148 Win32WindowStation : 0x00000030
+0x14c InheritedFromUniqueProcessId : 0x00000228
+0x150 LdtInformation : (null)
+0x154 VadFreeHint : (null)
+0x158 VdmObjects : (null)
+0x15c DeviceMap : 0xe1bfe2a8
+0x160 PhysicalVadList : _LIST_ENTRY [ 0x851a25c0 - 0x851a25c0 ]
+0x168 PageDirectoryPte : _HARDWARE_PTE_X86
+0x168 Filler : 0
+0x170 Session : 0xf79af000
+0x174 ImageFileName : [16] "DNF.exe"
+0x184 JobLinks : _LIST_ENTRY [ 0x0 - 0x0 ]
+0x18c LockedPagesList : (null)
+0x190 ThreadListHead : _LIST_ENTRY [ 0x8539824c - 0x8539824c ]
+0x198 SecurityPort : (null)
+0x19c PaeTop : 0xf7a52300
+0x1a0 ActiveThreads : 1
+0x1a4 GrantedAccess : 0x1f0fff
+0x1a8 DefaultHardErrorProcessing : 0x8000
+0x1ac LastThreadExitStatus : 0
+0x1b0 Peb : 0x7ffd6000 _PEB
+0x1b4 PrefetchTrace : _EX_FAST_REF
+0x1b8 ReadOperationCount : _LARGE_INTEGER 0x0
+0x1c0 WriteOperationCount : _LARGE_INTEGER 0x0
+0x1c8 OtherOperationCount : _LARGE_INTEGER 0x67
+0x1d0 ReadTransferCount : _LARGE_INTEGER 0x0
+0x1d8 WriteTransferCount : _LARGE_INTEGER 0x0
+0x1e0 OtherTransferCount : _LARGE_INTEGER 0x248
+0x1e8 CommitChargeLimit : 0
+0x1ec CommitChargePeak : 0x125
+0x1f0 AweInfo : (null)
+0x1f4 SeAuditProcessCreationInfo : _SE_AUDIT_PROCESS_CREATION_INFO
+0x1f8 Vm : _MMSUPPORT
+0x238 LastFaultCount : 0
+0x23c ModifiedPageCount : 0xcd
+0x240 NumberOfVads : 0x34
+0x244 JobStatus : 0
+0x248 Flags : 0xd0800
+0x248 CreateReported : 0y0
+0x248 NoDebugInherit : 0y0
+0x248 ProcessExiting : 0y0
+0x248 ProcessDelete : 0y0
+0x248 Wow64SplitPages : 0y0
+0x248 VmDeleted : 0y0
+0x248 OutswapEnabled : 0y0
+0x248 Outswapped : 0y0
+0x248 ForkFailed : 0y0
+0x248 HasPhysicalVad : 0y0
+0x248 AddressSpaceInitialized : 0y10
+0x248 SetTimerResolution : 0y0
+0x248 BreakOnTermination : 0y0
+0x248 SessionCreationUnderway : 0y0
+0x248 WriteWatch : 0y0
+0x248 ProcessInSession : 0y1
+0x248 OverrideAddressSpace : 0y0
+0x248 HasAddressSpace : 0y1
+0x248 LaunchPrefetched : 0y1
+0x248 InjectInpageErrors : 0y0
+0x248 VmTopDown : 0y0
+0x248 Unused3 : 0y0
+0x248 Unused4 : 0y0
+0x248 VdmAllowed : 0y0
+0x248 Unused : 0y00000 (0)
+0x248 Unused1 : 0y0
+0x248 Unused2 : 0y0
+0x24c ExitStatus : 259
+0x250 NextPageColor : 0x447a
+0x252 SubSystemMinorVersion : 0 ''
+0x253 SubSystemMajorVersion : 0x4 ''
+0x252 SubSystemVersion : 0x400
+0x254 PriorityClass : 0x2 ''
+0x255 WorkingSetAcquiredUnsafe : 0 ''
+0x258 Cookie : 0x975e55a0
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
赞赏
他的文章
看原图
赞赏
雪币:
留言: