2

I am debugging a kernel driver. When I set a breakpoint with WinDBG in one of its functions but it doesn't complete the function names while on IDA it shows the names (statically).

Here is a picture of IDA (with the name of the last three functions) and on the right, WinDBG without the name:
enter image description here

I read about similar issue Why doesn't WinDbg resolve the function names? and I tried the suggestion by running:

.symfix C:\debug\symbols
.sympath+ C:\debug\mypdbs
.reload /f

I re-opened the disassembly window and I still don't see the function names.

EDIT (answer to questions):

  1. Windbg Preview version:
Debugger client version: 1.0.2007.06001  
Debugger engine version: 10.0.20153.1000  
  1. OS version of the guest: Windows 10 x64 1909 (OS Build 18363.1082)

  2. Output of lm m cfs:

kd> lm m cfs
Browse full module list
start             end                 module name
fffff800`2abd0000 fffff800`2abd0c00   cfs        (no symbols)    
  1. The symbol path is set up with:
SRV*c:\symbols*https://msdl.microsoft.com/download/symbols

So I think it is loaded although in section 3 it wrote "no symbols".
I also run .reload /f but it didn't help.

  1. Yes it works but only if I set breakpoint on the call itself:
kd> u fffff802`504a6460
nt!RtlInitUnicodeString:
fffff802`504a6460 48c70100000000  mov     qword ptr [rcx],0
fffff802`504a6467 48895108        mov     qword ptr [rcx+8],rdx
fffff802`504a646b 4885d2          test    rdx,rdx
fffff802`504a646e 7501            jne     nt!RtlInitUnicodeString+0x11 (fffff802`504a6471)
fffff802`504a6470 c3              ret
fffff802`504a6471 48c7c0ffffffff  mov     rax,0FFFFFFFFFFFFFFFFh
fffff802`504a6478 0f1f840000000000 nop     dword ptr [rax+rax]
fffff802`504a6480 48ffc0          inc     rax

You can see that it resolve the name nt!RtlInitUnicodeString but only once it hit the breakpoint, you can see that it didn't resolve the two next instructions:
enter image description here

6.

kd> ln fffff802`504a6460
Browse module
Set bu breakpoint

(fffff802`504a6460)   nt!RtlInitUnicodeString   |  (fffff802`504a64b0)   nt!KeEnterCriticalRegion
Exact matches:
    nt!RtlInitUnicodeString (void)
  1. They are being downloaded dynmaically:

    SRVc:\symbolshttps://msdl.microsoft.com/download/symbols

In the environment varible I have it set:

_NT_SYMBOL_PATH
SRV*c:\symbols*https://msdl.microsoft.com/download/symbols
  1. I am not sure what you mean, there are lots of modules, I need to go to each module and pass it?
    Not sure how to do it.
5
  • 1
    what is thewindbg version ? , what is the os ? , is it windbg preview? – blabb Oct 7 '20 at 5:07
  • @blabb I think the old one didn't have the ability to appear colored this way, right? But good point. – 0xC0000022L Oct 7 '20 at 9:50
  • 1
    Actually I am using WinDBG preview so this is the new one 1.0.2007.06001 – E235 Oct 7 '20 at 11:25
  • 1
    @0xC0000022L yes the old didn't have themes builtin but some colorizer hacks do exist (using FindWindow , RegisterWindowMesssage SendMessage for example some thing that is 6 years old iirc10yearsold – blabb Oct 7 '20 at 13:27
  • @blabb I see, I wasn't aware. – 0xC0000022L Oct 7 '20 at 16:38
1

these should be comments but it grew up

  1. what is the windbg version ?
  2. what is the os version ?
  3. what is the output of lm m "your specific Module"
  4. are the symbols loaded for your Module ?
  5. have you tried disassembling with u <address> in command window as it appears you are looking at Disassembly Window
  6. did you try ln <address> to list the nearest symbol ?
  7. are symbols for os modules being downloaded dynamically using symbol server or are they already available in the sympath you give viz c:\debug\symbols
  8. if you are downloading os symbols using _NT_SYMBOL_PATH env var have you tried adding this modules pdb in that path

further queries upon edit by OP

lm m pattern shows no symbols
so it means the symbols for your specific module is not is not loaded.

here is an output for avast antivirus modules

kd> lm m aswh*
start    end        module name
67670000 67680000   aswhook    (no symbols)
kd> x aswhook!*
kd> lm m aswAr*
start    end        module name
89563000 8956b000   aswArDisk   (export symbols)       aswArDisk.sys
8f580000 8f5bd000   aswArPot   (no symbols)
kd> x aswar*!a
kd> x aswar*!a*
89564810          aswArDisk!ArDiskRegisterCallback (<no parameter info>)
kd>

so check if you have the cfs.pdb it may happen that you have cfs.pdb but it is mismatched and windbg refuses to load it (you can override this behavior if needed with .symopt+)

turn on noisy symbol loading and try loading the symbols again you may get some clues

kd> !sym noisy
noisy mode - symbol prompts off

kd> .reload /f aswh*
SYMSRV:  BYINDEX: 0x4E1
         e:\symbols*http://msdl.microsoft.com/download/symbols
         aswhook.pdb
         0213A2A553DE465F9D36B7374431DBF61
SYMSRV:  UNC: e:\symbols\aswhook.pdb\0213A2A553DE465F9D36B7374431DBF61\aswhook.pdb - path not found
SYMSRV:  UNC: e:\symbols\aswhook.pdb\0213A2A553DE465F9D36B7374431DBF61\aswhook.pd_ - path not found
SYMSRV:  UNC: e:\symbols\aswhook.pdb\0213A2A553DE465F9D36B7374431DBF61\file.ptr - path not found
SYMSRV:  HTTPGET: /download/symbols/aswhook.pdb/0213A2A553DE465F9D36B7374431DBF61/aswhook.pdb
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  HTTPGET: /download/symbols/aswhook.pdb/0213A2A553DE465F9D36B7374431DBF61/aswhook.pd_
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  HTTPGET: /download/symbols/aswhook.pdb/0213A2A553DE465F9D36B7374431DBF61/file.ptr
SYMSRV:  HttpQueryInfo: 80190194 - HTTP_STATUS_NOT_FOUND
SYMSRV:  RESULT: 0x80190194
DBGHELP: D:\BUILD\work\01\e690e03dcc42bde1\idp\build\avgast\RU_NTDLL-lH-Y2A!Win32_vs141\bin\Release_Unicode_NTDLL_vs141\Win32\aswhook.pdb - file not found
DBGHELP: aswhook - no symbols loaded
WARNING: .reload failed, module list may be incomplete
kd>

as to adding your pdb to _NT_SYMBOL_PATH read about symstore documentation you dont have to add all modules add only the specific module for which you have pdb but windbg cant find it due to various reasons (main reason being a hardcoded path to pdb in Debug Directories) which of course wont exist in your machine

Debug Directories(4)
        Type       Size     Address  Pointer
        cv           99        879c     7b9c    Format: RSDS, guid, 1, D:\BUILD\work\01\e690e03dcc42bde1\idp\build\avgast\RU_NTDLL-lH-Y2A!Win32_vs141\bin\Release_Unicode_NTDLL_vs141\Win32\aswhook.pdb
        (    12)      14        8838     7c38
        (    13)     1d0        884c     7c4c
        (    14)       0           0        0
2
  • I edit my question, see my answer to your questions. It seems that it resolves it only when I step on the instruction itself but it doesn't complete it statically. – E235 Oct 7 '20 at 11:13
  • i edited in a few more queries and suggestions take a look – blabb Oct 7 '20 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.