Why do I get a “symbol not found” for a found symbol in Pykd?

帅比萌擦擦* 提交于 2019-12-09 03:46:40

问题


I'm working on a dump, which I try to investigate, using PYKD technology.
The result of the x /2 *!*``vtable' (just one backtick) contains the following result:

745293b8          mfc110u!CPtrList::`vftable'

However, when I try to get more information about this class, I get a "symbol not found" exception:
Python source code:

dprintln("name=[%s]" % type_stats.name)
if not type_stats.name in typesize_by_type:
  try:
    type_info = typeInfo(type_stats.name)
  except Exception, e:
    dprintln("text=[%s]" % (str(e)))

Output:

name=[mfc110u!CPtrList]
text=['CPtrList' - symbol not found]

The result of the lm command returns the mfc110u symbols, as you can see here:

0:000> lm
start     end        module name
...
744f0000  74930000   mfc110u    (pdb symbols) C:\ProgramData\dbg\sym\mfc110u.i386.pdb\...\mfc110u.i386.pdb
...

For your information, I'm now working with the last version of PYKD:

0:000> .chain
Extension DLL search Path:
    ...
Extension DLL chain:
    pykd.pyd: image 0.3.3.4, API 1.0.0, built Mon May 14 11:14:43 2018
        [path: C:\Program Files (x86)\Windows Kits\10\Debuggers\x86\winext\pykd.pyd]

Meanwhile I've found a very simple way for reproducing the issue without needing to launch the whole script (using the Windbg prompt):

0:000> !py
Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> typeInfo("mfc110u!CPtrList")
Traceback (most recent call last):
  File "<console>", line 1, in <module>
SymbolException: 'CPtrList' - symbol not found

In addition to ussrhero's answer, there is following extra information:
The result of x /2 *!CPtrList* contains (amongst many others) the following results:

009530c4   <application>!CPtrList::~CPtrList
009530be   <application>!CPtrList::CPtrList
...        <application>!CPtrList::...
009abc5c   <application>!CPtrList::`RTTI Base Class Array'
009abc4c   <application>!CPtrList::`RTTI Class Hierarchy Descriptor'
009bcd18   <application>!CPtrList `RTTI Type Descriptor'
009abc30   <application>!CPtrList::`RTTI Base Class Descriptor at (0,-1,0,64)'
7464e9cb   mfc110u!CPtrList::~CPtrList
74544a04   mfc110u!CPtrList::CPtrList
...        mfc110u!CPtrList::...
745293b8   mfc110u!CPtrList::`vftable'
747510da   mfc110u!CPtrList::`vector deleting destructor'
745293cc   mfc110u!CPtrList::`RTTI Complete Object Locator'
7452940c   mfc110u!CPtrList::`RTTI Base Class Array'
745293fc   mfc110u!CPtrList::`RTTI Class Hierarchy Descriptor'
74795778   mfc110u!CPtrList `RTTI Type Descriptor'
745293e0   mfc110u!CPtrList::`RTTI Base Class Descriptor at (0,-1,0,64)'
746fdc68   mfc110u!CPtrList::classCPtrList

The script I'm using (heap_stat.py) browses through the results of !heap -h 0 and searches for the entry, corresponding with mfc110u!CPtrList::``vtable'.

The result of dt CPtrList starts with the following:

0:000> dt CPtrList
<application>!CPtrList => in other words, no 'mfcu110' entry
   +0x000 __VFN_table : Ptr32 

I'm already wondering for a long time, what's the difference between the mfc110u!CPtrList and the <application>!CPtrList entries and what's the exact role of the vtable entry in x /2 result?

Any ideas?
Thanks


回答1:


Meanwhile I've found the solution:
Apparently for some objects, the module prefix needs to be removed:

>>> typeInfo("mdf110u!CPtrList")
-> SymbolException

>>> typeInfo("CPtrList")
-> this is working!!!



回答2:


Try to see how WinDBG locates this type:

dt CPtrList

It maybe mfc110u does not contain type information fot CPtrList



来源:https://stackoverflow.com/questions/50800800/why-do-i-get-a-symbol-not-found-for-a-found-symbol-in-pykd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!