How to escape an asterisk in a Python related library?










1















I'm working with PYKD, a library, used for writing Python scripts for Windbg.



One of the functions, typedVar, seems not to work when handling type names who contain an asterisk:



(In a Windbg session):



.load pykd.pyd // Load PYKD library
!py // enter an interactive Python session

>>> print typedVar('CMap<unsigned long,unsigned long,int,int>', 0x02d729dc).m_nCount
Int4B at 0x2d729e8 Value: 0x4 (4)
=> ok!
>>> print typedVar('CMap<int,int,ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > > >', 0x02ca2568).m_nCount
Int4B at 0x2ca2574 Value: 0x7 (7)
=> ok!

>>> print typedVar('CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void *,void *> : invalid type name
=> NOK (most probably because of the asterisk)


I believe this is caused by the asterisk, being interpreted as a wildcard, so I'd like to use an escape character, in order to use the asterisk as a "normal" character, but this seems not to be that simple:



Using a backslash:



>>> print typedVar('CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void *,void *> : invalid type name


Doubling the asterisk:



>>> print typedVar('CMap<int,int,void **,void **>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void **,void **> : invalid type name


Does anybody know the escape character for regular expressions in Python (in case it's not a backslash or doubling the character)?



Thanks in advance



Oh, before I forget: the mentioned type is present in the application's symbols, as you can see here:



for tp in app.enumTypes("*CMap<*"):
print tp
...
CMap<int,int,void *,void *>
...


Edit after first comment and reply



These are the commands I used (with the r and the u):



>>> print typedVar(r'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(u'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(rr'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(r'''CMap<int,int,void *,void *>''', 0x0054ac10).m_nCount
>>> print typedVar(r''CMap<int,int,void *,void *>'', 0x0054ac10).m_nCount
>>> print typedVar(ru'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(ru'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount


Edit after further use of the newest PYKD library



Unfortunately there still is an issue, as you can see from following excerpt:



0:000> .load pykd.pyd
0:000> .chain
Extension DLL search Path:
...
Extension DLL chain:
pykd.pyd: image 0.3.4.2, API 1.0.0, built Sat Nov 17 13:06:54 2018
[path: C:Program Files (x86)Windows Kits10Debuggersx86winextpykd.pyd]
...
0:000> !py

>>> dprintln("%d" % typedVar('Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>', 0x064ad440).m_nCount)
2
=> An asterisk in the type name can sometimes be handled
>>> dprintln("%d" % typedVar('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>', 0x064ad328).m_nCount)
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: typed var has no field 'm_nCount'
=> But sometimes there still are issues.
The error message clearly shows that the typename is known.


What might be the issue here? Can I do anything to add more detailed debugging information?



Edit after new proposal from ussrhero



typeInfo seems to be empty:



>>> print(typeInfo('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>'))
class/struct : CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> Size: 0x0 (0)


Here another CMap related typeInfo for reference reasons:



>>> print(typeInfo('Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>'))
class/struct : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> Size: 0x1c (28)
+0000 __VFN_table : VTable*
=0000000000 classCObject : CRuntimeClass
+0004 m_pHashTable : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc**
+0008 m_nHashTableSize : UInt4B
+000c m_nCount : Int4B
+0010 m_pFreeList : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc*
+0014 m_pBlocks : CPlex*
+0018 m_nBlockSize : Int4B


Here a typeInfo of a non-existing class (also for reference reasons):



>>> print(typeInfo('Application!NonExisting_Class'))
Traceback (most recent call last):
File "<console>", line 1, in <module>
SymbolException: 'NonExisting_Class' - symbol not found


=> So the class, giving the problem, is known, but can apparently not be handled.



Edit after last update from ussrhero:



dt and dx seem to mention everything is ok for the other CMap:



0:000> dt 0x064ad440 CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
+0x000 __VFN_table : 0x01503444
+0x004 m_pHashTable : 0x06ab9ad0 -> (null)
+0x008 m_nHashTableSize : 0x186ab
+0x00c m_nCount : 0n2
+0x010 m_pFreeList : 0x063c953c CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc
+0x014 m_pBlocks : 0x063c9518 CPlex
+0x018 m_nBlockSize : 0n10
0:000> dt 0x064ad440 CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> m_nCount
Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
+0x00c m_nCount : 0n2
0:000> dx (CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>*) 0x064ad440
(CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>*) 0x064ad440 : 0x64ad440 [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> *]
[+0x004] m_pHashTable : 0x6ab9ad0 [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc * *]
[+0x008] m_nHashTableSize : 0x186ab [Type: unsigned int]
[+0x00c] m_nCount : 2 [Type: int]
[+0x010] m_pFreeList : 0x63c953c [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc *]
[+0x014] m_pBlocks : 0x63c9518 [Type: CPlex *]
[+0x018] m_nBlockSize : 10 [Type: int]


dt and dx seem to mention there is a problem for that particular CMap:



0:000> dt 0x064ad328 CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
0:000> dt 0x064ad328 CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> m_nCount
Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
0:000> dx (CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>*) 0x064ad328
Error: Unable to find type 'CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> *' for cast.


However, the symbols seem not to have a problem:



0:000> x /2 Application!CMap<*vftable*
...
0152e944 Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>::`vftable'
...
01503444 Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::`vftable'


Apparently we are dealing here with a Windbg issue. How can we find out if this is a known Windbg issue or a new one? Where are those issues collected? (For your info, I'm working with Windbg 10.0.16299.15 X86 for Windows 10, Version 1803 (OS Build 17134.345), but also Windbg Preview seems to have this bug.










share|improve this question
























  • Have you tried typedVar(r'CMap***...') (note the r)?

    – Jan
    Nov 12 '18 at 15:31











  • @Jan: thanks for the quick reply, but adding the r, or u, or ru, ..., does not solve the problem.

    – Dominique
    Nov 12 '18 at 15:43











  • Potentially related: stackoverflow.com/questions/46235976/…

    – Thomas Weller
    Nov 12 '18 at 23:38











  • @ThomasWeller: my question is a consequence of my original question "stackoverflow.com/questions/47651846/…", and after having visited the URL you mentioned, I believe you're on the right track for solving my original question. Unfortunately my tryouts, using the "@!" prefix seem not to work. Can you have a look at my original question and see how it can be handled? Thanks in advance.

    – Dominique
    Nov 13 '18 at 8:01











  • Wow. Unfortunately I broke PyKd on my machine. I'll try again in a virtual machine. Is it possible for you to provide the C++ code as a Minimal, Complete, and Verifiable example so that I can focus on the PyKd part and don't need to bother with implementation?

    – Thomas Weller
    Nov 13 '18 at 9:28
















1















I'm working with PYKD, a library, used for writing Python scripts for Windbg.



One of the functions, typedVar, seems not to work when handling type names who contain an asterisk:



(In a Windbg session):



.load pykd.pyd // Load PYKD library
!py // enter an interactive Python session

>>> print typedVar('CMap<unsigned long,unsigned long,int,int>', 0x02d729dc).m_nCount
Int4B at 0x2d729e8 Value: 0x4 (4)
=> ok!
>>> print typedVar('CMap<int,int,ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > > >', 0x02ca2568).m_nCount
Int4B at 0x2ca2574 Value: 0x7 (7)
=> ok!

>>> print typedVar('CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void *,void *> : invalid type name
=> NOK (most probably because of the asterisk)


I believe this is caused by the asterisk, being interpreted as a wildcard, so I'd like to use an escape character, in order to use the asterisk as a "normal" character, but this seems not to be that simple:



Using a backslash:



>>> print typedVar('CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void *,void *> : invalid type name


Doubling the asterisk:



>>> print typedVar('CMap<int,int,void **,void **>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void **,void **> : invalid type name


Does anybody know the escape character for regular expressions in Python (in case it's not a backslash or doubling the character)?



Thanks in advance



Oh, before I forget: the mentioned type is present in the application's symbols, as you can see here:



for tp in app.enumTypes("*CMap<*"):
print tp
...
CMap<int,int,void *,void *>
...


Edit after first comment and reply



These are the commands I used (with the r and the u):



>>> print typedVar(r'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(u'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(rr'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(r'''CMap<int,int,void *,void *>''', 0x0054ac10).m_nCount
>>> print typedVar(r''CMap<int,int,void *,void *>'', 0x0054ac10).m_nCount
>>> print typedVar(ru'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(ru'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount


Edit after further use of the newest PYKD library



Unfortunately there still is an issue, as you can see from following excerpt:



0:000> .load pykd.pyd
0:000> .chain
Extension DLL search Path:
...
Extension DLL chain:
pykd.pyd: image 0.3.4.2, API 1.0.0, built Sat Nov 17 13:06:54 2018
[path: C:Program Files (x86)Windows Kits10Debuggersx86winextpykd.pyd]
...
0:000> !py

>>> dprintln("%d" % typedVar('Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>', 0x064ad440).m_nCount)
2
=> An asterisk in the type name can sometimes be handled
>>> dprintln("%d" % typedVar('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>', 0x064ad328).m_nCount)
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: typed var has no field 'm_nCount'
=> But sometimes there still are issues.
The error message clearly shows that the typename is known.


What might be the issue here? Can I do anything to add more detailed debugging information?



Edit after new proposal from ussrhero



typeInfo seems to be empty:



>>> print(typeInfo('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>'))
class/struct : CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> Size: 0x0 (0)


Here another CMap related typeInfo for reference reasons:



>>> print(typeInfo('Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>'))
class/struct : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> Size: 0x1c (28)
+0000 __VFN_table : VTable*
=0000000000 classCObject : CRuntimeClass
+0004 m_pHashTable : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc**
+0008 m_nHashTableSize : UInt4B
+000c m_nCount : Int4B
+0010 m_pFreeList : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc*
+0014 m_pBlocks : CPlex*
+0018 m_nBlockSize : Int4B


Here a typeInfo of a non-existing class (also for reference reasons):



>>> print(typeInfo('Application!NonExisting_Class'))
Traceback (most recent call last):
File "<console>", line 1, in <module>
SymbolException: 'NonExisting_Class' - symbol not found


=> So the class, giving the problem, is known, but can apparently not be handled.



Edit after last update from ussrhero:



dt and dx seem to mention everything is ok for the other CMap:



0:000> dt 0x064ad440 CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
+0x000 __VFN_table : 0x01503444
+0x004 m_pHashTable : 0x06ab9ad0 -> (null)
+0x008 m_nHashTableSize : 0x186ab
+0x00c m_nCount : 0n2
+0x010 m_pFreeList : 0x063c953c CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc
+0x014 m_pBlocks : 0x063c9518 CPlex
+0x018 m_nBlockSize : 0n10
0:000> dt 0x064ad440 CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> m_nCount
Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
+0x00c m_nCount : 0n2
0:000> dx (CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>*) 0x064ad440
(CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>*) 0x064ad440 : 0x64ad440 [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> *]
[+0x004] m_pHashTable : 0x6ab9ad0 [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc * *]
[+0x008] m_nHashTableSize : 0x186ab [Type: unsigned int]
[+0x00c] m_nCount : 2 [Type: int]
[+0x010] m_pFreeList : 0x63c953c [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc *]
[+0x014] m_pBlocks : 0x63c9518 [Type: CPlex *]
[+0x018] m_nBlockSize : 10 [Type: int]


dt and dx seem to mention there is a problem for that particular CMap:



0:000> dt 0x064ad328 CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
0:000> dt 0x064ad328 CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> m_nCount
Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
0:000> dx (CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>*) 0x064ad328
Error: Unable to find type 'CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> *' for cast.


However, the symbols seem not to have a problem:



0:000> x /2 Application!CMap<*vftable*
...
0152e944 Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>::`vftable'
...
01503444 Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::`vftable'


Apparently we are dealing here with a Windbg issue. How can we find out if this is a known Windbg issue or a new one? Where are those issues collected? (For your info, I'm working with Windbg 10.0.16299.15 X86 for Windows 10, Version 1803 (OS Build 17134.345), but also Windbg Preview seems to have this bug.










share|improve this question
























  • Have you tried typedVar(r'CMap***...') (note the r)?

    – Jan
    Nov 12 '18 at 15:31











  • @Jan: thanks for the quick reply, but adding the r, or u, or ru, ..., does not solve the problem.

    – Dominique
    Nov 12 '18 at 15:43











  • Potentially related: stackoverflow.com/questions/46235976/…

    – Thomas Weller
    Nov 12 '18 at 23:38











  • @ThomasWeller: my question is a consequence of my original question "stackoverflow.com/questions/47651846/…", and after having visited the URL you mentioned, I believe you're on the right track for solving my original question. Unfortunately my tryouts, using the "@!" prefix seem not to work. Can you have a look at my original question and see how it can be handled? Thanks in advance.

    – Dominique
    Nov 13 '18 at 8:01











  • Wow. Unfortunately I broke PyKd on my machine. I'll try again in a virtual machine. Is it possible for you to provide the C++ code as a Minimal, Complete, and Verifiable example so that I can focus on the PyKd part and don't need to bother with implementation?

    – Thomas Weller
    Nov 13 '18 at 9:28














1












1








1








I'm working with PYKD, a library, used for writing Python scripts for Windbg.



One of the functions, typedVar, seems not to work when handling type names who contain an asterisk:



(In a Windbg session):



.load pykd.pyd // Load PYKD library
!py // enter an interactive Python session

>>> print typedVar('CMap<unsigned long,unsigned long,int,int>', 0x02d729dc).m_nCount
Int4B at 0x2d729e8 Value: 0x4 (4)
=> ok!
>>> print typedVar('CMap<int,int,ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > > >', 0x02ca2568).m_nCount
Int4B at 0x2ca2574 Value: 0x7 (7)
=> ok!

>>> print typedVar('CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void *,void *> : invalid type name
=> NOK (most probably because of the asterisk)


I believe this is caused by the asterisk, being interpreted as a wildcard, so I'd like to use an escape character, in order to use the asterisk as a "normal" character, but this seems not to be that simple:



Using a backslash:



>>> print typedVar('CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void *,void *> : invalid type name


Doubling the asterisk:



>>> print typedVar('CMap<int,int,void **,void **>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void **,void **> : invalid type name


Does anybody know the escape character for regular expressions in Python (in case it's not a backslash or doubling the character)?



Thanks in advance



Oh, before I forget: the mentioned type is present in the application's symbols, as you can see here:



for tp in app.enumTypes("*CMap<*"):
print tp
...
CMap<int,int,void *,void *>
...


Edit after first comment and reply



These are the commands I used (with the r and the u):



>>> print typedVar(r'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(u'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(rr'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(r'''CMap<int,int,void *,void *>''', 0x0054ac10).m_nCount
>>> print typedVar(r''CMap<int,int,void *,void *>'', 0x0054ac10).m_nCount
>>> print typedVar(ru'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(ru'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount


Edit after further use of the newest PYKD library



Unfortunately there still is an issue, as you can see from following excerpt:



0:000> .load pykd.pyd
0:000> .chain
Extension DLL search Path:
...
Extension DLL chain:
pykd.pyd: image 0.3.4.2, API 1.0.0, built Sat Nov 17 13:06:54 2018
[path: C:Program Files (x86)Windows Kits10Debuggersx86winextpykd.pyd]
...
0:000> !py

>>> dprintln("%d" % typedVar('Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>', 0x064ad440).m_nCount)
2
=> An asterisk in the type name can sometimes be handled
>>> dprintln("%d" % typedVar('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>', 0x064ad328).m_nCount)
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: typed var has no field 'm_nCount'
=> But sometimes there still are issues.
The error message clearly shows that the typename is known.


What might be the issue here? Can I do anything to add more detailed debugging information?



Edit after new proposal from ussrhero



typeInfo seems to be empty:



>>> print(typeInfo('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>'))
class/struct : CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> Size: 0x0 (0)


Here another CMap related typeInfo for reference reasons:



>>> print(typeInfo('Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>'))
class/struct : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> Size: 0x1c (28)
+0000 __VFN_table : VTable*
=0000000000 classCObject : CRuntimeClass
+0004 m_pHashTable : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc**
+0008 m_nHashTableSize : UInt4B
+000c m_nCount : Int4B
+0010 m_pFreeList : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc*
+0014 m_pBlocks : CPlex*
+0018 m_nBlockSize : Int4B


Here a typeInfo of a non-existing class (also for reference reasons):



>>> print(typeInfo('Application!NonExisting_Class'))
Traceback (most recent call last):
File "<console>", line 1, in <module>
SymbolException: 'NonExisting_Class' - symbol not found


=> So the class, giving the problem, is known, but can apparently not be handled.



Edit after last update from ussrhero:



dt and dx seem to mention everything is ok for the other CMap:



0:000> dt 0x064ad440 CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
+0x000 __VFN_table : 0x01503444
+0x004 m_pHashTable : 0x06ab9ad0 -> (null)
+0x008 m_nHashTableSize : 0x186ab
+0x00c m_nCount : 0n2
+0x010 m_pFreeList : 0x063c953c CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc
+0x014 m_pBlocks : 0x063c9518 CPlex
+0x018 m_nBlockSize : 0n10
0:000> dt 0x064ad440 CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> m_nCount
Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
+0x00c m_nCount : 0n2
0:000> dx (CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>*) 0x064ad440
(CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>*) 0x064ad440 : 0x64ad440 [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> *]
[+0x004] m_pHashTable : 0x6ab9ad0 [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc * *]
[+0x008] m_nHashTableSize : 0x186ab [Type: unsigned int]
[+0x00c] m_nCount : 2 [Type: int]
[+0x010] m_pFreeList : 0x63c953c [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc *]
[+0x014] m_pBlocks : 0x63c9518 [Type: CPlex *]
[+0x018] m_nBlockSize : 10 [Type: int]


dt and dx seem to mention there is a problem for that particular CMap:



0:000> dt 0x064ad328 CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
0:000> dt 0x064ad328 CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> m_nCount
Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
0:000> dx (CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>*) 0x064ad328
Error: Unable to find type 'CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> *' for cast.


However, the symbols seem not to have a problem:



0:000> x /2 Application!CMap<*vftable*
...
0152e944 Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>::`vftable'
...
01503444 Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::`vftable'


Apparently we are dealing here with a Windbg issue. How can we find out if this is a known Windbg issue or a new one? Where are those issues collected? (For your info, I'm working with Windbg 10.0.16299.15 X86 for Windows 10, Version 1803 (OS Build 17134.345), but also Windbg Preview seems to have this bug.










share|improve this question
















I'm working with PYKD, a library, used for writing Python scripts for Windbg.



One of the functions, typedVar, seems not to work when handling type names who contain an asterisk:



(In a Windbg session):



.load pykd.pyd // Load PYKD library
!py // enter an interactive Python session

>>> print typedVar('CMap<unsigned long,unsigned long,int,int>', 0x02d729dc).m_nCount
Int4B at 0x2d729e8 Value: 0x4 (4)
=> ok!
>>> print typedVar('CMap<int,int,ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > > >', 0x02ca2568).m_nCount
Int4B at 0x2ca2574 Value: 0x7 (7)
=> ok!

>>> print typedVar('CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void *,void *> : invalid type name
=> NOK (most probably because of the asterisk)


I believe this is caused by the asterisk, being interpreted as a wildcard, so I'd like to use an escape character, in order to use the asterisk as a "normal" character, but this seems not to be that simple:



Using a backslash:



>>> print typedVar('CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void *,void *> : invalid type name


Doubling the asterisk:



>>> print typedVar('CMap<int,int,void **,void **>', 0x0054ac10).m_nCount
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeException: CMap<int,int,void **,void **> : invalid type name


Does anybody know the escape character for regular expressions in Python (in case it's not a backslash or doubling the character)?



Thanks in advance



Oh, before I forget: the mentioned type is present in the application's symbols, as you can see here:



for tp in app.enumTypes("*CMap<*"):
print tp
...
CMap<int,int,void *,void *>
...


Edit after first comment and reply



These are the commands I used (with the r and the u):



>>> print typedVar(r'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(u'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(rr'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(r'''CMap<int,int,void *,void *>''', 0x0054ac10).m_nCount
>>> print typedVar(r''CMap<int,int,void *,void *>'', 0x0054ac10).m_nCount
>>> print typedVar(ru'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount
>>> print typedVar(ru'CMap<int,int,void *,void *>', 0x0054ac10).m_nCount


Edit after further use of the newest PYKD library



Unfortunately there still is an issue, as you can see from following excerpt:



0:000> .load pykd.pyd
0:000> .chain
Extension DLL search Path:
...
Extension DLL chain:
pykd.pyd: image 0.3.4.2, API 1.0.0, built Sat Nov 17 13:06:54 2018
[path: C:Program Files (x86)Windows Kits10Debuggersx86winextpykd.pyd]
...
0:000> !py

>>> dprintln("%d" % typedVar('Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>', 0x064ad440).m_nCount)
2
=> An asterisk in the type name can sometimes be handled
>>> dprintln("%d" % typedVar('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>', 0x064ad328).m_nCount)
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: typed var has no field 'm_nCount'
=> But sometimes there still are issues.
The error message clearly shows that the typename is known.


What might be the issue here? Can I do anything to add more detailed debugging information?



Edit after new proposal from ussrhero



typeInfo seems to be empty:



>>> print(typeInfo('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>'))
class/struct : CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> Size: 0x0 (0)


Here another CMap related typeInfo for reference reasons:



>>> print(typeInfo('Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>'))
class/struct : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> Size: 0x1c (28)
+0000 __VFN_table : VTable*
=0000000000 classCObject : CRuntimeClass
+0004 m_pHashTable : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc**
+0008 m_nHashTableSize : UInt4B
+000c m_nCount : Int4B
+0010 m_pFreeList : CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc*
+0014 m_pBlocks : CPlex*
+0018 m_nBlockSize : Int4B


Here a typeInfo of a non-existing class (also for reference reasons):



>>> print(typeInfo('Application!NonExisting_Class'))
Traceback (most recent call last):
File "<console>", line 1, in <module>
SymbolException: 'NonExisting_Class' - symbol not found


=> So the class, giving the problem, is known, but can apparently not be handled.



Edit after last update from ussrhero:



dt and dx seem to mention everything is ok for the other CMap:



0:000> dt 0x064ad440 CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
+0x000 __VFN_table : 0x01503444
+0x004 m_pHashTable : 0x06ab9ad0 -> (null)
+0x008 m_nHashTableSize : 0x186ab
+0x00c m_nCount : 0n2
+0x010 m_pFreeList : 0x063c953c CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc
+0x014 m_pBlocks : 0x063c9518 CPlex
+0x018 m_nBlockSize : 0n10
0:000> dt 0x064ad440 CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> m_nCount
Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>
+0x00c m_nCount : 0n2
0:000> dx (CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>*) 0x064ad440
(CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>*) 0x064ad440 : 0x64ad440 [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int> *]
[+0x004] m_pHashTable : 0x6ab9ad0 [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc * *]
[+0x008] m_nHashTableSize : 0x186ab [Type: unsigned int]
[+0x00c] m_nCount : 2 [Type: int]
[+0x010] m_pFreeList : 0x63c953c [Type: CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::CAssoc *]
[+0x014] m_pBlocks : 0x63c9518 [Type: CPlex *]
[+0x018] m_nBlockSize : 10 [Type: int]


dt and dx seem to mention there is a problem for that particular CMap:



0:000> dt 0x064ad328 CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
0:000> dt 0x064ad328 CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> m_nCount
Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>
0:000> dx (CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>*) 0x064ad328
Error: Unable to find type 'CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *> *' for cast.


However, the symbols seem not to have a problem:



0:000> x /2 Application!CMap<*vftable*
...
0152e944 Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION *,_RTL_CRITICAL_SECTION *>::`vftable'
...
01503444 Application!CMap<ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > >,wchar_t const *,unsigned int,unsigned int>::`vftable'


Apparently we are dealing here with a Windbg issue. How can we find out if this is a known Windbg issue or a new one? Where are those issues collected? (For your info, I'm working with Windbg 10.0.16299.15 X86 for Windows 10, Version 1803 (OS Build 17134.345), but also Windbg Preview seems to have this bug.







python regex escaping windbg pykd






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 4 '18 at 14:16







Dominique

















asked Nov 12 '18 at 15:24









DominiqueDominique

2,00241539




2,00241539












  • Have you tried typedVar(r'CMap***...') (note the r)?

    – Jan
    Nov 12 '18 at 15:31











  • @Jan: thanks for the quick reply, but adding the r, or u, or ru, ..., does not solve the problem.

    – Dominique
    Nov 12 '18 at 15:43











  • Potentially related: stackoverflow.com/questions/46235976/…

    – Thomas Weller
    Nov 12 '18 at 23:38











  • @ThomasWeller: my question is a consequence of my original question "stackoverflow.com/questions/47651846/…", and after having visited the URL you mentioned, I believe you're on the right track for solving my original question. Unfortunately my tryouts, using the "@!" prefix seem not to work. Can you have a look at my original question and see how it can be handled? Thanks in advance.

    – Dominique
    Nov 13 '18 at 8:01











  • Wow. Unfortunately I broke PyKd on my machine. I'll try again in a virtual machine. Is it possible for you to provide the C++ code as a Minimal, Complete, and Verifiable example so that I can focus on the PyKd part and don't need to bother with implementation?

    – Thomas Weller
    Nov 13 '18 at 9:28


















  • Have you tried typedVar(r'CMap***...') (note the r)?

    – Jan
    Nov 12 '18 at 15:31











  • @Jan: thanks for the quick reply, but adding the r, or u, or ru, ..., does not solve the problem.

    – Dominique
    Nov 12 '18 at 15:43











  • Potentially related: stackoverflow.com/questions/46235976/…

    – Thomas Weller
    Nov 12 '18 at 23:38











  • @ThomasWeller: my question is a consequence of my original question "stackoverflow.com/questions/47651846/…", and after having visited the URL you mentioned, I believe you're on the right track for solving my original question. Unfortunately my tryouts, using the "@!" prefix seem not to work. Can you have a look at my original question and see how it can be handled? Thanks in advance.

    – Dominique
    Nov 13 '18 at 8:01











  • Wow. Unfortunately I broke PyKd on my machine. I'll try again in a virtual machine. Is it possible for you to provide the C++ code as a Minimal, Complete, and Verifiable example so that I can focus on the PyKd part and don't need to bother with implementation?

    – Thomas Weller
    Nov 13 '18 at 9:28

















Have you tried typedVar(r'CMap***...') (note the r)?

– Jan
Nov 12 '18 at 15:31





Have you tried typedVar(r'CMap***...') (note the r)?

– Jan
Nov 12 '18 at 15:31













@Jan: thanks for the quick reply, but adding the r, or u, or ru, ..., does not solve the problem.

– Dominique
Nov 12 '18 at 15:43





@Jan: thanks for the quick reply, but adding the r, or u, or ru, ..., does not solve the problem.

– Dominique
Nov 12 '18 at 15:43













Potentially related: stackoverflow.com/questions/46235976/…

– Thomas Weller
Nov 12 '18 at 23:38





Potentially related: stackoverflow.com/questions/46235976/…

– Thomas Weller
Nov 12 '18 at 23:38













@ThomasWeller: my question is a consequence of my original question "stackoverflow.com/questions/47651846/…", and after having visited the URL you mentioned, I believe you're on the right track for solving my original question. Unfortunately my tryouts, using the "@!" prefix seem not to work. Can you have a look at my original question and see how it can be handled? Thanks in advance.

– Dominique
Nov 13 '18 at 8:01





@ThomasWeller: my question is a consequence of my original question "stackoverflow.com/questions/47651846/…", and after having visited the URL you mentioned, I believe you're on the right track for solving my original question. Unfortunately my tryouts, using the "@!" prefix seem not to work. Can you have a look at my original question and see how it can be handled? Thanks in advance.

– Dominique
Nov 13 '18 at 8:01













Wow. Unfortunately I broke PyKd on my machine. I'll try again in a virtual machine. Is it possible for you to provide the C++ code as a Minimal, Complete, and Verifiable example so that I can focus on the PyKd part and don't need to bother with implementation?

– Thomas Weller
Nov 13 '18 at 9:28






Wow. Unfortunately I broke PyKd on my machine. I'll try again in a virtual machine. Is it possible for you to provide the C++ code as a Minimal, Complete, and Verifiable example so that I can focus on the PyKd part and don't need to bother with implementation?

– Thomas Weller
Nov 13 '18 at 9:28













4 Answers
4






active

oldest

votes


















1














It is a pykd bug:
https://githomelab.ru/pykd/pykd/issues/33



It will be fixed next release






share|improve this answer























  • Thanks for your reply. If you reply this on my original question "stackoverflow.com/questions/47651846/…", I'll award you the bounty for it. Do you know if the issue only applies on void* or also on other pointer members?

    – Dominique
    Nov 15 '18 at 8:11












  • Any templates with * or are affected

    – ussrhero
    Nov 15 '18 at 10:23











  • try to update pykd to 0.3.4.2 pip install pykd githomelab.ru/pykd/pykd/wikis/0.3.4.2

    – ussrhero
    Nov 17 '18 at 12:33












  • Thanks. I've downloaded the latest version and I can confirm that it works: the typedVar() function is working fine now, also for templates, containing an asterisk.

    – Dominique
    Nov 19 '18 at 8:00











  • Thank you for the confirmation

    – ussrhero
    Nov 19 '18 at 9:10


















1














try to print out type information:



>>>print( typeInfo('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION,_RTL_CRITICAL_SECTION *>') )





share|improve this answer























  • Thanks for your quick reply. I've edited the question accordingly, see "Edit after new proposal from ussrhero".

    – Dominique
    Dec 4 '18 at 8:11











  • try to compare with output by dt / dx / ?? Does windbg print out this correctly?

    – ussrhero
    Dec 4 '18 at 13:30












  • I've edited the question, based on your last comment: the issue seems to be caused by Windbg, not by PYKD, as Windbg commands dt and dx also don't give a correct result.

    – Dominique
    Dec 4 '18 at 14:09











  • In the meanwhile, I've found out that the issue is caused by missing symbols (the mentioned object was embedded inside a library whose symbols are not included in the global symbols of the application), so this question can be closed.

    – Dominique
    Dec 4 '18 at 15:55


















0














Unable to comment but you could try r'string' which is explained here
What exactly do "u" and "r" string flags do, and what are raw string literals?



Or if you're able to, swap the pointer for any unsigned 64 bit data type.






share|improve this answer























  • Thanks for the quick reply, but as mentioned to Jan, I followed the advise, mentioned in the URL, but I didn't succeed.

    – Dominique
    Nov 12 '18 at 15:44


















0














typedVar does not interpet type name. You must use the same type name as it is contained in the symbol information.



Try to find it with dt command:



dt CMap*


Or with pykd:



print( "n".join( module('ModuleName').enumTypes('CMap*') )


I believe it will look like 'CMap<int,int,void*,void*>' ( without any space )






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53265233%2fhow-to-escape-an-asterisk-in-a-python-related-library%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    It is a pykd bug:
    https://githomelab.ru/pykd/pykd/issues/33



    It will be fixed next release






    share|improve this answer























    • Thanks for your reply. If you reply this on my original question "stackoverflow.com/questions/47651846/…", I'll award you the bounty for it. Do you know if the issue only applies on void* or also on other pointer members?

      – Dominique
      Nov 15 '18 at 8:11












    • Any templates with * or are affected

      – ussrhero
      Nov 15 '18 at 10:23











    • try to update pykd to 0.3.4.2 pip install pykd githomelab.ru/pykd/pykd/wikis/0.3.4.2

      – ussrhero
      Nov 17 '18 at 12:33












    • Thanks. I've downloaded the latest version and I can confirm that it works: the typedVar() function is working fine now, also for templates, containing an asterisk.

      – Dominique
      Nov 19 '18 at 8:00











    • Thank you for the confirmation

      – ussrhero
      Nov 19 '18 at 9:10















    1














    It is a pykd bug:
    https://githomelab.ru/pykd/pykd/issues/33



    It will be fixed next release






    share|improve this answer























    • Thanks for your reply. If you reply this on my original question "stackoverflow.com/questions/47651846/…", I'll award you the bounty for it. Do you know if the issue only applies on void* or also on other pointer members?

      – Dominique
      Nov 15 '18 at 8:11












    • Any templates with * or are affected

      – ussrhero
      Nov 15 '18 at 10:23











    • try to update pykd to 0.3.4.2 pip install pykd githomelab.ru/pykd/pykd/wikis/0.3.4.2

      – ussrhero
      Nov 17 '18 at 12:33












    • Thanks. I've downloaded the latest version and I can confirm that it works: the typedVar() function is working fine now, also for templates, containing an asterisk.

      – Dominique
      Nov 19 '18 at 8:00











    • Thank you for the confirmation

      – ussrhero
      Nov 19 '18 at 9:10













    1












    1








    1







    It is a pykd bug:
    https://githomelab.ru/pykd/pykd/issues/33



    It will be fixed next release






    share|improve this answer













    It is a pykd bug:
    https://githomelab.ru/pykd/pykd/issues/33



    It will be fixed next release







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 14 '18 at 21:15









    ussrheroussrhero

    44624




    44624












    • Thanks for your reply. If you reply this on my original question "stackoverflow.com/questions/47651846/…", I'll award you the bounty for it. Do you know if the issue only applies on void* or also on other pointer members?

      – Dominique
      Nov 15 '18 at 8:11












    • Any templates with * or are affected

      – ussrhero
      Nov 15 '18 at 10:23











    • try to update pykd to 0.3.4.2 pip install pykd githomelab.ru/pykd/pykd/wikis/0.3.4.2

      – ussrhero
      Nov 17 '18 at 12:33












    • Thanks. I've downloaded the latest version and I can confirm that it works: the typedVar() function is working fine now, also for templates, containing an asterisk.

      – Dominique
      Nov 19 '18 at 8:00











    • Thank you for the confirmation

      – ussrhero
      Nov 19 '18 at 9:10

















    • Thanks for your reply. If you reply this on my original question "stackoverflow.com/questions/47651846/…", I'll award you the bounty for it. Do you know if the issue only applies on void* or also on other pointer members?

      – Dominique
      Nov 15 '18 at 8:11












    • Any templates with * or are affected

      – ussrhero
      Nov 15 '18 at 10:23











    • try to update pykd to 0.3.4.2 pip install pykd githomelab.ru/pykd/pykd/wikis/0.3.4.2

      – ussrhero
      Nov 17 '18 at 12:33












    • Thanks. I've downloaded the latest version and I can confirm that it works: the typedVar() function is working fine now, also for templates, containing an asterisk.

      – Dominique
      Nov 19 '18 at 8:00











    • Thank you for the confirmation

      – ussrhero
      Nov 19 '18 at 9:10
















    Thanks for your reply. If you reply this on my original question "stackoverflow.com/questions/47651846/…", I'll award you the bounty for it. Do you know if the issue only applies on void* or also on other pointer members?

    – Dominique
    Nov 15 '18 at 8:11






    Thanks for your reply. If you reply this on my original question "stackoverflow.com/questions/47651846/…", I'll award you the bounty for it. Do you know if the issue only applies on void* or also on other pointer members?

    – Dominique
    Nov 15 '18 at 8:11














    Any templates with * or are affected

    – ussrhero
    Nov 15 '18 at 10:23





    Any templates with * or are affected

    – ussrhero
    Nov 15 '18 at 10:23













    try to update pykd to 0.3.4.2 pip install pykd githomelab.ru/pykd/pykd/wikis/0.3.4.2

    – ussrhero
    Nov 17 '18 at 12:33






    try to update pykd to 0.3.4.2 pip install pykd githomelab.ru/pykd/pykd/wikis/0.3.4.2

    – ussrhero
    Nov 17 '18 at 12:33














    Thanks. I've downloaded the latest version and I can confirm that it works: the typedVar() function is working fine now, also for templates, containing an asterisk.

    – Dominique
    Nov 19 '18 at 8:00





    Thanks. I've downloaded the latest version and I can confirm that it works: the typedVar() function is working fine now, also for templates, containing an asterisk.

    – Dominique
    Nov 19 '18 at 8:00













    Thank you for the confirmation

    – ussrhero
    Nov 19 '18 at 9:10





    Thank you for the confirmation

    – ussrhero
    Nov 19 '18 at 9:10













    1














    try to print out type information:



    >>>print( typeInfo('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION,_RTL_CRITICAL_SECTION *>') )





    share|improve this answer























    • Thanks for your quick reply. I've edited the question accordingly, see "Edit after new proposal from ussrhero".

      – Dominique
      Dec 4 '18 at 8:11











    • try to compare with output by dt / dx / ?? Does windbg print out this correctly?

      – ussrhero
      Dec 4 '18 at 13:30












    • I've edited the question, based on your last comment: the issue seems to be caused by Windbg, not by PYKD, as Windbg commands dt and dx also don't give a correct result.

      – Dominique
      Dec 4 '18 at 14:09











    • In the meanwhile, I've found out that the issue is caused by missing symbols (the mentioned object was embedded inside a library whose symbols are not included in the global symbols of the application), so this question can be closed.

      – Dominique
      Dec 4 '18 at 15:55















    1














    try to print out type information:



    >>>print( typeInfo('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION,_RTL_CRITICAL_SECTION *>') )





    share|improve this answer























    • Thanks for your quick reply. I've edited the question accordingly, see "Edit after new proposal from ussrhero".

      – Dominique
      Dec 4 '18 at 8:11











    • try to compare with output by dt / dx / ?? Does windbg print out this correctly?

      – ussrhero
      Dec 4 '18 at 13:30












    • I've edited the question, based on your last comment: the issue seems to be caused by Windbg, not by PYKD, as Windbg commands dt and dx also don't give a correct result.

      – Dominique
      Dec 4 '18 at 14:09











    • In the meanwhile, I've found out that the issue is caused by missing symbols (the mentioned object was embedded inside a library whose symbols are not included in the global symbols of the application), so this question can be closed.

      – Dominique
      Dec 4 '18 at 15:55













    1












    1








    1







    try to print out type information:



    >>>print( typeInfo('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION,_RTL_CRITICAL_SECTION *>') )





    share|improve this answer













    try to print out type information:



    >>>print( typeInfo('Application!CMap<unsigned int,unsigned int,_RTL_CRITICAL_SECTION,_RTL_CRITICAL_SECTION *>') )






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 3 '18 at 19:12









    ussrheroussrhero

    44624




    44624












    • Thanks for your quick reply. I've edited the question accordingly, see "Edit after new proposal from ussrhero".

      – Dominique
      Dec 4 '18 at 8:11











    • try to compare with output by dt / dx / ?? Does windbg print out this correctly?

      – ussrhero
      Dec 4 '18 at 13:30












    • I've edited the question, based on your last comment: the issue seems to be caused by Windbg, not by PYKD, as Windbg commands dt and dx also don't give a correct result.

      – Dominique
      Dec 4 '18 at 14:09











    • In the meanwhile, I've found out that the issue is caused by missing symbols (the mentioned object was embedded inside a library whose symbols are not included in the global symbols of the application), so this question can be closed.

      – Dominique
      Dec 4 '18 at 15:55

















    • Thanks for your quick reply. I've edited the question accordingly, see "Edit after new proposal from ussrhero".

      – Dominique
      Dec 4 '18 at 8:11











    • try to compare with output by dt / dx / ?? Does windbg print out this correctly?

      – ussrhero
      Dec 4 '18 at 13:30












    • I've edited the question, based on your last comment: the issue seems to be caused by Windbg, not by PYKD, as Windbg commands dt and dx also don't give a correct result.

      – Dominique
      Dec 4 '18 at 14:09











    • In the meanwhile, I've found out that the issue is caused by missing symbols (the mentioned object was embedded inside a library whose symbols are not included in the global symbols of the application), so this question can be closed.

      – Dominique
      Dec 4 '18 at 15:55
















    Thanks for your quick reply. I've edited the question accordingly, see "Edit after new proposal from ussrhero".

    – Dominique
    Dec 4 '18 at 8:11





    Thanks for your quick reply. I've edited the question accordingly, see "Edit after new proposal from ussrhero".

    – Dominique
    Dec 4 '18 at 8:11













    try to compare with output by dt / dx / ?? Does windbg print out this correctly?

    – ussrhero
    Dec 4 '18 at 13:30






    try to compare with output by dt / dx / ?? Does windbg print out this correctly?

    – ussrhero
    Dec 4 '18 at 13:30














    I've edited the question, based on your last comment: the issue seems to be caused by Windbg, not by PYKD, as Windbg commands dt and dx also don't give a correct result.

    – Dominique
    Dec 4 '18 at 14:09





    I've edited the question, based on your last comment: the issue seems to be caused by Windbg, not by PYKD, as Windbg commands dt and dx also don't give a correct result.

    – Dominique
    Dec 4 '18 at 14:09













    In the meanwhile, I've found out that the issue is caused by missing symbols (the mentioned object was embedded inside a library whose symbols are not included in the global symbols of the application), so this question can be closed.

    – Dominique
    Dec 4 '18 at 15:55





    In the meanwhile, I've found out that the issue is caused by missing symbols (the mentioned object was embedded inside a library whose symbols are not included in the global symbols of the application), so this question can be closed.

    – Dominique
    Dec 4 '18 at 15:55











    0














    Unable to comment but you could try r'string' which is explained here
    What exactly do "u" and "r" string flags do, and what are raw string literals?



    Or if you're able to, swap the pointer for any unsigned 64 bit data type.






    share|improve this answer























    • Thanks for the quick reply, but as mentioned to Jan, I followed the advise, mentioned in the URL, but I didn't succeed.

      – Dominique
      Nov 12 '18 at 15:44















    0














    Unable to comment but you could try r'string' which is explained here
    What exactly do "u" and "r" string flags do, and what are raw string literals?



    Or if you're able to, swap the pointer for any unsigned 64 bit data type.






    share|improve this answer























    • Thanks for the quick reply, but as mentioned to Jan, I followed the advise, mentioned in the URL, but I didn't succeed.

      – Dominique
      Nov 12 '18 at 15:44













    0












    0








    0







    Unable to comment but you could try r'string' which is explained here
    What exactly do "u" and "r" string flags do, and what are raw string literals?



    Or if you're able to, swap the pointer for any unsigned 64 bit data type.






    share|improve this answer













    Unable to comment but you could try r'string' which is explained here
    What exactly do "u" and "r" string flags do, and what are raw string literals?



    Or if you're able to, swap the pointer for any unsigned 64 bit data type.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 12 '18 at 15:38









    Reece WardReece Ward

    256




    256












    • Thanks for the quick reply, but as mentioned to Jan, I followed the advise, mentioned in the URL, but I didn't succeed.

      – Dominique
      Nov 12 '18 at 15:44

















    • Thanks for the quick reply, but as mentioned to Jan, I followed the advise, mentioned in the URL, but I didn't succeed.

      – Dominique
      Nov 12 '18 at 15:44
















    Thanks for the quick reply, but as mentioned to Jan, I followed the advise, mentioned in the URL, but I didn't succeed.

    – Dominique
    Nov 12 '18 at 15:44





    Thanks for the quick reply, but as mentioned to Jan, I followed the advise, mentioned in the URL, but I didn't succeed.

    – Dominique
    Nov 12 '18 at 15:44











    0














    typedVar does not interpet type name. You must use the same type name as it is contained in the symbol information.



    Try to find it with dt command:



    dt CMap*


    Or with pykd:



    print( "n".join( module('ModuleName').enumTypes('CMap*') )


    I believe it will look like 'CMap<int,int,void*,void*>' ( without any space )






    share|improve this answer





























      0














      typedVar does not interpet type name. You must use the same type name as it is contained in the symbol information.



      Try to find it with dt command:



      dt CMap*


      Or with pykd:



      print( "n".join( module('ModuleName').enumTypes('CMap*') )


      I believe it will look like 'CMap<int,int,void*,void*>' ( without any space )






      share|improve this answer



























        0












        0








        0







        typedVar does not interpet type name. You must use the same type name as it is contained in the symbol information.



        Try to find it with dt command:



        dt CMap*


        Or with pykd:



        print( "n".join( module('ModuleName').enumTypes('CMap*') )


        I believe it will look like 'CMap<int,int,void*,void*>' ( without any space )






        share|improve this answer















        typedVar does not interpet type name. You must use the same type name as it is contained in the symbol information.



        Try to find it with dt command:



        dt CMap*


        Or with pykd:



        print( "n".join( module('ModuleName').enumTypes('CMap*') )


        I believe it will look like 'CMap<int,int,void*,void*>' ( without any space )







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 12 '18 at 18:04

























        answered Nov 12 '18 at 17:57









        ussrheroussrhero

        44624




        44624



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53265233%2fhow-to-escape-an-asterisk-in-a-python-related-library%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kleinkühnau

            Makov (Slowakei)

            Deutsches Schauspielhaus