How to avoid the DbgCommand command being written to the logfile

后端 未结 3 643
耶瑟儿~
耶瑟儿~ 2021-01-21 01:45

I\'m having an annoying issue with Pykd.pyd: I\'m using it in a script, launching several DbgCommand functions, like:

DbgCommand(\"dt 0         


        
相关标签:
3条回答
  • 2021-01-21 02:18

    Use pykd.typedVar class. It is specialy designed for such cases

    0 讨论(0)
  • 2021-01-21 02:18

    try to change:

    dt 0x000000eab87488f0 CMap<int,int,CUIntArray *,CUIntArray *> m_nCount
    

    to:

    var =  typedVar("CMap<int,int,CUIntArray *,CUIntArray *>", 0x000000eab87488f0 )
    print var
    print var.m_nCount
    print var.m_nCount * 2
    

    You can get access to any filed of CMap class and work with its as they are natural python types

    If you are going to get typedVar multiple times you can cache type information to avoid performance problems:

    CMap = typeInfo("CMap<int,int,CUIntArray *,CUIntArray *>")
    var = typedVar( CMap, 0x000000eab87488f0 )
    
    0 讨论(0)
  • 2021-01-21 02:30

    Try to enumerate types for your module ( with wildcard mask ) and find exact symbol name for CMap.

    app = pykd.module("<application_name>")
    for tp in app.enumTypes("CMap*"):
       print tp
    

    I can try to reproduce an issue on a small example, but I need to know your Visual Studio version.

    0 讨论(0)
提交回复
热议问题