在看到《软件调试》第59页的时候,我按照书上说的方法实践了下。也参照了下博客的那篇开启APE的文章。可是当我输入!dd 5da41000想要查看物理地址的时候,windbg报错:
lkd> !dd 5da41000Physical memory read at 5da41000 failedIf you know the caching attributes used for the memory,try specifying , [uc] or [wc], as in !dd .WARNING: Incorrect use of these flags will cause unpredictableprocessor corruption. This may immediately (or at any time inthe future until reboot) result in a system hang, incorrect databeing displayed or other strange crashes and corruption.
以下是我按照书的windbg的输出:
1 附加calc程序Microsoft (R) Windows Debugger Version 6.9.0003.113 X86Copyright (c) Microsoft Corporation. All rights reserved.
*** wait with pending attachSymbol search path is: srv*d:\symbolslocal*http://msdl.microsoft.com/download/symbolsExecutable search path is: ModLoad: 01000000 0101f000 C:\WINDOWS\system32\calc.exeModLoad: 7c920000 7c9b4000 C:\WINDOWS\system32\ntdll.dllModLoad: 7c800000 7c91d000 C:\WINDOWS\system32\kernel32.dllModLoad: 7d590000 7dd83000 C:\WINDOWS\system32\SHELL32.dllModLoad: 77da0000 77e49000 C:\WINDOWS\system32\ADVAPI32.dllModLoad: 77e50000 77ee2000 C:\WINDOWS\system32\RPCRT4.dllModLoad: 77fc0000 77fd1000 C:\WINDOWS\system32\Secur32.dllModLoad: 77ef0000 77f37000 C:\WINDOWS\system32\GDI32.dllModLoad: 77d10000 77d9f000 C:\WINDOWS\system32\USER32.dllModLoad: 77be0000 77c38000 C:\WINDOWS\system32\msvcrt.dllModLoad: 77f40000 77fb6000 C:\WINDOWS\system32\SHLWAPI.dllModLoad: 5cc30000 5cc56000 C:\WINDOWS\system32\ShimEng.dllModLoad: 58fb0000 5917a000 C:\WINDOWS\AppPatch\AcGenral.DLLModLoad: 76b10000 76b3a000 C:\WINDOWS\system32\WINMM.dllModLoad: 76990000 76acd000 C:\WINDOWS\system32\ole32.dllModLoad: 770f0000 7717b000 C:\WINDOWS\system32\OLEAUT32.dllModLoad: 77bb0000 77bc5000 C:\WINDOWS\system32\MSACM32.dllModLoad: 77bd0000 77bd8000 C:\WINDOWS\system32\VERSION.dllModLoad: 759d0000 75a7e000 C:\WINDOWS\system32\USERENV.dllModLoad: 5adc0000 5adf7000 C:\WINDOWS\system32\UxTheme.dllModLoad: 76300000 7631d000 C:\WINDOWS\system32\IMM32.DLLModLoad: 62c20000 62c29000 C:\WINDOWS\system32\LPK.DLLModLoad: 73fa0000 7400b000 C:\WINDOWS\system32\USP10.dllModLoad: 77180000 77283000 C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dllModLoad: 10000000 10029000 C:\Program Files\360safe\safemon\safemon.dllModLoad: 76bc0000 76bcb000 C:\WINDOWS\system32\PSAPI.DLLModLoad: 75c60000 75cff000 C:\WINDOWS\system32\urlmon.dllModLoad: 74680000 746cb000 C:\WINDOWS\system32\MSCTF.dllModLoad: 00ab0000 00ab4000 C:\Program Files\Unlocker\UnlockerHook.dllModLoad: 73640000 7366e000 C:\WINDOWS\system32\msctfime.imeModLoad: 60800000 60809000 C:\WINDOWS\system32\mslbui.dll(1148.c5c): Break instruction exception - code 80000003 (first chance)eax=7ffde000 ebx=00000001 ecx=00000002 edx=00000003 esi=00000004 edi=00000005eip=7c921230 esp=00adffcc ebp=00adfff4 iopl=0 nv up ei pl zr na pe nccs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246ntdll!DbgBreakPoint:7c921230 cc int 30:002> x calc!g*01014f08 calc!ghwndTimeOutDlg = 01014d9c calc!g_fHighContrast = 0100514d calc!GetKeyColor = 01014ef8 calc!gfExiting = 0100518d calc!GetHelpID = 01014c70 calc!ghnoPrecNum = 01014c08 calc!ghnoParNum = 01014038 calc!gszSep = 01014eec calc!ghcurOld = 01014d38 calc!g_ahnoChopNumbers = 01014f00 calc!ghCalcDone = 01014db0 calc!gpszNum = 01014f0c calc!gnPendingError = 01014000 calc!gnDecGrouping = 01014dc0 calc!gcio = 01014d98 calc!ghnoLastNum = 01014f04 calc!ghDogThread = 01014d80 calc!g_hDecMenu = 01014f48 calc!gbinexact = 01014d7c calc!g_hHexMenu = 01014efc calc!ghCalcStart = 01014da0 calc!g_fLayoutRTL = 01014db8 calc!gbRecord = 010149d8 calc!gcIntDigits = 01014d6c calc!g_hwndDlg = 01014d4c calc!gbUseSep = 01014d94 calc!ghnoMem = 010044b4 calc!GroupDigits = 01014f4c calc!gllfact = 01014d90 calc!ghnoNum = 01014064 calc!gldPrevious = 0:002> x calc!m*0100563c calc!MemErrorMessage = 0100bbd4 calc!mulrat = 01011aa0 calc!mulnum = 0100565b calc!MenuFunctions = 01012314 calc!mulnumx = 01014390 calc!machine = 01014f5c calc!maxout = 0100c266 calc!modrat = 0:002> dd calc!gpszNum01014db0 000b8a10 00000000 00000001 0000000001014dc0 00000000 ffffffff 00000000 0000000001014dd0 00000009 00320031 00340033 0036003501014de0 00380037 00000039 00000000 0000000001014df0 00000000 00000000 00000000 0000000001014e00 00000000 00000000 00000000 0000000001014e10 00000000 00000000 00000000 0000000001014e20 00000000 00000000 00000000 000000000:002> du 000b8a10000b8a10 "123456789."0:002> .format 000b8a10 ^ Syntax error in '.format 000b8a10'0:002> .formats 000b8a10Evaluate expression: Hex: 000b8a10 Decimal: 756240 Octal: 00002705020 Binary: 00000000 00001011 10001010 00010000 Chars: .... Time: Sat Jan 10 02:04:00 1970 Float: low 1.05972e-039 high 0 Double: 3.73632e-3180:002> db 000b8a10000b8a10 31 00 32 00 33 00 34 00-35 00 36 00 37 00 38 00 1.2.3.4.5.6.7.8.000b8a20 39 00 2e 00 00 00 00 00-00 00 00 00 00 00 00 00 9...............000b8a30 05 00 05 00 e9 01 08 00-b0 89 0b 00 04 08 04 08 ................000b8a40 ff ff ff ff 50 14 0b 00-00 00 00 00 04 08 22 e0 ....P.........".000b8a50 ff ff ff ff 90 16 0b 00-05 00 05 00 e4 01 08 00 ................000b8a60 00 00 00 00 04 08 04 08-ff ff ff ff 50 14 0b 00 ............P...000b8a70 00 00 00 00 04 08 22 e0-ff ff ff ff 90 16 0b 00 ......".........000b8a80 07 00 05 00 ff 01 0c 00-00 00 00 00 01 00 00 00 ................
2 本地内核调试模式启动另外一个windbg
Microsoft (R) Windows Debugger Version 6.9.0003.113 X86Copyright (c) Microsoft Corporation. All rights reserved.
Connected to Windows XP 2600 x86 compatible target, ptr64 FALSESymbol search path is: *** Invalid ******************************************************************************** Symbol loading may be unreliable without a symbol search path. ** Use .symfix to have the debugger choose a symbol path. ** After setting your symbol path, use .reload to refresh symbol locations. *****************************************************************************Executable search path is: ********************************************************************** Symbols can not be loaded because symbol path is not initialized. ** ** The Symbol Path can be set by: ** using the _NT_SYMBOL_PATH environment variable. ** using the -y argument when starting the debugger. ** using .sympath and .sympath+ ************************************************************************* ERROR: Symbol file could not be found. Defaulted to export symbols for ntkrnlmp.exe - Unable to read selector for PCR for processor 0*******************************************************************************WARNING: Local kernel debugging requires booting with kerneldebugging support (/debug or bcdedit -debug on) to work optimally.*******************************************************************************Windows XP Kernel Version 2600 (Service Pack 2) MP (2 procs) Free x86 compatibleProduct: WinNt, suite: TerminalServer SingleUserTSBuilt by: 2600.xpsp_sp2_gdr.070227-2254Kernel base = 0x804d8000 PsLoadedModuleList = 0x805634a0Debug session time: Mon Apr 13 15:11:16.687 2009 (GMT+8)System Uptime: 0 days 6:16:04.273lkd> .reloadConnected to Windows XP 2600 x86 compatible target, ptr64 FALSELoading Kernel Symbols.................................................................................................................................Loading User SymbolsUnable to read selector for PCR for processor 0Unable to get PEB pointerLoading unloaded module list................lkd> !process 0 0 calc.exeUnable to read selector for PCR for processor 0PROCESS 86e280c0 SessionId: 0 Cid: 1148 Peb: 7ffde000 ParentCid: 0ab8 DirBase: 5da41000 ObjectTable: e4e0a9d8 HandleCount: 53. Image: calc.exe
我想知道问题到底是出的那个地方,请张老师指点迷津。
把瑞星和windbg卸载掉,重新安装windbg。将原来的符号文件删除。设置完符号路径,直接.reload。下载完符号文件后,运行命令还是!dd失败。虽然知道符号文件有问题,可是不管我怎么换符号文件目录下载后还是这样。真是个奇怪的问题。
这个问题在家里面机器也是一样,不过在公司的一台测试机器上面同样的命令却成功了。我也是很纳闷。要说符号路径不对,我卸载重装指定了新的目录,符号文件也是从微软下的。
刚才给的那个链接我仔细看了下,那个老外说出现“Unable to read selector for PCR for processor 0”是符号文件不全。我看我本机输出信息总是有:
Loading Kernel Symbols.............................................................................................................................Loading User SymbolsUnable to read selector for PCR for processor 0Unable to get PEB pointer
那台成功的机器没有“Unable to read selector for PCR for processor 0”,可是把那边符号文件拷贝过来还是提示这个。