-
-
[旧帖] [求助]编写windbg扩展程序,扩展程序如何调用非扩展命令,求解 0.00雪花
-
发表于: 2015-10-22 17:27 1195
-
BOOL CDumpCallstackMgr::InitInterface()
{
HRESULT hr = S_OK;
hr = DebugCreate(__uuidof(IDebugClient), (LPVOID*)&m_sptrDebugClient);
if(FAILED(hr))
return FALSE;
hr = m_sptrDebugClient->QueryInterface(__uuidof(IDebugControl), (LPVOID*)&m_sptrDebugControl);
if(FAILED(hr))
return FALSE;
hr = m_sptrDebugClient->QueryInterface(__uuidof(IDebugSymbols), (LPVOID*)&m_sptrDebugSymbols);
if(FAILED(hr))
return FALSE;
return TRUE;
}
BOOL CDumpCallstackMgr::OpenAndAnalyizeDumpFile()
{
if (!InitInterface())
return FALSE;
HRESULT hr = S_OK;
if (m_sptrDebugSymbols && !m_strSymbolPath.empty())
{
hr = m_sptrDebugSymbols->SetSymbolPath(m_strSymbolPath.c_str());
if (FAILED(hr)) return FALSE;
}
hr = m_sptrDebugClient->SetOutputCallbacks(&m_dumpOutputMgr);
hr = m_sptrDebugClient->OpenDumpFile(m_strDumpFilePath.c_str());
if (FAILED(hr)) return FALSE;
hr = m_sptrDebugControl->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE);
if (FAILED(hr)) return FALSE;
m_strOutputCallStackInfo += m_dumpOutputMgr.GetOutputInfo();
if (m_strOutputCallStackInfo.empty()) return FALSE;
//调用!analyze -v
m_dumpOutputMgr.CleanOutputBuffer();
hr = m_sptrDebugControl->Execute( DEBUG_OUTCTL_THIS_CLIENT | DEBUG_OUTCTL_OVERRIDE_MASK | DEBUG_OUTCTL_NOT_LOGGED, "!analyze -v", DEBUG_EXECUTE_DEFAULT );
if (FAILED(hr))return FALSE;
//调用lm命令怎么搞?求解
return TRUE;
}
windbg扩展程序,如何调用非扩展命令 如:lm , lmvm等。
{
HRESULT hr = S_OK;
hr = DebugCreate(__uuidof(IDebugClient), (LPVOID*)&m_sptrDebugClient);
if(FAILED(hr))
return FALSE;
hr = m_sptrDebugClient->QueryInterface(__uuidof(IDebugControl), (LPVOID*)&m_sptrDebugControl);
if(FAILED(hr))
return FALSE;
hr = m_sptrDebugClient->QueryInterface(__uuidof(IDebugSymbols), (LPVOID*)&m_sptrDebugSymbols);
if(FAILED(hr))
return FALSE;
return TRUE;
}
BOOL CDumpCallstackMgr::OpenAndAnalyizeDumpFile()
{
if (!InitInterface())
return FALSE;
HRESULT hr = S_OK;
if (m_sptrDebugSymbols && !m_strSymbolPath.empty())
{
hr = m_sptrDebugSymbols->SetSymbolPath(m_strSymbolPath.c_str());
if (FAILED(hr)) return FALSE;
}
hr = m_sptrDebugClient->SetOutputCallbacks(&m_dumpOutputMgr);
hr = m_sptrDebugClient->OpenDumpFile(m_strDumpFilePath.c_str());
if (FAILED(hr)) return FALSE;
hr = m_sptrDebugControl->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE);
if (FAILED(hr)) return FALSE;
m_strOutputCallStackInfo += m_dumpOutputMgr.GetOutputInfo();
if (m_strOutputCallStackInfo.empty()) return FALSE;
//调用!analyze -v
m_dumpOutputMgr.CleanOutputBuffer();
hr = m_sptrDebugControl->Execute( DEBUG_OUTCTL_THIS_CLIENT | DEBUG_OUTCTL_OVERRIDE_MASK | DEBUG_OUTCTL_NOT_LOGGED, "!analyze -v", DEBUG_EXECUTE_DEFAULT );
if (FAILED(hr))return FALSE;
//调用lm命令怎么搞?求解
return TRUE;
}
windbg扩展程序,如何调用非扩展命令 如:lm , lmvm等。
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
赞赏
看原图
赞赏
雪币:
留言: