这口苦是什么原因引起的引起的

Re: 这是什么问题导致的? - 高端调试 :: 论坛
欢迎光临 高端调试
帖子排序:&
Oldest to newest
Newest to oldest
rainynight
这是什么问题导致的?
BugCheck 1000008E, {c52bd97, ada3db7c, 0}
Probably caused by : ntoskrnl.exe ( nt!CcGetLsnForFileObject+4f )
Followup: MachineOwner
kd& !analyze -v
Arguments:
Arg1: c0000005, The exception code that was not handled
Arg2: 8052bd97, The address that the exception occurred at
Arg3: ada3db7c, Trap Frame
Arg4:
Debugging Details:
------------------
EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - "0x%08lx"
FAULTING_IP:
nt!CcGetLsnForFileObject+4f
6af
repne scas word ptr es:[edi]
TRAP_FRAME:
ada3db7c -- (.trap 0xffffffffada3db7c)
ErrCode =
eax= ebx=076aff80 ecx=ffffffee edx=ada3dd18 esi=805d96b6 edi=076b0000
eip=8052bd97 esp=ada3dbf0 ebp=ada3dd30 iopl=0
nv up ei ng nz na pe cy
cs=0008
efl=
nt!CcGetLsnForFileObject+0x4f:
6af
repne scas word ptr es:[edi]
es:0=????
Resetting default scope
CUSTOMER_CRASH_COUNT:
DEFAULT_BUCKET_ID:
DRIVER_FAULT
BUGCHECK_STR:
PROCESS_NAME:
EXPLORER.EXE
LAST_CONTROL_TRANSFER:
to 8052bd97
STACK_TEXT:
ada3dd30 00a0c 00000 nt!CcGetLsnForFileObject+0x4f
ada3dd64 7c92e4f4 badb0d00 0352fc08 aedfad98 nt!PopRunDownSourceTargetList+0x10e
WARNING: Frame IP not in any known module. Following frames may be wrong.
ada3dd68 badb0d00 0352fc08 aedfad98 aedfadcc 0x7c92e4f4
ada3dd6c 0352fc08 aedfad98 aedfadcc xbadb0d00
ada3dd70 aedfad98 aedfadcc fc08
ada3dd74 aedfadcc 00 0xaedfad98
ada3dd78 00 xaedfadcc
STACK_COMMAND:
FOLLOWUP_IP:
nt!CcGetLsnForFileObject+4f
6af
repne scas word ptr es:[edi]
SYMBOL_STACK_INDEX:
SYMBOL_NAME:
nt!CcGetLsnForFileObject+4f
FOLLOWUP_NAME:
MachineOwner
MODULE_NAME: nt
IMAGE_NAME:
ntoskrnl.exe
DEBUG_FLR_IMAGE_TIMESTAMP:
FAILURE_BUCKET_ID:
0x8E_nt!CcGetLsnForFileObject+4f
BUCKET_ID:
0x8E_nt!CcGetLsnForFileObject+4f
Followup: MachineOwner
---------
IP 地址: 已记录&&
发 贴: 306
Re: 这是什么问题导致的?
首先,楼主是什么平台?我看了从 2000 到 Vista&平台,CcGetLsnForFileObject 函数的实现大致都是相同的。都是获取 BCB 链的自旋锁,分析脏页,释放锁。出错的指令是 F2 66 AF repne scas word ptr es:[edi]。这句是较为经典的字符串长度计算优化代码,一般用法如下:xor&&&& eax, eaxrepne&& scas byte ptr es:[edi]作用就是在 es:[edi] 字符串里查找 AL (AL此时为0),即寻找字符串的结束符,以计算长度。这个功能和 CcGetLsnForFileObject 函数的实现基本无关 (或者就是我分析的目标和楼主不是一个平台,您Win7?)我的第一个推断就是函数被 Patch 破坏了??导致产生了错误的指令?所以请楼主 u 一下您平台的 CcGetLsnForFileObject 函数,以进一步分析、定位错误。谢谢。
IP 地址: 已记录&&
rainynight
Re: 这是什么问题导致的?
我的平台是xp sp3
IP 地址: 已记录&&
发 贴: 306
Re: 这是什么问题导致的?
kd& u CcGetLsnForFileObjectnt!CcGetLsnForFileObject:8086d7ac 8bff&&&&&&&&&&& mov&&&& edi,edi8086d7ae 55&&&&&&&&&&&&& push&&& ebp8086d7af 8bec&&&&&&&&&&& mov&&&& ebp,esp 83ec1c&&&&&&&&& sub&&&& esp,1Ch 8b4508&&&&&&&&& mov&&&& eax,dword ptr [ebp+8]&&&&&&&& ; 取 FileObject 8b4014&&&&&&&&& mov&&&& eax,dword ptr [eax+14h]&&&&&& ; 取 FileObject-&SectionObjectPointer8086d7ba 33d2&&&&&&&&&&& xor&&&& edx,edx8086d7bc 56&&&&&&&&&&&&& push&&& esi8086d7bd 8b7004&&&&&&&&& mov&&&& esi,dword ptr [eax+4]&&&&&&&&&; 取 FileObject-&SectionObjectPointer-&SharedCacheMap 到 esi 33c0&&&&&&&&&&& xor&&&& eax,eax 3bf2&&&&&&&&&&& cmp&&&& esi,edx&&&&&&&&&&&&&&&&&&&&&&&; if(SharedCacheMap == NULL) 8945f8&&&&&&&&& mov&&&& dword ptr [ebp-8],eax&&&&&&&& ; Oldest.LowPart& = 0; (initialize lsn variables) 8955fc&&&&&&&&& mov&&&& dword ptr [ebp-4],edx&&&&&&&& ; Oldest.HighPart = 0; (initialize lsn variables)8086d7ca 8955f0&&&&&&&&& mov&&&& dword ptr [ebp-10h],edx&&&&&& ; Newest.LowPart& = 0; (initialize lsn variables)8086d7cd 8955f4&&&&&&&&& mov&&&& dword ptr [ebp-0Ch],edx&&&&&& ; Newest.HighPart = 0; (initialize lsn variables) 0f84a6000000&&& je&&&&& nt!CcGetLsnForFileObject+0xd0 (8086d87c) 57&&&&&&&&&&&&& push&&& edi 8d8eb8000000&&& lea&&&& ecx,[esi+0B8h]8086d7dd 8d55e4&&&&&&&&& lea&&&& edx,[ebp-1Ch] ff15d4108080&&& call&&& dword ptr [nt!_imp_KeAcquireInStackQueuedSpinLock ()];; FASTCALL :;; KeAcquireInStackQueuedSpinLock(&SharedCacheMap-&BcbSpinLock, &LockHandle);;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& |&&&&&&&&&&&&&&&&&&&&&&&&&&&& |;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& |&&&&&&&&&&&&&&&&&&&&&&&&&&&& +-- [ebp-1Ch];&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& +-- [esi+0B8h] (这指针类型是 _SHARED_CACHE_MAP); 8d7e10&&&&&&&&& lea&&&& edi,[esi+10h]&&&&&& ; _SHARED_CACHE_MAP.BcbList (+0x010) 8b07&&&&&&&&&&& mov&&&& eax,dword ptr [edi] ; BcbList.Flink8086d7eb 83e810&&&&&&&&& sub&&&& eax,10h&&&&&&&&&&&& ; 取到 _BCB 的首指针8086d7ee 8d4810&&&&&&&&& lea&&&& ecx,[eax+10h]&&&&&& ; while (&Bcb-&BcbLinks != &SharedCacheMap-&BcbList) 3bcf&&&&&&&&&&& cmp&&&& ecx,edi&&&&&&&&&&&& ; 7465&&&&&&&&&&& je&&&&& nt!CcGetLsnForFileObject+0xae (8086d85a) 53&&&&&&&&&&&&& push&&& ebx &&&&& cmp&&&& word ptr [eax],2FDh8086d7fb 7550&&&&&&&&&&& jne&&&& nt!CcGetLsnForFileObject+0xa1 (8086d84d);; 显然 repne scas word ptr es:[edi] 是错误的指令,这句代码(F2 66 AF)根本不符合上下文语境。;8086d7fd &&&&&&& cmp&&&& byte ptr [eax+2],0a&&&&&&&&&&& je&&&&& nt!CcGetLsnForFileObject+0xa1 (8086d84d)b7020&&&&&&&&& mov&&&& esi,dword ptr [eax+20h]........
CcGetLsnForFileObject 函数内部相关数据结构:
kd& dt nt!_FILE_OBJECT&& +0x000 Type&&&&&&&&&&&& : Int2B&& +0x002 Size&&&&&&&&&&&& : Int2B&& +0x004 DeviceObject&&&& : Ptr32 _DEVICE_OBJECT&& +0x008 Vpb&&&&&&&&&&&&& : Ptr32 _VPB&& +0x00c FsContext&&&&&&& : Ptr32 Void&& +0x010 FsContext2&&&&&& : Ptr32 Void&&&+0x014 SectionObjectPointer : Ptr32 _SECTION_OBJECT_POINTERS&& +0x018 PrivateCacheMap& : Ptr32 Void&& +0x01c FinalStatus&&&&& : Int4B&& +0x020 RelatedFileObject : Ptr32 _FILE_OBJECT&& +0x024 LockOperation&&& : UChar&& +0x025 DeletePending&&& : UChar&& +0x026 ReadAccess&&&&&& : UChar&& +0x027 WriteAccess&&&&& : UChar&& +0x028 DeleteAccess&&&& : UChar&& +0x029 SharedRead&&&&&& : UChar&& +0x02a SharedWrite&&&&& : UChar&& +0x02b SharedDelete&&&& : UChar&& +0x02c Flags&&&&&&&&&&& : Uint4B&& +0x030 FileName&&&&&&&& : _UNICODE_STRING&& +0x038 CurrentByteOffset : _LARGE_INTEGER&& +0x040 Waiters&&&&&&&&& : Uint4B&& +0x044 Busy&&&&&&&&&&&& : Uint4B&& +0x048 LastLock&&&&&&&& : Ptr32 Void&& +0x04c Lock&&&&&&&&&&&& : _KEVENT&& +0x05c Event&&&&&&&&&&& : _KEVENT&& +0x06c CompletionContext : Ptr32 _IO_COMPLETION_CONTEXT
kd& dt nt!_SECTION_OBJECT_POINTERS&& +0x000 DataSectionObject : Ptr32 Void&&&+0x004 SharedCacheMap&& : Ptr32 Void&& +0x008 ImageSectionObject : Ptr32 Void
kd& dt nt!_SHARED_CACHE_MAP&& +0x000 NodeTypeCode&&&& : Int2B&& +0x002 NodeByteSize&&&& : Int2B&& +0x004 OpenCount&&&&&&& : Uint4B&& +0x008 FileSize&&&&&&&& : _LARGE_INTEGER&&&+0x010 BcbList&&&&&&&&& : _LIST_ENTRY&& +0x018 SectionSize&&&&& : _LARGE_INTEGER&& +0x020 ValidDataLength& : _LARGE_INTEGER&& +0x028 ValidDataGoal&&& : _LARGE_INTEGER&& +0x030 InitialVacbs&&&& : [4] Ptr32 _VACB&& +0x040 Vacbs&&&&&&&&&&& : Ptr32 Ptr32 _VACB&& +0x044 FileObject&&&&&& : Ptr32 _FILE_OBJECT&& +0x048 ActiveVacb&&&&&& : Ptr32 _VACB&& +0x04c NeedToZero&&&&&& : Ptr32 Void&& +0x050 ActivePage&&&&&& : Uint4B&& +0x054 NeedToZeroPage&& : Uint4B&& +0x058 ActiveVacbSpinLock : Uint4B&& +0x05c VacbActiveCount& : Uint4B&& +0x060 DirtyPages&&&&&& : Uint4B&& +0x064 SharedCacheMapLinks : _LIST_ENTRY&& +0x06c Flags&&&&&&&&&&& : Uint4B&& +0x070 Status&&&&&&&&&& : Int4B&& +0x074 Mbcb&&&&&&&&&&&& : Ptr32 _MBCB&& +0x078 Section&&&&&&&&& : Ptr32 Void&& +0x07c CreateEvent&&&&& : Ptr32 _KEVENT&& +0x080 WaitOnActiveCount : Ptr32 _KEVENT&& +0x084 PagesToWrite&&&& : Uint4B&& +0x088 BeyondLastFlush& : Int8B&& +0x090 Callbacks&&&&&&& : Ptr32 _CACHE_MANAGER_CALLBACKS&& +0x094 LazyWriteContext : Ptr32 Void&& +0x098 PrivateList&&&&& : _LIST_ENTRY&& +0x0a0 LogHandle&&&&&&& : Ptr32 Void&& +0x0a4 FlushToLsnRoutine : Ptr32&&&& void && +0x0a8 DirtyPageThreshold : Uint4B&& +0x0ac LazyWritePassCount : Uint4B&& +0x0b0 UninitializeEvent : Ptr32 _CACHE_UNINITIALIZE_EVENT&& +0x0b4 NeedToZeroVacb&& : Ptr32 _VACB&& +0x0b8 BcbSpinLock&&&&& : Uint4B&& +0x0bc Reserved&&&&&&&& : Ptr32 Void&& +0x0c0 Event&&&&&&&&&&& : _KEVENT&& +0x0d0 VacbPushLock&&&& : _EX_PUSH_LOCK&& +0x0d8 PrivateCacheMap& : _PRIVATE_CACHE_MAP&& +0x130 WriteBehindWorkQueueEntry : Ptr32 Void
////& This is the Buffer Control Block structure for representing data which//& is "pinned" in memory by one or more active requests and/or dirty.& This//& structure is created the first time that a call to CcPinFileData specifies//& a particular integral range of pages.& It is deallocated whenever the Pin//& Count reaches 0 and the Bcb is not Dirty.////& NOTE: The first four fields must be the same as the PUBLIC_BCB.//
typedef struct _BCB {
&&& union {
&&&&&&& //&&&&&&& // To ensure QuadAlign (sizeof (BCB)) &= QuadAlign (sizeof (MBCB))&&&&&&& // so that they can share the same pool blocks.&&&&&&& //
&&&&&&& MBCB D
&&&&&&& struct {
&&&&&&&&&&& //&&&&&&&&&&& //& Type and size of this record&&&&&&&&&&& //
&&&&&&&&&&& CSHORT NodeTypeC
&&&&&&&&&&& //&&&&&&&&&&& //& Flags&&&&&&&&&&& //
&&&&&&&&&&& BOOLEAN D&&&&&&&&&&& BOOLEAN R
&&&&&&&&&&& //&&&&&&&&&&& //& Byte FileOffset and and length of entire buffer&&&&&&&&&&& //
&&&&&&&&&&& ULONG& ByteL&&&&&&&&&&& LARGE_INTEGER FileO
&&&&&&&&&&& //&&&&&&&&&&& //& Links for BcbList in SharedCacheMap&&&&&&&&&&& //
&&&&&&&&&&& LIST_ENTRY BcbL
&&&&&&&&&&& //&&&&&&&&&&& //& Byte FileOffset of last byte in buffer (used for searching)&&&&&&&&&&& //
&&&&&&&&&&& LARGE_INTEGER BeyondLastB
&&&&&&&&&&& //&&&&&&&&&&& //& Oldest Lsn (if specified) when this buffer was set dirty.&&&&&&&&&&& //
&&&&&&&&&&& LARGE_INTEGER OldestL
&&&&&&&&&&& //&&&&&&&&&&& //& Most recent Lsn specified when this buffer was set dirty.&&&&&&&&&&& //& The FlushToLsnRoutine is called with this Lsn.&&&&&&&&&&& //
&&&&&&&&&&& LARGE_INTEGER NewestL
&&&&&&&&&&& //&&&&&&&&&&& //& Pointer to Vacb via which this Bcb is mapped.&&&&&&&&&&& //
&&&&&&&&&&& PVACB V
&&&&&&&&&&& //&&&&&&&&&&& //& Count of threads actively using this Bcb to process a request.&&&&&&&&&&& //& This must be manipulated under protection of the BcbListSpinLock&&&&&&&&&&& //& in the SharedCacheMap.&&&&&&&&&&& //
&&&&&&&&&&& ULONG PinC
&&&&&&&&&&& //&&&&&&&&&&& //& Resource to synchronize buffer access.& Pinning Readers and all Writers&&&&&&&&&&& //& of the described buffer take out shared access (synchronization of&&&&&&&&&&& //& buffer modifications is strictly up to the caller).& Note that pinning&&&&&&&&&&& //& readers do not declare if they are going to modify the buffer or not.&&&&&&&&&&& //& Anyone writing to disk takes out exclusive access, to prevent the buffer&&&&&&&&&&& //& from changing while it is being written out.&&&&&&&&&&& //
&&&&&&&&&&& ERESOURCE R
&&&&&&&&&&& //&&&&&&&&&&& //& Pointer to SharedCacheMap for this Bcb.&&&&&&&&&&& //
&&&&&&&&&&& PSHARED_CACHE_MAP SharedCacheM
&&&&&&&&&&& //&&&&&&&&&&& //& This is the Base Address at which the buffer can be seen in&&&&&&&&&&& //& system space.& All access to buffer data should go through this&&&&&&&&&&& //& address.&&&&&&&&&&& //
&&&&&&&&&&& PVOID BaseA&&&&&&& };&&& };
} BCB;还是那句话,楼主 U 一下你的 CcGetLsnForFileObject 函数以便分析。
IP 地址: 已记录&&
rainynight
Re: 这是什么问题导致的?
kd& u CcGetLsnForFileObject
nt!CcGetLsnForFileObject:
c8b
al,8
8052bd4d c
dword ptr [edx],0
a04
dword ptr [edx+4],edi
bff
nt!CcGetLsnForFileObject+0x30 (8052bd78)
c9ff
ecx,0FFFFFFFFh
minidump:/d/a43d91daeac892eff1d70b0a133ea234f0000
IP 地址: 已记录&&
发 贴: 306
Re: 这是什么问题导致的?
0. 楼主你早贴 minidump 就好了。当然,是 kernel dump 就更好了...
1. 楼主第一个帖子里的 dump 显然和实际的情况不符,Windbg 错误的栈定位到了:
STACK_TEXT: ada3dd30 00a0c 00000 nt!CcGetLsnForFileObject+0x4f ada3dd64 7c92e4f4 badb0d00 0352fc08 aedfad98 nt!PopRunDownSourceTargetList+0x10e WARNING: Frame IP not in any known module. Following frames may be wrong.
而 nt!CcGetLsnForFileObject 函数内部根本没有字符串 (repne scas word ptr es:[edi]) 相关操作,枉费我一番功夫呀。进一步分析楼主贴出的 minidump 可以发现这次 Windbg 仍然有个小错误。2. minidump 里的 nt!CcGetLsnForFileObject 如下:
kd& u CcGetLsnForFileObjectnt!CcGetLsnForFileObject:804e5200 8bff&&&&&&&&&&& mov&&&& edi,edi804e5202 55&&&&&&&&&&&&& push&&& ebp804e5203 8bec&&&&&&&&&&& mov&&&& ebp,esp804ec&&&&&&&&& sub&&&& esp,1Ch804e8&&&&&&&&& mov&&&& eax,dword ptr [ebp+8]804e520b 8b4014&&&&&&&&& mov&&&& eax,dword ptr [eax+14h]804e520e 33d2&&&&&&&&&&& xor&&&& edx,edx804e5210 56&&&&&&&&&&&&& push&&& esi804e4&&&&&&&&& mov&&&& esi,dword ptr [eax+4]804e&&&&&&&&&&& xor&&&& eax,eax804e&&&&&&&&&&& cmp&&&& esi,edx804e&&&&&&&&& mov&&&& dword ptr [ebp-8],eax804e521b 8955fc&&&&&&&&& mov&&&& dword ptr [ebp-4],edx804e521e 8955f0&&&&&&&&& mov&&&& dword ptr [ebp-10h],edx804e&&&&&&&&& mov&&&& dword ptr [ebp-0Ch],edx804ea6000000&&& je&&&&& nt!CcGetLsnForFileObject+0xd0 (804e52d0)804e522a 57&&&&&&&&&&&&& push&&& edi804e522b 8d8eb8000000&&& lea&&&& ecx,[esi+0B8h]804ee4&&&&&&&&& lea&&&& edx,[ebp-1Ch]804e5234 ff&&& call&&& dword ptr [nt!_imp_KeAcquireInStackQueuedSpinLock (804d8704)]804e523a 8d7e10&&&&&&&&& lea&&&& edi,[esi+10h]804e523d 8b07&&&&&&&&&&& mov&&&& eax,dword ptr [edi]804e523f 83e810&&&&&&&&& sub&&&& eax,10h804e0&&&&&&&&& lea&&&& ecx,[eax+10h]804e5245 3bcf&&&&&&&&&&& cmp&&&& ecx,edi804e&&&&&&&&&&& je&&&&& nt!CcGetLsnForFileObject+0xae (804e52ae)804e5249 53&&&&&&&&&&&&& push&&& ebx804e524a &&&&& cmp&&&& word ptr [eax],2FDh804e524f 7550&&&&&&&&&&& jne&&&& nt!CcGetLsnForFileObject+0xa1 (804e52a1)804e0&&&&&&& cmp&&&& byte ptr [eax+2],0804ea&&&&&&&&&&& je&&&&& nt!CcGetLsnForFileObject+0xa1 (804e52a1)804e0&&&&&&&&& mov&&&& esi,dword ptr [eax+20h]
这个和我上面分析的帖子完全一致。而楼主您列出来的是? -_-!
3. minidump 里显示,真正的问题比较复杂,我现在手头有点事,下个帖子给你分析一下。
IP 地址: 已记录&&
发 贴: 306
Re: 这是什么问题导致的?
我能从 Minidump 中看出什么:
1. 楼主在玩魔兽 (或者你在写外挂搞魔兽)
2. Windbg 又出错了!
Windbg 告诉我们出错的 call stack 是:
STACK_TEXT:& b694cbf4 b694cd18 1743cf2e b694cd64
nt!RtlInitUnicodeString+0x1bWARNING: Frame IP not in any known module. Following frames may be wrong.b694cd30 026d8 00000 <FONT color=#ff4cd18b694cd30 7c92e4f4
00000 nt!KiFastCallEntry+0xf800 x7c92e4f4
nt!KiFastCallEntry+0xd7:c9&&&&&&&&&&& xor&&&& ecx,ecxa0c18&&&&&&&&& mov&&&& cl,byte ptr [eax+ebx]b3f&&&&&&&&&&& mov&&&& edi,dword ptr [edi]b1c87&&&&&&&&& mov&&&& ebx,dword ptr [edi+eax*4]be1&&&&&&&&&&& sub&&&& esp,ecxe902&&&&&&&&& shr&&&& ecx,2bfc&&&&&&&&&&& mov&&&& edi,espb&&& cmp&&&& esi,dword ptr [nt!MmUserProbeAddress (80559a54)]e902&&&&&&&&& shr&&&& ecx,2bfc&&&&&&&&&&& mov&&&& edi,espb&&& cmp&&&& esi,dword ptr [nt!MmUserProbeAddress (80559a54)]f83a8010000&&& jae&&&& nt!KiSystemCallExit2+0x9f (8053e7ec)a5&&&&&&&&&&& rep movs dword ptr es:[edi],dword ptr [esi] ffd3&&&&&&&&&&& call&&& ebxbe5&&&&&&&&&&& mov&&&& esp,ebpb0d24f1dfff&&& mov&&&& ecx,dword ptr ds:[0FFDFF124h]
nt!KiFastCallEntry 告诉我们,一切正常,某些“好但是阴险”的钩子点没有工作,程序在
准备进入 SSDT。但是 SSDT 里的某个项被 Hook 了。
WARNING: Frame IP not in any known module. Following frames may be wrong.b694cd30 026d8 00000 <FONT color=#ff4cd18 && Hook!b694cd30 7c92e4f4
00000 nt!KiFastCallEntry+0xf8
那么,<FONT color=#ff4cd18 是什么?没有答案:
kd& dd 0xb694cd18b694cd18& 3cf2e aee6e0b694cd28& 8f008 b694cd64 b694cd38&
ce10b694cd48& 3bf98 00003b694cd58& 00 0019e86cb694cd68& 7c92e4f4 badb0d00
ffffffffb694cd78& b6ebfda0 00b694cd88& 00
结合栈桢分析,我发现这里是 Windbg 自己解析出错了!因为 nt!RtlInitUnicodeString 只开辟了一个局部变量,而这个分析显然有问题:
kd& dd espb694cbf0& <FONT color=#4cd64 f7bbd806 b694cd18 <FONT color=#ffcf2eb694cc00& b694cd64 bbd6ed 2e576f57b694cc10& 03 b694cc20& 00 b694cc30& 0ccc4 f718a0c5b694cc40& 0019e5dc 9e580 b694cc50& b00 ebfb2640b694cc60&
ebf9f247 0019e5dc
kd& kbChildEBP RetAddr& Args to Child&&&&&&&&&&&&& b694cbf4 b694cd18 <FONT color=#ffcf2e b694cd64
nt!RtlInitUnicodeString+0x1bWARNING: Frame IP not in any known module. Following frames may be wrong.b694cd30 026d8 4cd18b694cd30 7c92e4f4
00000 nt!KiFastCallEntry+0xf800 x7c92e4f4
Windbg 认为:<FONT color=#4cd64 f7bbd806 是局部变量b694cd18 是返回地址<FONT color=#ffcf2e 是参数一b694cd64 是参数二
但是显然应该是:
kd& dd espb694cbf0& <FONT color=#4cd64 f7bbd806 <FONT color=#ffcd18 1743cf2eb694cc00& b694cd64 bbd6ed 2e576f57b694cc10& 03 b694cc20& 00 b694cc30& 0ccc4 f718a0c5b694cc40& 0019e5dc 9e580 b694cc50& b00 ebfb2640b694cc60&
ebf9f247 0019e5dc
<FONT color=#4cd64 是局部变量 —— push&&& edif7bbd806 是返回地址 —— 回到钩子函数里<FONT color=#ffcd18 是参数一&& —— RtlInitUnicodeString 的 DestinationString1743cf2e 是参数二&& —— RtlInitUnicodeString 的 SourceString
这个猜想太大胆了 OK!验证一下:
kd& u f7bbd806*** WARNING: Unable to verify timestamp for hfile.sys*** ERROR: Module load completed but symbols could not be loaded for hfile.syshfile+0x806:f7bbd806 ??&&&&&&&&&&&&& ???&&&&&&&&&&&& ^ Memory access error in 'u f7bbd806'
原来是 hfile.sys 挂钩了 SSDT。google 一下,这可不是什么好东西!
kd& lmstart&&& end&&&&&&& module name........f7bba000 f7bbad00&& dxgthk&&&& (deferred)f7bbd000 f7bbdf80&& hfile&&& T (no symbols)f7c0b80&& Null&&&&&& (deferred)........
---------------------------------------------------------------------------
RtlInitUnicodeString 参数一:b694cd18
kd& dt nt!_unicode_string b694cd18 &"Logs???"&& +0x000 Length&&&&&&&&&& : 0&& +0x002 MaximumLength&&& : 0&& +0x004 Buffer&&&&&&&&&& : 0x1743cf2e& "Logs???"
---------------------------------------------------------------------------
RtlInitUnicodeString 参数二:1743cf2e
kd& db 1743cf2e1743cf2e& <FONT color=#ff 6f 00 67 00 73 00-f8 e8 8a 6b 46 42 7e 72& L.o.g.s....kFB~r1743cf3e& 60 00 0c 7c e8 5a 09 03-22 28 0c 7c e5 39 58 78& `..|.Z.."(.|.9Xx1743cf4e& 78 78 8b 73 e5 41 8d 2d-3d 3d 2d 74 05 3a fd fd& xx.s.A.-==-t.:..1743cf5e& fd 01 8e 84 ec 6b 62 7a-7a f8 cb 6b 66 42 1c 18& .....kbzz..kfB..1743cf6e& d8 50 ab 6b 06 3a a0 78-9f 17 52 9d 87 42 e1 f2& .P.k.:.x..R..B..1743cf7e& f0 e0 eb 7c 26 3a 72 72-72 72 8b 6b 46 42 55 f5& ...|&:rrrr.kFBU.1743cf8e& ad 0b eb 73 a8 4a f5 ff-2a 2a 0d 00 01 02 6f 10& ...s.J..**....o.1743cf9e& 70 05 e0 01 1c 00 80 85-28 00 f0 94 29 63 d5 9d& p.......(...)c..
非常好!和我预期的一模一样~&& B-)
我说到这里,楼主自己也能分析出蓝屏的原因了吧。
看样子 hfile.sys 驱动想初始化一个 UNICODE_STRING ——“LOGS”,但是它这里没有指定字符串的结束符:1743cf2e& <FONT color=#ff 6f 00 67 00 73 00-f8 e8 8a 6b 46 42 7e 721743cf2e& <FONT color=#ff 6f 00 67 00 73 00-00 00 8a 6b 46 42 7e 72 && 这才是正确的!
结果,可怜的 repne scas word ptr es:[edi] 指令,一直从地址 1743cf2e& 计算字符串长度到 :
eax= ebx=1743ced0 ecx=ffffff96 edx=b694cd18 esi=805d96b6 edi=eip=8052bd97 esp=b694cbf0 ebp=b694cd30 iopl=0&&&&&&&& nv up ei pl nz ac pe cycs=0008& ss=0010& ds=0023& es=0023& fs=0030& gs=0000&&&&&&&&&&&& efl=
看看这一段吧:
kd& db 43d0001743cf2e& <FONT color=#ff 6f 00 67 00 73 00-f8 e8 8a 6b 46 42 7e 72& L.o.g.s....kFB~r1743cf3e& 60 00 0c 7c e8 5a 09 03-22 28 0c 7c e5 39 58 78& `..|.Z.."(.|.9Xx1743cf4e& 78 78 8b 73 e5 41 8d 2d-3d 3d 2d 74 05 3a fd fd& xx.s.A.-==-t.:..1743cf5e& fd 01 8e 84 ec 6b 62 7a-7a f8 cb 6b 66 42 1c 18& .....kbzz..kfB..1743cf6e& d8 50 ab 6b 06 3a a0 78-9f 17 52 9d 87 42 e1 f2& .P.k.:.x..R..B..1743cf7e& f0 e0 eb 7c 26 3a 72 72-72 72 8b 6b 46 42 55 f5& ...|&:rrrr.kFBU.1743cf8e& ad 0b eb 73 a8 4a f5 ff-2a 2a 0d 00 01 02 6f 10& ...s.J..**....o.1743cf9e& 70 05 e0 01 1c 00 80 85-28 00 f0 94 29 63 d5 9d& p.......(...)c..1743cfae& 9d 15 19 d7 92 ad f2 fa-72 5a 13 be 71 ad 3f 7b& ........rZ..q.?{1743cfbe& eb 82 f2 b5 2f a5 00 fd-af ae ae 94 46 42 d6 d4& ..../.......FB..1743cfce& d4 d4 cf a4 c8 5a 45 85-27 07 ad 8c c9 52 25 2d& .....ZE.'....R%-1743cfde& 2d 29 2f 9d 0b 74 7f 7f-6e ca e8 5a 66 4a a4 b6& -)/..t..n..ZfJ..1743cfee& b6 b4 b2 a5 08 5b 15 d5-d5 95 b2 ad ef 9c f8 f8& .....[..........1743cffe& f1 e8 ??&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ..?
为了找 00 00 结束符,指令一直访问到地址错误、蓝屏,精神可嘉。
最后对楼主的建议:
1. 玩 WOW 前赶紧卸载那什么 hfile.sys 小心它 LOGS 你的密码啥的。
2. 开启360。我发现你的机器上有360,但是自我保护没开启。/**** WARNING: Unable to verify timestamp for safeboxkrnl.sys*** ERROR: Module load completed but symbols could not be loaded for safeboxkrnl.sys*/
3. 您若是无聊就把 hfile.sys 发给我看看 (wangyu_at_qihoo_dot_net),我若是无聊就把它给逆了。
4. 写的累死我了,楼主给点掌声吧...&& : P
IP 地址: 已记录&&
Re: 这是什么问题导致的?
给点掌声你~~~分析的很好。。。膜拜~~~
IP 地址: 已记录&&
发 贴: 306
Re: 这是什么问题导致的?
刚封装完一个库,小感慨一下, CSRSS 启动的命令行参数够变态...1: kd& ?? pUnitstruct _PROCESS_UNIT * 0x817da150&& +0x000 Next&&&&&&&&&&&& : (null) && +0x004 Index&&&&&&&&&&& : 4&& +0x008 Hidden&&&&&&&&&& : 0&& +0x00c Keyword&&&&&&&&& : 0&& +0x010 UniqueProcessId& : 0x0000029c && +0x014 ParentProcessId& : 0x0000026c && +0x018 pUniqueEProcess& : 0x _EPROCESS&& +0x01c pParentEProcess& : 0x _EPROCESS&& +0x020 ProcessFileName& : _STRING "csrss.exe"&& +0x028 ProcessPathName& : _STRING "C:\WINDOWS\system32\csrss.exe"&& +0x030 CommandLine&&&&& : _STRING "C:\WINDOWS\system32\csrss.exe ObjectDirectory=\Windows SharedSection=2 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16"
IP 地址: 已记录&&
rainynight
Re: 这是什么问题导致的?
非常棒,感谢王宇的分析,掌声
IP 地址: 已记录&&
发 贴: 306
Re: 这是什么问题导致的?
嘿嘿 谢谢你们呀! ^_^
IP 地址: 已记录&&
rainynight
Re: 这是什么问题导致的?
请教个问题,我windbg打开那个minidump
call stack 是:
STACK_TEXT:
b694cd30 026d8 00000 nt!CcGetLsnForFileObject+0x4f
b694cd64 7c92e4f4 badb0d00
ffffffff nt!PopRunDownSourceTargetList+0x10e
WARNING: Frame IP not in any known module. Following frames may be wrong.
b694cd68 badb0d00
ffffffff b6ebfda0 0x7c92e4f4
b694cd6c
ffffffff b6ebfda0 xbadb0d00
b694cd70 ffffffff b6ebfda0 e7f8
b694cd74 b6ebfda0 00 0xffffffff
b694cd78 00 xb6ebfda0
IP 地址: 已记录&&
发 贴: 1,281
Re: 这是什么问题导致的?
王宇分析的很生动!不过还有值得挖掘的地方,使用dds命令看一下栈,很可能还执行过其它模块的函数:kd& dds espb694cbf0& b694cd64b694cbf4& f7bbd806 hfile+0x806b694cbf8& b694cd18b694cbfc& 1743cf2eb694cc00& b694cd64b694cc04& b694cc08& f7bbd6ed hfile+0x6edb694cc0c& 2e576f57b694cc10& b694cc14& b694cc18& b694cc1c& b694cc20& b694cc24& b694cc28& b694cc2c& b694cc30& b694cc34& b694cc38& b694ccc4b694cc3c& f718a0c5 kl1+0x20c5b694cc40& 0019e5dcb694cc44& b694cc48& b694cc4c& b694cc50& b694cc54& b694cc58& 855b1b00b694cc5c& ebfb2640 cmdguard+0x16640b694cc60&
nt!ProbeForReadb694cc64& ebf9f247 cmdguard+0x3247b694cc68& 0019e5dcb694cc6c&
楼主是否有可能产生一个kernel dump或者full dump(最好),然后压缩一下传上来?
IP 地址: 已记录&&
发 贴: 306
Re: 这是什么问题导致的?
看了一下 hfile.sys 是一个写的很不好的文件夹过滤驱动(SSDT Hook NtQueryDirectoryFile)......
甚至还不及
IP 地址: 已记录&&
Re: 这是什么问题导致的?
太牛了,鼓掌~
这个帖子学到了不少东西,另外请问一下,字体变色是怎么搞的啊?
IP 地址: 已记录&&
总页数 1 第 2 页
[共有 16 条记录]
|- 论坛搜索
|- 热门主题
|- 未回复的主题
|- 找回密码
|- Windows内核调试
|- C/C++本地代码调试
|- .Net程序调试
|- 脚本程序调试
|- Java程序调试
|- Linux内核调试
|- 《程序员》杂志调试专栏
|- 远程调试
|- 调试ACPI和BIOS
|- 特殊的调试任务
|- 转储分析
|- Windows内核
|- Linux内核
|- CPU架构
|- PCI/PCI Express架构
|- 软件物语
|- 社区活动
|- 名人逸事
|- 欢迎使用CnForums
|- BUG也精彩
|- 豆腐工程
|- 软件圈里十大怪
Windows Vista
|- 用调试利剑剖析VISTA内幕
|- 老专家如何破解新问题
|- 我的电脑谁说了算?
Office开发
驱动程序开发
|- Windows驱动开发
|- Linux驱动开发
|- Windows CE驱动开发
用户态开发
|- Windows本地代码(native)高级开发
|- Web应用开发
|- WinFX和.Net
|- Office开发
|- 高端调试团队
|- 版面布局
|- 活动建议
|- 网站维护
|- 64-bit Windows
|- 64-bit CPU
|- 《软件调试》的示例程序
|- 《软件调试》的工具
|- 《软件调试》书友
|- 《软件调试》答疑
|- 《软件调试》勘误和意见
|- 《格蠹汇编》
|- PaaS和SaaS
|- 游戏开发与调试
(C) ADVDBG.ORG All Rights Reserved.}

我要回帖

更多关于 腿肿是什么原因引起的 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信