能力值:
( LV2,RANK:10 )
|
-
-
2 楼
看起来像是地址没搞对,把
!peb
的结果贴一下
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
地址肯定没错的,结果如下:
0:000> !peb
PEB at 7ffdd000
InheritedAddressSpace: No
ReadImageFileExecOptions: No
BeingDebugged: Yes
ImageBaseAddress: 00090000
Ldr 772a7880
Ldr.Initialized: Yes
[COLOR="Red"] Ldr.InInitializationOrderModuleList: [COLOR="SeaGreen"]002f1e90[/COLOR] . 002f6878
Ldr.InLoadOrderModuleList: 002f1df0 . 002f62c0
Ldr.InMemoryOrderModuleList: 002f1df8 . 002f62c8[/COLOR]
Base TimeStamp Module
90000 4a5bc60f Jul 14 07:41:03 2009 C:\Windows\notepad.exe
771d0000 521ea91c Aug 29 09:51:24 2013 C:\Windows\SYSTEM32\ntdll.dll
758d0000 51fb10c5 Aug 02 09:52:05 2013 C:\Windows\system32\kernel32.dll
754b0000 51fb10c6 Aug 02 09:52:06 2013 C:\Windows\system32\KERNELBASE.dll
75ce0000 521ea86a Aug 29 09:48:26 2013 C:\Windows\system32\ADVAPI32.dll
76220000 4eeaf722 Dec 16 15:45:38 2011 C:\Windows\system32\msvcrt.dll
762d0000 4a5bdb04 Jul 14 09:10:28 2009 C:\Windows\SYSTEM32\sechost.dll
75fd0000 51db96a4 Jul 09 12:50:44 2013 C:\Windows\system32\RPCRT4.dll
75c00000 524ccf2f Oct 03 09:58:07 2013 C:\Windows\system32\GDI32.dll
762f0000 4ce7ba26 Nov 20 20:08:06 2010 C:\Windows\system32\USER32.dll
77340000 51b0158a Jun 06 12:52:26 2013 C:\Windows\system32\LPK.dll
77360000 4ce7ba29 Nov 20 20:08:09 2010 C:\Windows\system32\USP10.dll
75630000 4ce7b82d Nov 20 19:59:41 2010 C:\Windows\system32\COMDLG32.dll
75ba0000 4ce7b9e2 Nov 20 20:06:58 2010 C:\Windows\system32\SHLWAPI.dll
73e20000 4ce7b71c Nov 20 19:55:08 2010 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\COMCTL32.dll
764f0000 51f1d731 Jul 26 09:56:01 2013 C:\Windows\system32\SHELL32.dll
70a40000 4ce7ba4b Nov 20 20:08:43 2010 C:\Windows\system32\WINSPOOL.DRV
75a40000 4ce7b96f Nov 20 20:05:03 2010 C:\Windows\system32\ole32.dll
77140000 4e58702a Aug 27 12:18:50 2011 C:\Windows\system32\OLEAUT32.dll
746d0000 4a5bdb2b Jul 14 09:11:07 2009 C:\Windows\system32\VERSION.dll
75fb0000 4ce7b845 Nov 20 20:00:05 2010 C:\Windows\system32\IMM32.DLL
75560000 4a5bda69 Jul 14 09:07:53 2009 C:\Windows\system32\MSCTF.dll
SubSystemData: 00000000
ProcessHeap: 002f0000
ProcessParameters: 002f1488
CurrentDirectory: 'D:\Program Files\Debugging Tools for Windows (x86)\'
WindowTitle: 'C:\Windows\notepad.exe'
ImageFile: 'C:\Windows\notepad.exe'
CommandLine: 'C:\Windows\notepad.exe'
DllPath: 'C:\Windows;;C:\Windows\system32;C:\Windows\system;C:\Windows;.;D:\Program Files\Debugging Tools for Windows (x86)\winext\arcade;D:\Program Files\ActiveState Komodo IDE 8\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;d:\Program Files\010 Editor;d:\Ruby200\bin'
Environment: 002f0810
=::=::\
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\tom\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=VS2013
ComSpec=C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\tom
LOCALAPPDATA=C:\Users\tom\AppData\Local
LOGONSERVER=\\VS2013
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
Path=D:\Program Files\Debugging Tools for Windows (x86)\winext\arcade;D:\Program Files\ActiveState Komodo IDE 8\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;d:\Program Files\010 Editor;d:\Ruby200\bin
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 6 Model 58 Stepping 9, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=3a09
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\tom\AppData\Local\Temp
TMP=C:\Users\tom\AppData\Local\Temp
USERDOMAIN=VS2013
USERNAME=tom
USERPROFILE=C:\Users\tom
VS120COMNTOOLS=C:\Program Files\Microsoft Visual Studio 12.0\Common7\Tools\
WINDBG_DIR=D:\Program Files\Debugging Tools for Windows (x86)
windir=C:\Windows
windows_tracing_flags=3
windows_tracing_logfile=C:\BVTBin\Tests\installpackage\csilogfile.log
_NT_SYMBOL_PATH=d:\symbols;symsrv*symsrv.dll*d:\symsrv*http://msdl.microsoft.com/download/symbols
用 InInitializationOrderModuleList查看的结果如下:
0:000> dt -b ntdll!_LDR_DATA_TABLE_ENTRY[COLOR="SeaGreen"] 002f1e90[/COLOR]
+0x000 InLoadOrderLinks : _LIST_ENTRY [ 0x2f22d0 - 0x772a789c ]
+0x000 Flink : 0x002f22d0
+0x004 Blink : 0x772a789c
+0x008 InMemoryOrderLinks : _LIST_ENTRY [ 0x771d0000 - 0x0 ]
+0x000 Flink : 0x771d0000
+0x004 Blink : (null)
+0x010 InInitializationOrderLinks : _LIST_ENTRY [ 0x13c000 - 0x3c003a ]
+0x000 Flink : 0x0013c000
+0x004 Blink : 0x003c003a
[COLOR="Red"] +0x018 DllBase : 0x002f1d50 [/COLOR]
+0x01c EntryPoint : 0x00140012
+0x020 SizeOfImage : 0x77238358
[COLOR="Red"] +0x024 FullDllName : _UNICODE_STRING "--- memory read error at address 0x0000ffff ---"
+0x000 Length : 0x4004
+0x002 MaximumLength : 0
+0x004 Buffer : 0x0000ffff "--- memory read error at address 0x0000ffff ---"
+0x02c BaseDllName : _UNICODE_STRING "Ẽ/Ẽ/㻜/拼/???"
+0x000 Length : 0xa680
+0x002 MaximumLength : 0x772a
+0x004 Buffer : 0x772aa680 "Ẽ/Ẽ/㻜/拼/???"[/COLOR]
+0x034 Flags : 0x521ea91c
+0x038 LoadCount : 0
+0x03a TlsIndex : 0
+0x03c HashLinks : _LIST_ENTRY [ 0x0 - 0x2f1ed0 ]
+0x000 Flink : (null)
+0x004 Blink : 0x002f1ed0
+0x03c SectionPointer : (null)
+0x040 CheckSum : 0x2f1ed0
+0x044 TimeDateStamp : 0x2f1ed0
+0x044 LoadedImports : 0x002f1ed0
+0x048 EntryPointActivationContext : 0x002f1ed8
+0x04c PatchInformation : 0x002f1ed8
+0x050 ForwarderLinks : _LIST_ENTRY [ 0x2f1ee0 - 0x2f1ee0 ]
+0x000 Flink : 0x002f1ee0
+0x004 Blink : 0x002f1ee0
+0x058 ServiceTagLinks : _LIST_ENTRY [ 0x0 - 0x77ec0000 ]
+0x000 Flink : (null)
+0x004 Blink : 0x77ec0000
+0x060 StaticLinks : _LIST_ENTRY [ 0x0 - 0x0 ]
+0x000 Flink : (null)
+0x004 Blink : (null)
+0x068 ContextInformation : 0xabababab
+0x06c OriginalBase : 0xabababab
+0x070 LoadTime : _LARGE_INTEGER 0x0
+0x000 LowPart : 0
+0x004 HighPart : 0n0
+0x000 u : <unnamed-tag>
+0x000 LowPart : 0
+0x004 HighPart : 0n0
+0x000 QuadPart : 0n0
看我标注的颜色
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
而用InLoadOrderLinks就没问题:
0:000> dt -b ntdll!_LDR_DATA_TABLE_ENTRY 002f1df0
+0x000 InLoadOrderLinks : _LIST_ENTRY [ 0x2f1e80 - 0x772a788c ]
+0x000 Flink : 0x002f1e80
+0x004 Blink : 0x772a788c
+0x008 InMemoryOrderLinks : _LIST_ENTRY [ 0x2f1e88 - 0x772a7894 ]
+0x000 Flink : 0x002f1e88
+0x004 Blink : 0x772a7894
+0x010 InInitializationOrderLinks : _LIST_ENTRY [ 0x0 - 0x0 ]
+0x000 Flink : (null)
+0x004 Blink : (null)
[COLOR="SeaGreen"] +0x018 DllBase : 0x00090000 [/COLOR]
+0x01c EntryPoint : 0x00093689
+0x020 SizeOfImage : 0x30000
[COLOR="SeaGreen"] +0x024 FullDllName : _UNICODE_STRING "C:\Windows\notepad.exe"
+0x000 Length : 0x2c
+0x002 MaximumLength : 0x2e
+0x004 Buffer : 0x002f1c86 "C:\Windows\notepad.exe"
+0x02c BaseDllName : _UNICODE_STRING "notepad.exe"[/COLOR]
+0x000 Length : 0x16
+0x002 MaximumLength : 0x18
+0x004 Buffer : 0x002f1c9c "notepad.exe"
+0x034 Flags : 0x4000
+0x038 LoadCount : 0xffff
+0x03a TlsIndex : 0
+0x03c HashLinks : _LIST_ENTRY [ 0x772aa5e8 - 0x772aa5e8 ]
+0x000 Flink : 0x772aa5e8
+0x004 Blink : 0x772aa5e8
+0x03c SectionPointer : 0x772aa5e8
+0x040 CheckSum : 0x772aa5e8
+0x044 TimeDateStamp : 0x4a5bc60f
+0x044 LoadedImports : 0x4a5bc60f
+0x048 EntryPointActivationContext : (null)
+0x04c PatchInformation : (null)
+0x050 ForwarderLinks : _LIST_ENTRY [ 0x2f1e40 - 0x2f1e40 ]
+0x000 Flink : 0x002f1e40
+0x004 Blink : 0x002f1e40
+0x058 ServiceTagLinks : _LIST_ENTRY [ 0x2f1e48 - 0x2f1e48 ]
+0x000 Flink : 0x002f1e48
+0x004 Blink : 0x002f1e48
+0x060 StaticLinks : _LIST_ENTRY [ 0x2f4a88 - 0x2f3108 ]
+0x000 Flink : 0x002f4a88
+0x004 Blink : 0x002f3108
+0x068 ContextInformation : 0x77240594
+0x06c OriginalBase : 0
+0x070 LoadTime : _LARGE_INTEGER 0x0
+0x000 LowPart : 0
+0x004 HighPart : 0n0
+0x000 u : <unnamed-tag>
+0x000 LowPart : 0
+0x004 HighPart : 0n0
+0x000 QuadPart : 0n0
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
我终于知道为什么了啊,看这篇文章:
http://forum.sysinternals.com/peb-ldr-data-table-entry_topic20577.html
原来还是要减去偏移才是正确的,那岂不是好多文章都没写对啊?
这分怎么给啊,我自己解决了
|
能力值:
( LV2,RANK:10 )
|
-
-
6 楼
谁来个比较通俗易懂的解释,我就把分给了算了啊.
|
能力值:
( LV2,RANK:10 )
|
-
-
7 楼
其实我是犯了一个概念性的错误,我原来以为PEB里的ldr域中的那三个值(Ldr.InInitializationOrderModuleList Ldr.InLoadOrderModuleList Ldr.InMemoryOrderModuleList)就是链表中_ldr_data_table_entry结构体的基址,所以我就用dt命令去直接查看了.其实是:
Ldr.InLoadOrderModuleList的值指向的是_ldr_data_table_entry中InLoadOrderLinks成员的地址(恰恰是_ldr_data_table_entry的基址,因为InLoadOrderLinks正是该结构体的第一个成员), Ldr.InMemoryOrderModuleList的值指向的是_ldr_data_table_entry中InMemoryOrderLinks成员的地址,同样,Ldr.InInitializationOrderModuleList 的值指向的是_ldr_data_table_entry中InInitializationOrderLinks成员的地址.因此,使用Ldr.InMemoryOrderModuleList 和Ldr.InInitializationOrderModuleList进行链表遍历查看的时候,应该将其值相应的减去0x8和0x10才对.就这么个错误,耽误了我几个小时的时间,哎~~~
|
能力值:
( LV9,RANK:200 )
|
-
-
8 楼
看来楼主已大悟,友情接分。
|
能力值:
( LV5,RANK:70 )
|
-
-
9 楼
把图记住就行。
|
|
|