diff --git a/pykd/dbgclient.h b/pykd/dbgclient.h index c7d37e2..0963236 100644 --- a/pykd/dbgclient.h +++ b/pykd/dbgclient.h @@ -15,6 +15,8 @@ public: DebugCreate( __uuidof(IDebugClient4), (void **)&client ); m_ext = new DbgExt( client ); + + client->Release(); } ~dbgClient() diff --git a/pykd/dbgext.cpp b/pykd/dbgext.cpp index d4268f7..b2563df 100644 --- a/pykd/dbgext.cpp +++ b/pykd/dbgext.cpp @@ -87,6 +87,8 @@ BOOST_PYTHON_MODULE( pykd ) "Check if target system has 64 address space" ); boost::python::def( "isKernelDebugging", &isKernelDebugging, "Check if kernel dubugging is running" ); + boost::python::def( "isDumpAnalyzing", &isDumpAnalyzing, + "Check if it is a dump analyzing ( not living debuggee )" ); boost::python::def( "ptrSize", ptrSize, "Return pointer size ( in bytes )" ); boost::python::def( "reg", &loadRegister, @@ -338,7 +340,28 @@ BOOST_PYTHON_MODULE( pykd ) _DEF_PY_CONST(DEBUG_EVENT_CHANGE_DEBUGGEE_STATE); _DEF_PY_CONST(DEBUG_EVENT_CHANGE_ENGINE_STATE); _DEF_PY_CONST(DEBUG_EVENT_CHANGE_SYMBOL_STATE); + + // debugger type + //_DEF_PY_CONST(DEBUG_CLASS_UNINITIALIZED); + //_DEF_PY_CONST(DEBUG_CLASS_KERNEL); + //_DEF_PY_CONST(DEBUG_CLASS_USER_WINDOWS); + //_DEF_PY_CONST(DEBUG_CLASS_IMAGE_FILE); + // + //_DEF_PY_CONST(DEBUG_KERNEL_CONNECTION); + //_DEF_PY_CONST(DEBUG_KERNEL_LOCAL); + //_DEF_PY_CONST(DEBUG_KERNEL_EXDI_DRIVER); + //_DEF_PY_CONST(DEBUG_KERNEL_IDNA); + //_DEF_PY_CONST(DEBUG_KERNEL_SMALL_DUMP); + //_DEF_PY_CONST(DEBUG_KERNEL_DUMP); + //_DEF_PY_CONST(DEBUG_KERNEL_FULL_DUMP); + //_DEF_PY_CONST(DEBUG_USER_WINDOWS_PROCESS); + //_DEF_PY_CONST(DEBUG_USER_WINDOWS_PROCESS_SERVER); + //_DEF_PY_CONST(DEBUG_USER_WINDOWS_IDNA); + //_DEF_PY_CONST(DEBUG_USER_WINDOWS_SMALL_DUMP); + //_DEF_PY_CONST(DEBUG_USER_WINDOWS_SMALL_DUMP); + //_DEF_PY_CONST(DEBUG_USER_WINDOWS_DUMP); + //_DEF_PY_CONST(DEBUG_USER_WINDOWS_DUMP_WINDOWS_CE); } #undef _DEF_PY_CONST diff --git a/pykd/dbgsystem.cpp b/pykd/dbgsystem.cpp index e793ceb..d8c3a13 100644 --- a/pykd/dbgsystem.cpp +++ b/pykd/dbgsystem.cpp @@ -179,3 +179,34 @@ isKernelDebugging() /////////////////////////////////////////////////////////////////////////////////// +bool +isDumpAnalyzing() +{ + HRESULT hres; + bool result = false; + + try { + + ULONG debugClass, debugQualifier; + + hres = dbgExt->control->GetDebuggeeType( &debugClass, &debugQualifier ); + + if ( FAILED( hres ) ) + throw DbgException( "IDebugControl::GetDebuggeeType failed" ); + + result = debugQualifier >= DEBUG_DUMP_SMALL; + + } + catch( std::exception &e ) + { + dbgExt->control->Output( DEBUG_OUTPUT_ERROR, "pykd error: %s\n", e.what() ); + } + catch(...) + { + dbgExt->control->Output( DEBUG_OUTPUT_ERROR, "pykd unexpected error\n" ); + } + + return result; +} + +/////////////////////////////////////////////////////////////////////////////////// diff --git a/pykd/dbgsystem.h b/pykd/dbgsystem.h index 75d3250..7b52da9 100644 --- a/pykd/dbgsystem.h +++ b/pykd/dbgsystem.h @@ -25,4 +25,7 @@ reloadModule( const char * moduleName ); bool isKernelDebugging(); +bool +isDumpAnalyzing(); + ///////////////////////////////////////////////////////////////////////////////// \ No newline at end of file