mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[0.1.x] removed : all not refactored files.
git-svn-id: https://pykd.svn.codeplex.com/svn@70174 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
d7132015d7
commit
7fb30a9912
@ -1,162 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
//#include <boost/format.hpp>
|
|
||||||
//
|
|
||||||
//#include "dbgbreak.h"
|
|
||||||
//#include "dbgexcept.h"
|
|
||||||
//#include "pyaux.h"
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//dbgBreakpointClass::breakpointMap dbgBreakpointClass::m_breakMap;
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HRESULT dbgBreakpointClass::onBreakpointEvnet( IDebugBreakpoint* bp )
|
|
||||||
//{
|
|
||||||
// PyThread_StateSave pyThreadSave;
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
// breakpointMap::iterator it = m_breakMap.find( bp );
|
|
||||||
// if ( it != m_breakMap.end() )
|
|
||||||
// {
|
|
||||||
// boost::python::object &callback = it->second->m_callback;
|
|
||||||
// if (!callback.is_none())
|
|
||||||
// return boost::python::extract<HRESULT>( callback() );
|
|
||||||
//
|
|
||||||
// return DEBUG_STATUS_BREAK;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// catch(...)
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return DEBUG_STATUS_NO_CHANGE;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//dbgBreakpointClass::dbgBreakpointClass( ULONG64 offset, boost::python::object &callback )
|
|
||||||
// : m_offset(offset)
|
|
||||||
// , m_callback(callback)
|
|
||||||
// , m_breakpoint(NULL)
|
|
||||||
//{
|
|
||||||
// set();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//dbgBreakpointClass::dbgBreakpointClass( ULONG64 offset)
|
|
||||||
// : m_offset(offset)
|
|
||||||
// , m_breakpoint(NULL)
|
|
||||||
//{
|
|
||||||
// // m_callback is None, see dbgBreakpointClass::onBreakpointEvnet
|
|
||||||
// set();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//dbgBreakpointClass::~dbgBreakpointClass()
|
|
||||||
//{
|
|
||||||
// remove();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//bool
|
|
||||||
//dbgBreakpointClass::set()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
// if ( m_breakpoint )
|
|
||||||
// return true;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->AddBreakpoint( DEBUG_BREAKPOINT_CODE, DEBUG_ANY_ID, &m_breakpoint );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::AddBreakpoint failed" );
|
|
||||||
//
|
|
||||||
// hres = m_breakpoint->SetOffset( m_offset );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugBreakpoint::SetOffset failed" );
|
|
||||||
//
|
|
||||||
// hres = m_breakpoint->SetFlags( DEBUG_BREAKPOINT_ENABLED );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugBreakpoint::SetFlags failed" );
|
|
||||||
//
|
|
||||||
// m_breakMap.insert( std::make_pair( m_breakpoint, this ) );
|
|
||||||
//
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// 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" );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// remove();
|
|
||||||
//
|
|
||||||
// return false;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//dbgBreakpointClass::remove()
|
|
||||||
//{
|
|
||||||
// if ( m_breakpoint )
|
|
||||||
// {
|
|
||||||
// dbgExt->control->RemoveBreakpoint( m_breakpoint );
|
|
||||||
//
|
|
||||||
// breakpointMap::iterator bp = m_breakMap.find( m_breakpoint );
|
|
||||||
// if ( bp != m_breakMap.end() )
|
|
||||||
// m_breakMap.erase( bp );
|
|
||||||
//
|
|
||||||
// m_breakpoint = NULL;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//dbgBreakpointClass::print() const
|
|
||||||
//{
|
|
||||||
// HRESULT status = S_OK;
|
|
||||||
//
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// if (!m_breakpoint)
|
|
||||||
// return "not set";
|
|
||||||
//
|
|
||||||
// DEBUG_BREAKPOINT_PARAMETERS params;
|
|
||||||
// status = m_breakpoint->GetParameters(¶ms);
|
|
||||||
// if (FAILED(status))
|
|
||||||
// throw DbgException("IDebugBreakpoint::GetParameters failed");
|
|
||||||
//
|
|
||||||
// boost::format fmt("%1$2d %2%%3% %4%:*** ");
|
|
||||||
// fmt % params.Id
|
|
||||||
// % (params.Flags & DEBUG_BREAKPOINT_ENABLED ? 'e' : 'd')
|
|
||||||
// % 'u'
|
|
||||||
// % params.CurrentPassCount;
|
|
||||||
//
|
|
||||||
// return fmt.str();
|
|
||||||
// }
|
|
||||||
// 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 "";
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,46 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <map>
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class dbgBreakpointClass {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// dbgBreakpointClass( ULONG64 offset, boost::python::object &callback );
|
|
||||||
// dbgBreakpointClass( ULONG64 offset );
|
|
||||||
//
|
|
||||||
// ~dbgBreakpointClass();
|
|
||||||
//
|
|
||||||
// bool
|
|
||||||
// set();
|
|
||||||
//
|
|
||||||
// void
|
|
||||||
// remove();
|
|
||||||
//
|
|
||||||
// std::string
|
|
||||||
// print() const;
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// ULONG64 m_offset;
|
|
||||||
//
|
|
||||||
// IDebugBreakpoint *m_breakpoint;
|
|
||||||
//
|
|
||||||
// boost::python::object m_callback;
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// typedef std::map<IDebugBreakpoint*, dbgBreakpointClass*> breakpointMap;
|
|
||||||
// static breakpointMap m_breakMap;
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// static HRESULT onBreakpointEvnet( IDebugBreakpoint* bp );
|
|
||||||
//
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
132
pykd/dbgcmd.cpp
132
pykd/dbgcmd.cpp
@ -1,132 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
//
|
|
||||||
//#include <boost/format.hpp>
|
|
||||||
//
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//#include "dbgcmd.h"
|
|
||||||
//#include "dbgexcept.h"
|
|
||||||
//#include "dbgio.h"
|
|
||||||
//#include "dbgsystem.h"
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//dbgCommand( const std::string &command )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// OutputReader outReader( dbgExt->client );
|
|
||||||
// {
|
|
||||||
// PyThread_StateRestore pyThreadRestore;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->Execute( DEBUG_OUTCTL_THIS_CLIENT, command.c_str(), 0 );
|
|
||||||
// }
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::Execute failed" );
|
|
||||||
//
|
|
||||||
// return std::string( outReader.Line() );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//dbgExtensionClass::dbgExtensionClass( const char* path ) : m_path(path)
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->AddExtension( path, 0, &m_handle );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::AddExtension failed" );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//dbgExtensionClass::~dbgExtensionClass()
|
|
||||||
//{
|
|
||||||
// if ( m_handle )
|
|
||||||
// dbgExt->control->RemoveExtension( m_handle );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//dbgExtensionClass::call( const std::string &command, const std::string params )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// OutputReader outReader( dbgExt->client );
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->CallExtension( m_handle, command.c_str(), params.c_str() );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::CallExtension failed" );
|
|
||||||
//
|
|
||||||
// return std::string( outReader.Line() );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//dbgExtensionClass::print() const
|
|
||||||
//{
|
|
||||||
// return m_handle ? m_path : "";
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//ULONG64
|
|
||||||
//evaluate( const std::string &expression )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
// ULONG64 value = 0;
|
|
||||||
//
|
|
||||||
// DEBUG_VALUE debugValue = {};
|
|
||||||
// ULONG remainderIndex = 0;
|
|
||||||
//
|
|
||||||
// if ( is64bitSystem() )
|
|
||||||
// {
|
|
||||||
// hres = dbgExt->control->Evaluate(
|
|
||||||
// expression.c_str(),
|
|
||||||
// DEBUG_VALUE_INT64,
|
|
||||||
// &debugValue,
|
|
||||||
// &remainderIndex );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::Evaluate failed" );
|
|
||||||
//
|
|
||||||
// if ( remainderIndex == expression.length() )
|
|
||||||
// value = debugValue.I64;
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// hres = dbgExt->control->Evaluate(
|
|
||||||
// expression.c_str(),
|
|
||||||
// DEBUG_VALUE_INT32,
|
|
||||||
// &debugValue,
|
|
||||||
// &remainderIndex );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::Evaluate failed" );
|
|
||||||
//
|
|
||||||
// if ( remainderIndex == expression.length() )
|
|
||||||
// value = debugValue.I32;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return value;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//breakin()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// {
|
|
||||||
// PyThread_StateRestore pyThreadRestore;
|
|
||||||
// hres = dbgExt->control->SetInterrupt( DEBUG_INTERRUPT_ACTIVE );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::SetInterrupt" );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,86 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <string>
|
|
||||||
//#include <map>
|
|
||||||
//#include "pyaux.h"
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//dbgCommand( const std::string &command );
|
|
||||||
//
|
|
||||||
//template <ULONG status>
|
|
||||||
//void
|
|
||||||
//setExecutionStatus()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->SetExecutionStatus( status );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::SetExecutionStatus failed" );
|
|
||||||
//
|
|
||||||
// ULONG currentStatus;
|
|
||||||
//
|
|
||||||
// do {
|
|
||||||
//
|
|
||||||
// {
|
|
||||||
// PyThread_StateRestore pyThreadRestore;
|
|
||||||
// hres = dbgExt->control->WaitForEvent( 0, INFINITE );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// {
|
|
||||||
// if (E_UNEXPECTED == hres)
|
|
||||||
// throw WaitEventException();
|
|
||||||
//
|
|
||||||
// throw DbgException( "IDebugControl::WaitForEvent failed" );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->GetExecutionStatus( ¤tStatus );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::GetExecutionStatus failed" );
|
|
||||||
//
|
|
||||||
// } while( currentStatus != DEBUG_STATUS_BREAK && currentStatus != DEBUG_STATUS_NO_DEBUGGEE );
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class dbgExtensionClass {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// dbgExtensionClass() :
|
|
||||||
// m_handle( NULL )
|
|
||||||
// {}
|
|
||||||
//
|
|
||||||
// dbgExtensionClass( const char* path );
|
|
||||||
//
|
|
||||||
// ~dbgExtensionClass();
|
|
||||||
//
|
|
||||||
// std::string
|
|
||||||
// call( const std::string &command, const std::string param );
|
|
||||||
//
|
|
||||||
// std::string
|
|
||||||
// print() const;
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// ULONG64 m_handle;
|
|
||||||
// std::string m_path;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//ULONG64
|
|
||||||
//evaluate( const std::string &expression );
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//breakin();
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
101
pykd/dbgdump.cpp
101
pykd/dbgdump.cpp
@ -1,101 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//#include "dbgdump.h"
|
|
||||||
//#include "dbgexcept.h"
|
|
||||||
//#include "dbgeventcb.h"
|
|
||||||
//#include "dbgsystem.h"
|
|
||||||
//#include "dbgcmd.h"
|
|
||||||
//#include "dbgclient.h"
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//static
|
|
||||||
//bool dbgStarted = false;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//dbgLoadDump( const std::wstring &fileName )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// if ( dbgStarted || isWindbgExt() )
|
|
||||||
// throw DbgException( "debugger is alread attached" );
|
|
||||||
//
|
|
||||||
// g_dbgClient.startEventsMgr();
|
|
||||||
//
|
|
||||||
// hres = dbgExt->client4->OpenDumpFileWide( fileName.c_str(), NULL );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugClient4::OpenDumpFileWide failed" );
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE);
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::WaitForEvent failed" );
|
|
||||||
//
|
|
||||||
// dbgStarted = true;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//startProcess( const std::wstring &processName )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// if ( dbgStarted || isWindbgExt() )
|
|
||||||
// throw DbgException( "debugger is alread attached" );
|
|
||||||
//
|
|
||||||
// g_dbgClient.startEventsMgr();
|
|
||||||
//
|
|
||||||
// ULONG opt;
|
|
||||||
// hres = dbgExt->control->GetEngineOptions( &opt );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::GetEngineOptions failed" );
|
|
||||||
//
|
|
||||||
// opt |= DEBUG_ENGOPT_INITIAL_BREAK;
|
|
||||||
// hres = dbgExt->control->SetEngineOptions( opt );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::SetEngineOptions failed" );
|
|
||||||
//
|
|
||||||
// std::vector< std::wstring::value_type> cmdLine( processName.size() + 1 );
|
|
||||||
// wcscpy_s( &cmdLine[0], cmdLine.size(), processName.c_str() );
|
|
||||||
//
|
|
||||||
// hres = dbgExt->client4->CreateProcessWide( 0, &cmdLine[0], DEBUG_PROCESS | DETACHED_PROCESS );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugClient4::CreateProcessWide failed" );
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE);
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::WaitForEvent failed" );
|
|
||||||
//
|
|
||||||
// dbgStarted = true;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//attachProcess( ULONG processId )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->client->AttachProcess( 0, processId, 0 );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugClient::AttachProcess failed" );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//attachKernel( const std::wstring param )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->client5->AttachKernelWide( DEBUG_ATTACH_KERNEL_CONNECTION, param.c_str() );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugClient5::AttachKernelWide failed" );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,19 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <string>
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//dbgLoadDump( const std::wstring &dumpName );
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//startProcess( const std::wstring &processName );
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//attachProcess( ULONG processId );
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//attachKernel( const std::wstring param );
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,217 +0,0 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//// Load/Unload module events
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
#include "stdafx.h"
|
|
||||||
//#include "dbgevent.h"
|
|
||||||
//#include "dbgio.h"
|
|
||||||
//#include "dbgexcept.h"
|
|
||||||
//#include "pyaux.h"
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//debugEvent::debugEvent()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->client->CreateClient( &m_debugClient );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugClient::CreateClient" );
|
|
||||||
//
|
|
||||||
// hres = m_debugClient->SetEventCallbacks(this);
|
|
||||||
// if (FAILED(hres))
|
|
||||||
// throw DbgException( "IDebugClient::SetEventCallbacks" );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//debugEvent::~debugEvent()
|
|
||||||
//{
|
|
||||||
// m_debugClient->SetEventCallbacks( NULL );
|
|
||||||
//
|
|
||||||
// m_debugClient->Release();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HRESULT debugEvent::GetInterestMask(
|
|
||||||
// __out PULONG Mask
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// *Mask = 0;
|
|
||||||
//
|
|
||||||
// *Mask |= DEBUG_EVENT_LOAD_MODULE;
|
|
||||||
// *Mask |= DEBUG_EVENT_UNLOAD_MODULE;
|
|
||||||
// *Mask |= DEBUG_EVENT_SESSION_STATUS;
|
|
||||||
// *Mask |= DEBUG_EVENT_EXCEPTION;
|
|
||||||
// *Mask |= DEBUG_EVENT_BREAKPOINT;
|
|
||||||
//
|
|
||||||
// return S_OK;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HRESULT debugEvent::Breakpoint(
|
|
||||||
// __in PDEBUG_BREAKPOINT Bp
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// boost::python::dict bpParameters;
|
|
||||||
//
|
|
||||||
// HRESULT hres;
|
|
||||||
// ULONG Value = 0;
|
|
||||||
// ULONG Value2 = 0;
|
|
||||||
// ULONG64 Value64 = 0;
|
|
||||||
// std::string str;
|
|
||||||
//
|
|
||||||
//#define _ADD_BP_ULONG(x) \
|
|
||||||
// hres = Bp->Get##x(&Value); \
|
|
||||||
// BOOST_ASSERT( SUCCEEDED( hres ) || hres == E_NOINTERFACE ); \
|
|
||||||
// if (SUCCEEDED( hres )) \
|
|
||||||
// bpParameters[#x] = Value;
|
|
||||||
//
|
|
||||||
//#define _ADD_BP_ULONG2(x, n1, n2) \
|
|
||||||
// hres = Bp->Get##x(&Value, &Value2); \
|
|
||||||
// BOOST_ASSERT( SUCCEEDED( hres ) || hres == E_NOINTERFACE ); \
|
|
||||||
// if (SUCCEEDED( hres )) \
|
|
||||||
// { \
|
|
||||||
// bpParameters[n1] = Value; bpParameters[n2] = Value2; \
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//#define _ADD_BP_ULONG64(x) \
|
|
||||||
// hres = Bp->Get##x(&Value64); \
|
|
||||||
// BOOST_ASSERT( SUCCEEDED( hres ) || hres == E_NOINTERFACE ); \
|
|
||||||
// if (SUCCEEDED( hres )) \
|
|
||||||
// bpParameters[#x] = Value64;
|
|
||||||
//
|
|
||||||
//#define _ADD_BP_STR(x) \
|
|
||||||
// Value = 0; \
|
|
||||||
// Bp->Get##x(NULL, 0, &Value); \
|
|
||||||
// if (Value) \
|
|
||||||
// { \
|
|
||||||
// str.resize(Value + 1); \
|
|
||||||
// BOOST_VERIFY( SUCCEEDED( \
|
|
||||||
// Bp->Get##x(&str[0], (ULONG)str.size(), NULL) \
|
|
||||||
// ) ); \
|
|
||||||
// if (!str.empty()) bpParameters[#x] = str.c_str(); \
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// _ADD_BP_ULONG(Id);
|
|
||||||
// _ADD_BP_ULONG2(Type, "BreakType", "ProcType");
|
|
||||||
// _ADD_BP_ULONG(Flags);
|
|
||||||
// _ADD_BP_ULONG64(Offset);
|
|
||||||
// _ADD_BP_ULONG2(DataParameters, "Size", "AccessType");
|
|
||||||
// _ADD_BP_ULONG(PassCount);
|
|
||||||
// _ADD_BP_ULONG(CurrentPassCount);
|
|
||||||
// _ADD_BP_ULONG(MatchThreadId);
|
|
||||||
// _ADD_BP_STR(Command);
|
|
||||||
// _ADD_BP_STR(OffsetExpression);
|
|
||||||
//
|
|
||||||
//#undef _ADD_BP_ULONG
|
|
||||||
//#undef _ADD_BP_ULONG2
|
|
||||||
//#undef _ADD_BP_ULONG64
|
|
||||||
//#undef _ADD_BP_STR
|
|
||||||
//
|
|
||||||
// PyThread_StateSave pyThreadSave;
|
|
||||||
// return onException(bpParameters);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HRESULT debugEvent::Exception(
|
|
||||||
// __in PEXCEPTION_RECORD64 Exception,
|
|
||||||
// __in ULONG FirstChance
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// boost::python::list exceptParams;
|
|
||||||
// boost::python::dict exceptData;
|
|
||||||
//
|
|
||||||
// // build list of parameters
|
|
||||||
// for (ULONG i = 0; i < Exception->NumberParameters; ++i)
|
|
||||||
// exceptParams.append(Exception->ExceptionInformation[i]);
|
|
||||||
//
|
|
||||||
// // build dict of exception data
|
|
||||||
//#define _ADD_EXCEPTION_ENTRY(x) exceptData[#x] = Exception->Exception##x
|
|
||||||
// _ADD_EXCEPTION_ENTRY(Code);
|
|
||||||
// _ADD_EXCEPTION_ENTRY(Flags);
|
|
||||||
// _ADD_EXCEPTION_ENTRY(Record);
|
|
||||||
// _ADD_EXCEPTION_ENTRY(Address);
|
|
||||||
//#undef _ADD_EXCEPTION_ENTRY
|
|
||||||
//
|
|
||||||
// exceptData["Parameters"] = exceptParams;
|
|
||||||
//
|
|
||||||
// exceptData["FirstChance"] = (0 != FirstChance);
|
|
||||||
//
|
|
||||||
// PyThread_StateSave pyThreadSave;
|
|
||||||
// return onException(exceptData);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HRESULT debugEvent::LoadModule(
|
|
||||||
// __in ULONG64 ImageFileHandle,
|
|
||||||
// __in ULONG64 BaseOffset,
|
|
||||||
// __in ULONG ModuleSize,
|
|
||||||
// __in PCSTR ModuleName,
|
|
||||||
// __in PCSTR ImageName,
|
|
||||||
// __in ULONG CheckSum,
|
|
||||||
// __in ULONG TimeDateStamp
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// std::auto_ptr<OutputReader> silentMode( new OutputReader(dbgExt->client) );
|
|
||||||
//
|
|
||||||
// ULONG64 moduleBase;
|
|
||||||
// ULONG moduleSize;
|
|
||||||
// std::string moduleName;
|
|
||||||
//
|
|
||||||
// queryModuleParams(BaseOffset, moduleName, moduleBase, moduleSize);
|
|
||||||
// dbgModuleClass module(moduleName, moduleBase, moduleSize);
|
|
||||||
// silentMode.reset();
|
|
||||||
//
|
|
||||||
// PyThread_StateSave pyThreadSave;
|
|
||||||
// return onLoadModule( module );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HRESULT debugEvent::UnloadModule(
|
|
||||||
// __in PCSTR ImageBaseName,
|
|
||||||
// __in ULONG64 BaseOffset
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// std::auto_ptr<OutputReader> silentMode( new OutputReader(dbgExt->client) );
|
|
||||||
//
|
|
||||||
// ULONG64 moduleBase;
|
|
||||||
// ULONG moduleSize;
|
|
||||||
// std::string moduleName;
|
|
||||||
//
|
|
||||||
// queryModuleParams(BaseOffset, moduleName, moduleBase, moduleSize);
|
|
||||||
// dbgModuleClass module(moduleName, moduleBase, moduleSize);
|
|
||||||
// silentMode.reset();
|
|
||||||
//
|
|
||||||
// PyThread_StateSave pyThreadSave;
|
|
||||||
// return onUnloadModule( module );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HRESULT debugEvent::SessionStatus(
|
|
||||||
// __in ULONG Status
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// PyThread_StateSave pyThreadSave;
|
|
||||||
// return onChangeSessionStatus( Status );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HRESULT debugEvent::ChangeDebuggeeState(
|
|
||||||
// __in ULONG Flags,
|
|
||||||
// __in ULONG64 Argument
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// PyThread_StateSave pyThreadSave;
|
|
||||||
// return onChangeDebugeeState();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
132
pykd/dbgevent.h
132
pykd/dbgevent.h
@ -1,132 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//// user-customizing debug event handler
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//#include "dbgeventcb.h"
|
|
||||||
//#include "dbgmodule.h"
|
|
||||||
//#include "pyaux.h"
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class debugEvent : public DebugBaseEventCallbacks
|
|
||||||
//{
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// debugEvent();
|
|
||||||
//
|
|
||||||
// virtual ~debugEvent();
|
|
||||||
//
|
|
||||||
// virtual ULONG onBreakpoint(boost::python::dict &/*bpParameters*/) = 0;
|
|
||||||
//
|
|
||||||
// virtual ULONG onException(boost::python::dict &/*exceptData*/) = 0;
|
|
||||||
//
|
|
||||||
// virtual ULONG onLoadModule(const dbgModuleClass &/* module */) = 0;
|
|
||||||
//
|
|
||||||
// virtual ULONG onUnloadModule(const dbgModuleClass &/* module */) = 0;
|
|
||||||
//
|
|
||||||
// virtual ULONG onChangeSessionStatus( ULONG status ) = 0;
|
|
||||||
//
|
|
||||||
// virtual ULONG onChangeDebugeeState() = 0;
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// STDMETHOD_(ULONG, AddRef)() { return 1; }
|
|
||||||
// STDMETHOD_(ULONG, Release)() { return 1; }
|
|
||||||
//
|
|
||||||
// STDMETHOD(GetInterestMask)(
|
|
||||||
// __out PULONG Mask
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// STDMETHOD(Breakpoint)(
|
|
||||||
// __in PDEBUG_BREAKPOINT Bp
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// STDMETHOD(Exception)(
|
|
||||||
// __in PEXCEPTION_RECORD64 Exception,
|
|
||||||
// __in ULONG FirstChance
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// STDMETHOD(LoadModule)(
|
|
||||||
// __in ULONG64 ImageFileHandle,
|
|
||||||
// __in ULONG64 BaseOffset,
|
|
||||||
// __in ULONG ModuleSize,
|
|
||||||
// __in PCSTR ModuleName,
|
|
||||||
// __in PCSTR ImageName,
|
|
||||||
// __in ULONG CheckSum,
|
|
||||||
// __in ULONG TimeDateStamp
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// STDMETHOD(UnloadModule)(
|
|
||||||
// __in PCSTR ImageBaseName,
|
|
||||||
// __in ULONG64 BaseOffset
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// STDMETHOD(SessionStatus)(
|
|
||||||
// __in ULONG Status
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// STDMETHOD(ChangeDebuggeeState)(
|
|
||||||
// __in ULONG Flags,
|
|
||||||
// __in ULONG64 Argument );
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// IDebugClient *m_debugClient;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class debugEventWrap : public boost::python::wrapper<debugEvent>, public debugEvent
|
|
||||||
//{
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// ULONG onBreakpoint(boost::python::dict &bpParameters) {
|
|
||||||
// return handler<boost::python::dict &>("onBreakpoint", bpParameters);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG onException(boost::python::dict &exceptData) {
|
|
||||||
// return handler<boost::python::dict &>("onException", exceptData);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG onLoadModule(const dbgModuleClass &module) {
|
|
||||||
// return handler<const dbgModuleClass &>("onLoadModule", module );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG onUnloadModule(const dbgModuleClass &module) {
|
|
||||||
// return handler<const dbgModuleClass &>("onUnloadModule", module );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG onChangeSessionStatus( ULONG status ) {
|
|
||||||
// return handler( "onChangeSessionStatus", status );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG onChangeDebugeeState() {
|
|
||||||
// return handler( "onChangeDebugeeState" );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// template<typename Arg1Type>
|
|
||||||
// ULONG handler( const char* handlerName, Arg1Type arg1 )
|
|
||||||
// {
|
|
||||||
// if (boost::python::override pythonHandler = get_override( handlerName ))
|
|
||||||
// return pythonHandler(arg1);
|
|
||||||
//
|
|
||||||
// return DEBUG_STATUS_NO_CHANGE;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG handler( const char* handlerName )
|
|
||||||
// {
|
|
||||||
// if (boost::python::override pythonHandler = get_override( handlerName ))
|
|
||||||
// return pythonHandler();
|
|
||||||
//
|
|
||||||
// return DEBUG_STATUS_NO_CHANGE;
|
|
||||||
// }
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
@ -1,153 +0,0 @@
|
|||||||
|
|
||||||
#include "stdafx.h"
|
|
||||||
//#include "dbgeng.h"
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//#include "dbgeventcb.h"
|
|
||||||
//#include "dbgexcept.h"
|
|
||||||
//#include "dbgmodule.h"
|
|
||||||
//#include "dbgsynsym.h"
|
|
||||||
//#include "dbgbreak.h"
|
|
||||||
//#include "dbgevent.h"
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//DbgEventCallbacksManager::DbgEventCallbacksManager( IDebugClient *client )
|
|
||||||
//{
|
|
||||||
// m_debugClient = client;
|
|
||||||
// m_debugClient->AddRef();
|
|
||||||
//
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// hres = m_debugClient->SetEventCallbacks(this);
|
|
||||||
// if (FAILED(hres))
|
|
||||||
// throw DbgException( "IDebugClient::SetEventCallbacks" );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//DbgEventCallbacksManager::~DbgEventCallbacksManager()
|
|
||||||
//{
|
|
||||||
// if ( m_debugClient )
|
|
||||||
// {
|
|
||||||
// m_debugClient->SetEventCallbacks( NULL );
|
|
||||||
// m_debugClient->Release();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HRESULT DbgEventCallbacksManager::GetInterestMask(
|
|
||||||
// __out PULONG Mask
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// *Mask =
|
|
||||||
// DEBUG_EVENT_CHANGE_SYMBOL_STATE |
|
|
||||||
// DEBUG_EVENT_BREAKPOINT;
|
|
||||||
//// DEBUG_EVENT_LOAD_MODULE |
|
|
||||||
//// DEBUG_EVENT_UNLOAD_MODULE
|
|
||||||
// return S_OK;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HRESULT DbgEventCallbacksManager::ChangeSymbolState(
|
|
||||||
// __in ULONG Flags,
|
|
||||||
// __in ULONG64 Argument
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// if ((DEBUG_CSS_LOADS & Flags))
|
|
||||||
// {
|
|
||||||
// if (Argument)
|
|
||||||
// {
|
|
||||||
// DEBUG_MODULE_PARAMETERS dbgModuleParameters;
|
|
||||||
// HRESULT hres = dbgExt->symbols3->GetModuleParameters(
|
|
||||||
// 1,
|
|
||||||
// &Argument,
|
|
||||||
// 0,
|
|
||||||
// &dbgModuleParameters);
|
|
||||||
//
|
|
||||||
// if (SUCCEEDED(hres))
|
|
||||||
// {
|
|
||||||
// ModuleInfo moduleInfo(dbgModuleParameters);
|
|
||||||
// restoreSyntheticSymbolForModule(moduleInfo);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return S_OK;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //// f.e. is case ".reload /f image.exe", if for image.exe no symbols
|
|
||||||
// restoreSyntheticSymbolForAllModules();
|
|
||||||
//
|
|
||||||
// return S_OK;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return DEBUG_STATUS_NO_CHANGE;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//HRESULT DbgEventCallbacksManager::Breakpoint(
|
|
||||||
// __in IDebugBreakpoint * bp
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// return dbgBreakpointClass::onBreakpointEvnet( bp );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
////
|
|
||||||
////HRESULT DbgEventCallbacksManager::LoadModule(
|
|
||||||
//// __in ULONG64 ImageFileHandle,
|
|
||||||
//// __in ULONG64 BaseOffset,
|
|
||||||
//// __in ULONG ModuleSize,
|
|
||||||
//// __in PCSTR ModuleName,
|
|
||||||
//// __in PCSTR ImageName,
|
|
||||||
//// __in ULONG CheckSum,
|
|
||||||
//// __in ULONG TimeDateStamp
|
|
||||||
////)
|
|
||||||
////{
|
|
||||||
//// try
|
|
||||||
//// {
|
|
||||||
//// return debugEvent::moduleLoaded(BaseOffset);
|
|
||||||
//// }
|
|
||||||
//// catch (std::exception &)
|
|
||||||
//// {
|
|
||||||
//// }
|
|
||||||
//// return DEBUG_STATUS_NO_CHANGE;
|
|
||||||
////}
|
|
||||||
////
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
////
|
|
||||||
////HRESULT DbgEventCallbacksManager::UnloadModule(
|
|
||||||
//// __in PCSTR ImageBaseName,
|
|
||||||
//// __in ULONG64 BaseOffset
|
|
||||||
////)
|
|
||||||
////{
|
|
||||||
//// try
|
|
||||||
//// {
|
|
||||||
//// return debugEvent::moduleUnloaded(BaseOffset);
|
|
||||||
//// }
|
|
||||||
//// catch (std::exception &)
|
|
||||||
//// {
|
|
||||||
//// }
|
|
||||||
//// return DEBUG_STATUS_NO_CHANGE;
|
|
||||||
////}
|
|
||||||
////
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
////
|
|
||||||
////HRESULT DbgEventCallbacksManager::SessionStatus(
|
|
||||||
//// __in ULONG status
|
|
||||||
////)
|
|
||||||
////{
|
|
||||||
//// try
|
|
||||||
//// {
|
|
||||||
//// return debugEvent::sessionStatus( status );
|
|
||||||
//// }
|
|
||||||
//// catch( std::exception& )
|
|
||||||
//// {
|
|
||||||
//// }
|
|
||||||
////
|
|
||||||
//// return DEBUG_STATUS_NO_CHANGE;
|
|
||||||
////}
|
|
||||||
////
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,64 +0,0 @@
|
|||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <dbgeng.h>
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//// monitoring and processing debug events
|
|
||||||
//class DbgEventCallbacksManager : public DebugBaseEventCallbacks
|
|
||||||
//{
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// DbgEventCallbacksManager( IDebugClient *client = NULL );
|
|
||||||
//
|
|
||||||
// virtual ~DbgEventCallbacksManager();
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// /////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// // IUnknown interface implementation
|
|
||||||
//
|
|
||||||
// STDMETHOD_(ULONG, AddRef)() { return 1; }
|
|
||||||
// STDMETHOD_(ULONG, Release)() { return 1; }
|
|
||||||
//
|
|
||||||
// /////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// // IDebugEventCallbacks interface implementation
|
|
||||||
//
|
|
||||||
// STDMETHOD(GetInterestMask)(
|
|
||||||
// __out PULONG Mask
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// STDMETHOD(ChangeSymbolState)(
|
|
||||||
// __in ULONG Flags,
|
|
||||||
// __in ULONG64 Argument
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// STDMETHOD(Breakpoint)(
|
|
||||||
// __in PDEBUG_BREAKPOINT Bp
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
///* STDMETHOD(LoadModule)(
|
|
||||||
// __in ULONG64 ImageFileHandle,
|
|
||||||
// __in ULONG64 BaseOffset,
|
|
||||||
// __in ULONG ModuleSize,
|
|
||||||
// __in PCSTR ModuleName,
|
|
||||||
// __in PCSTR ImageName,
|
|
||||||
// __in ULONG CheckSum,
|
|
||||||
// __in ULONG TimeDateStamp
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// STDMETHOD(UnloadModule)(
|
|
||||||
// __in PCSTR ImageBaseName,
|
|
||||||
// __in ULONG64 BaseOffset
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// STDMETHOD(SessionStatus)(
|
|
||||||
// __in ULONG status
|
|
||||||
// ); */
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
// IDebugClient *m_debugClient;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,43 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <dbgeng.h>
|
|
||||||
//#include <dbghelp.h>
|
|
||||||
//
|
|
||||||
//class DbgExt {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// IDebugClient *client;
|
|
||||||
// IDebugClient4 *client4;
|
|
||||||
// IDebugClient5 *client5;
|
|
||||||
//
|
|
||||||
// IDebugControl *control;
|
|
||||||
// IDebugControl4 *control4;
|
|
||||||
//
|
|
||||||
// IDebugRegisters *registers;
|
|
||||||
//
|
|
||||||
// IDebugSymbols *symbols;
|
|
||||||
// IDebugSymbols2 *symbols2;
|
|
||||||
// IDebugSymbols3 *symbols3;
|
|
||||||
//
|
|
||||||
// IDebugDataSpaces *dataSpaces;
|
|
||||||
// IDebugDataSpaces4 *dataSpaces4;
|
|
||||||
//
|
|
||||||
// IDebugAdvanced2 *advanced2;
|
|
||||||
//
|
|
||||||
// IDebugSystemObjects *system;
|
|
||||||
// IDebugSystemObjects2 *system2;
|
|
||||||
//
|
|
||||||
// DbgExt( IDebugClient4 *client );
|
|
||||||
//
|
|
||||||
// ~DbgExt();
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// DbgExt *m_previosExt;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
//extern DbgExt *dbgExt;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//bool isWindbgExt();
|
|
@ -1,34 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
//#include <iostream>
|
|
||||||
//#include <Fcntl.h>
|
|
||||||
//
|
|
||||||
//#include "dbgio.h"
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//
|
|
||||||
//using namespace std;
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void dbgPrint::dprint( const boost::python::object& obj, bool dml )
|
|
||||||
//{
|
|
||||||
// std::wstring str = boost::python::extract<std::wstring>( obj );
|
|
||||||
//
|
|
||||||
// HRESULT hres = dbgExt->control4->ControlledOutputWide( dml ? DEBUG_OUTCTL_AMBIENT_DML : DEBUG_OUTCTL_AMBIENT_TEXT, DEBUG_OUTPUT_NORMAL, str.c_str() );
|
|
||||||
//
|
|
||||||
// std::wcout << str;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void dbgPrint::dprintln( const boost::python::object& obj, bool dml )
|
|
||||||
//{
|
|
||||||
// std::wstring str = boost::python::extract<std::wstring>( obj );
|
|
||||||
// str += L"\r\n";
|
|
||||||
//
|
|
||||||
// dbgExt->control4->ControlledOutputWide( dml ? DEBUG_OUTCTL_AMBIENT_DML : DEBUG_OUTCTL_AMBIENT_TEXT, DEBUG_OUTPUT_NORMAL, str.c_str() );
|
|
||||||
//
|
|
||||||
// std::wcout << str;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
224
pykd/dbgio.h
224
pykd/dbgio.h
@ -1,224 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <string>
|
|
||||||
//#include <dbgeng.h>
|
|
||||||
//
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class dbgPrint {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// static void dprint( const boost::python::object& obj, bool dml = false );
|
|
||||||
//
|
|
||||||
// static void dprintln( const boost::python::object& obj, bool dml = false );
|
|
||||||
//
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//// êëàññ äëÿ ïåðåõâàòà âûâîäà â îòëàä÷èê
|
|
||||||
//
|
|
||||||
//class OutputReader : public IDebugOutputCallbacks {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// OutputReader( IDebugClient *debugClient )
|
|
||||||
// {
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
// m_debugClient = debugClient;
|
|
||||||
// m_debugClient->AddRef();
|
|
||||||
//
|
|
||||||
// hres = m_debugClient->GetOutputCallbacks( &m_previousCallback );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// {
|
|
||||||
// throw hres;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// hres = m_debugClient->SetOutputCallbacks( this );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// {
|
|
||||||
// throw hres;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// } catch( ... )
|
|
||||||
// {
|
|
||||||
// m_debugClient->Release();
|
|
||||||
// m_debugClient = NULL;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ~OutputReader()
|
|
||||||
// {
|
|
||||||
// if ( m_debugClient )
|
|
||||||
// {
|
|
||||||
// m_debugClient->SetOutputCallbacks( m_previousCallback );
|
|
||||||
// m_debugClient->Release();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// const std::string&
|
|
||||||
// Line() const {
|
|
||||||
// return m_readLine;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// // IUnknown.
|
|
||||||
// STDMETHOD(QueryInterface)(
|
|
||||||
// __in REFIID InterfaceId,
|
|
||||||
// __out PVOID* Interface ) {
|
|
||||||
// return E_NOINTERFACE;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// STDMETHOD_(ULONG, AddRef)() {
|
|
||||||
// return 1L;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// STDMETHOD_(ULONG, Release)() {
|
|
||||||
// return 0L;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// STDMETHOD(Output)(
|
|
||||||
// __in ULONG Mask,
|
|
||||||
// __in PCSTR Text )
|
|
||||||
// {
|
|
||||||
// if ( Mask == DEBUG_OUTPUT_NORMAL )
|
|
||||||
// {
|
|
||||||
// m_readLine += std::string( Text );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return S_OK;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// std::string m_readLine;
|
|
||||||
//
|
|
||||||
// IDebugClient *m_debugClient;
|
|
||||||
//
|
|
||||||
// IDebugOutputCallbacks *m_previousCallback;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class InputReader : public IDebugInputCallbacks {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// InputReader( IDebugClient *debugClient )
|
|
||||||
// {
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
// m_debugClient = debugClient;
|
|
||||||
// m_debugClient->AddRef();
|
|
||||||
//
|
|
||||||
// hres = m_debugClient->GetInputCallbacks( &m_previousCallback );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// {
|
|
||||||
// throw hres;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// hres = m_debugClient->SetInputCallbacks( this );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// {
|
|
||||||
// throw hres;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// } catch( ... )
|
|
||||||
// {
|
|
||||||
// m_debugClient->Release();
|
|
||||||
// m_debugClient = NULL;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ~InputReader()
|
|
||||||
// {
|
|
||||||
// if ( m_debugClient )
|
|
||||||
// {
|
|
||||||
// m_debugClient->SetInputCallbacks( m_previousCallback );
|
|
||||||
// m_debugClient->Release();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// // IUnknown.
|
|
||||||
// STDMETHOD(QueryInterface)(
|
|
||||||
// __in REFIID InterfaceId,
|
|
||||||
// __out PVOID* Interface ) {
|
|
||||||
// return E_NOINTERFACE;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// STDMETHOD_(ULONG, AddRef)() {
|
|
||||||
// return 1L;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// STDMETHOD_(ULONG, Release)() {
|
|
||||||
// return 0L;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// STDMETHOD( EndInput )() {
|
|
||||||
// return S_OK;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// STDMETHOD( StartInput )(
|
|
||||||
// IN ULONG BufferSize ) {
|
|
||||||
// return S_OK;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// IDebugClient *m_debugClient;
|
|
||||||
//
|
|
||||||
// IDebugInputCallbacks *m_previousCallback;
|
|
||||||
//
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class dbgOut {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// void
|
|
||||||
// write( const boost::python::object &str ) {
|
|
||||||
// dbgPrint::dprint( str );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class dbgIn {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// std::string
|
|
||||||
// readline() {
|
|
||||||
//
|
|
||||||
// char str[100];
|
|
||||||
// ULONG inputSize;
|
|
||||||
//
|
|
||||||
// OutputReader outputReader( dbgExt->client );
|
|
||||||
//
|
|
||||||
// dbgExt->control->Input( str, sizeof(str), &inputSize );
|
|
||||||
//
|
|
||||||
// return std::string( str );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
148
pykd/dbgpath.cpp
148
pykd/dbgpath.cpp
@ -1,148 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
//#include "dbgpath.h"
|
|
||||||
//
|
|
||||||
//#include <boost/tokenizer.hpp>
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//DbgPythonPath::DbgPythonPath()
|
|
||||||
//{
|
|
||||||
// DWORD enviromentSize = 0;
|
|
||||||
//
|
|
||||||
// enviromentSize = GetEnvironmentVariableA( "PYTHONPATH", NULL, enviromentSize );
|
|
||||||
//
|
|
||||||
// std::vector<char> enviromentBuffer(enviromentSize);
|
|
||||||
//
|
|
||||||
// if (!enviromentBuffer.empty())
|
|
||||||
// {
|
|
||||||
// GetEnvironmentVariableA( "PYTHONPATH", &enviromentBuffer[0], enviromentSize );
|
|
||||||
//
|
|
||||||
// typedef boost::escaped_list_separator<char> char_separator_t;
|
|
||||||
// typedef boost::tokenizer< char_separator_t > char_tokenizer_t;
|
|
||||||
//
|
|
||||||
// std::string pytonPath( &enviromentBuffer[0] );
|
|
||||||
//
|
|
||||||
// char_tokenizer_t token( pytonPath, char_separator_t( "", "; \t", "\"" ) );
|
|
||||||
//
|
|
||||||
// for ( char_tokenizer_t::iterator it = token.begin(); it != token.end(); ++it )
|
|
||||||
// {
|
|
||||||
// if ( *it != "" )
|
|
||||||
// m_pathList.push_back( *it );
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//DbgPythonPath::getStr() const
|
|
||||||
//{
|
|
||||||
// std::string str;
|
|
||||||
// std::vector<std::string>::const_iterator it = m_pathList.begin();
|
|
||||||
//
|
|
||||||
// for ( ; it != m_pathList.end(); ++it )
|
|
||||||
// {
|
|
||||||
// str += *it;
|
|
||||||
// str += ";";
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return str;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//bool
|
|
||||||
//DbgPythonPath::findPath(
|
|
||||||
// const std::string &fileName,
|
|
||||||
// std::string &fullFileName,
|
|
||||||
// std::string &filePath ) const
|
|
||||||
//{
|
|
||||||
// std::vector< std::string > extPathList;
|
|
||||||
//
|
|
||||||
// boost::python::object sys = boost::python::import( "sys");
|
|
||||||
//
|
|
||||||
// boost::python::list pathList( sys.attr("path") );
|
|
||||||
//
|
|
||||||
// boost::python::ssize_t n = boost::python::len(pathList);
|
|
||||||
// for(boost::python::ssize_t i=0;i<n;i++)
|
|
||||||
// extPathList.push_back( boost::python::extract<std::string>( pathList[i] ) );
|
|
||||||
//
|
|
||||||
// bool pyExt = fileName.rfind( ".py" ) == fileName.length() - 3;
|
|
||||||
//
|
|
||||||
// // 1. Èùåì â ðàáî÷åé äèðåêòîðèè
|
|
||||||
// DWORD bufSize =
|
|
||||||
// SearchPathA(
|
|
||||||
// NULL,
|
|
||||||
// fileName.c_str(),
|
|
||||||
// pyExt ? NULL : ".py",
|
|
||||||
// 0,
|
|
||||||
// NULL,
|
|
||||||
// NULL );
|
|
||||||
//
|
|
||||||
// if ( bufSize > 0 )
|
|
||||||
// {
|
|
||||||
// bufSize += 1;
|
|
||||||
// std::vector<char> fullFileNameCStr(bufSize);
|
|
||||||
// char *partFileNameCStr = NULL;
|
|
||||||
//
|
|
||||||
// SearchPathA(
|
|
||||||
// NULL,
|
|
||||||
// fileName.c_str(),
|
|
||||||
// pyExt ? NULL : ".py",
|
|
||||||
// bufSize,
|
|
||||||
// &fullFileNameCStr[0],
|
|
||||||
// &partFileNameCStr );
|
|
||||||
//
|
|
||||||
// fullFileName = std::string( &fullFileNameCStr[0] );
|
|
||||||
// if ( !fullFileName.empty() )
|
|
||||||
// {
|
|
||||||
// filePath = std::string( &fullFileNameCStr[0], partFileNameCStr );
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 2. Èùåì âî âñåõ äèðåêòîðèÿõ, óêàçàííûõ â m_pathList
|
|
||||||
//
|
|
||||||
// std::vector<std::string>::const_iterator it = extPathList.begin();
|
|
||||||
//
|
|
||||||
// for ( ; it != extPathList.end(); ++it )
|
|
||||||
// {
|
|
||||||
// DWORD bufSize =
|
|
||||||
// SearchPathA(
|
|
||||||
// (*it).c_str(),
|
|
||||||
// fileName.c_str(),
|
|
||||||
// pyExt ? NULL : ".py",
|
|
||||||
// 0,
|
|
||||||
// NULL,
|
|
||||||
// NULL );
|
|
||||||
//
|
|
||||||
// if ( bufSize > 0 )
|
|
||||||
// {
|
|
||||||
// bufSize += 1;
|
|
||||||
// std::vector<char> fullFileNameCStr(bufSize);
|
|
||||||
// char *partFileNameCStr = NULL;
|
|
||||||
//
|
|
||||||
// bufSize = SearchPathA(
|
|
||||||
// (*it).c_str(),
|
|
||||||
// fileName.c_str(),
|
|
||||||
// pyExt ? NULL : ".py",
|
|
||||||
// bufSize,
|
|
||||||
// &fullFileNameCStr[0],
|
|
||||||
// &partFileNameCStr );
|
|
||||||
//
|
|
||||||
// fullFileName = std::string( &fullFileNameCStr[0] );
|
|
||||||
// if ( !fullFileName.empty() )
|
|
||||||
// {
|
|
||||||
// filePath = std::string( &fullFileNameCStr[0], partFileNameCStr );
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return false;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,32 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <string>
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class DbgPythonPath
|
|
||||||
//{
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// DbgPythonPath();
|
|
||||||
//
|
|
||||||
// std::string
|
|
||||||
// getStr() const;
|
|
||||||
//
|
|
||||||
// bool
|
|
||||||
// findPath(
|
|
||||||
// const std::string &fileName,
|
|
||||||
// std::string &fullFileName,
|
|
||||||
// std::string &filePath ) const;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// std::vector< std::string > m_pathList;
|
|
||||||
//
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
////extern DbgPythonPath& dbgPythonPath;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,289 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
//#include <boost/format.hpp>
|
|
||||||
//#include <boost/scoped_array.hpp>
|
|
||||||
//
|
|
||||||
//#include "dbgprocess.h"
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//#include "dbgexcept.h"
|
|
||||||
//#include "dbgtype.h"
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//getThreadList()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
// ULONG i;
|
|
||||||
// ULONG oldThreadId = 0;
|
|
||||||
//
|
|
||||||
// ULONG threadCount;
|
|
||||||
// hres = dbgExt->system->GetNumberThreads( &threadCount );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSystemObjects::GetNumberThreads failed" );
|
|
||||||
//
|
|
||||||
// boost::scoped_array<ULONG> ids(new ULONG[threadCount]);
|
|
||||||
// hres = dbgExt->system->GetThreadIdsByIndex( 0, threadCount, ids.get(), NULL );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSystemObjects::GetThreadIdsByIndex failed" );
|
|
||||||
//
|
|
||||||
// hres = dbgExt->system->GetCurrentThreadId( &oldThreadId );
|
|
||||||
//
|
|
||||||
// boost::python::list threadList;
|
|
||||||
//
|
|
||||||
// for ( i = 0; i < threadCount; ++i )
|
|
||||||
// {
|
|
||||||
// dbgExt->system->SetCurrentThreadId( ids[i] );
|
|
||||||
//
|
|
||||||
// ULONG64 threadOffset;
|
|
||||||
// hres = dbgExt->system->GetCurrentThreadDataOffset( &threadOffset );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// {
|
|
||||||
// dbgExt->system->SetCurrentThreadId( oldThreadId );
|
|
||||||
// throw DbgException( "IDebugSystemObjects::GetCurrentThreadDataOffset failed" );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// threadList.append( threadOffset );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return threadList;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//setImplicitThread(
|
|
||||||
// ULONG64 newThreadAddr )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// newThreadAddr = addr64(newThreadAddr);
|
|
||||||
// hres = dbgExt->system2->SetImplicitThreadDataOffset( newThreadAddr );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSystemObjects2::SetImplicitThreadDataOffset failed" );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//ULONG64
|
|
||||||
//getImplicitThread()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
// ULONG64 threadOffset = -1;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->system2->GetImplicitThreadDataOffset( &threadOffset );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSystemObjects2::GetImplicitThreadDataOffset failed" );
|
|
||||||
//
|
|
||||||
// return threadOffset;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//getCurrentStack()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
// ULONG currentScope = 0;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->symbols3->GetCurrentScopeFrameIndex( ¤tScope );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSymbol3::GetCurrentScopeFrameIndex failed" );
|
|
||||||
//
|
|
||||||
// boost::scoped_array<DEBUG_STACK_FRAME> frames(new DEBUG_STACK_FRAME [ 1000 ]);
|
|
||||||
//
|
|
||||||
// ULONG filledFrames;
|
|
||||||
// hres = dbgExt->control->GetStackTrace( 0, 0, 0, frames.get(), 1000, &filledFrames );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::GetStackTrace failed" );
|
|
||||||
//
|
|
||||||
// boost::python::list frameList;
|
|
||||||
//
|
|
||||||
// for ( ULONG i = 0; i < filledFrames; ++i )
|
|
||||||
// {
|
|
||||||
// dbgStackFrameClass frame( frames[i] );
|
|
||||||
//
|
|
||||||
// boost::python::object frameObj( frame );
|
|
||||||
//
|
|
||||||
// hres = dbgExt->symbols->SetScope( NULL, &frames[i], NULL, sizeof(DEBUG_STACK_FRAME) );
|
|
||||||
// if ( SUCCEEDED( hres ) )
|
|
||||||
// frameObj.attr( "locals" ) = getLocals();
|
|
||||||
//
|
|
||||||
// frameList.append( frameObj );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// dbgExt->symbols3->SetScopeFrameByIndex( currentScope );
|
|
||||||
//
|
|
||||||
// return frameList;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//getProcessorMode()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// ULONG processorMode;
|
|
||||||
// hres = dbgExt->control->GetEffectiveProcessorType( &processorMode );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::GetEffectiveProcessorType failed" );
|
|
||||||
//
|
|
||||||
// switch( processorMode )
|
|
||||||
// {
|
|
||||||
// case IMAGE_FILE_MACHINE_I386:
|
|
||||||
// return "X86";
|
|
||||||
//
|
|
||||||
// case IMAGE_FILE_MACHINE_ARM:
|
|
||||||
// return "ARM";
|
|
||||||
//
|
|
||||||
// case IMAGE_FILE_MACHINE_IA64:
|
|
||||||
// return "IA64";
|
|
||||||
//
|
|
||||||
// case IMAGE_FILE_MACHINE_AMD64:
|
|
||||||
// return "X64";
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// throw DbgException( "Unknown CPU type" );
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//setProcessorMode(
|
|
||||||
// const std::string &mode )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
// ULONG processorMode = ~0;
|
|
||||||
//
|
|
||||||
// if ( mode == "X86" )
|
|
||||||
// processorMode = IMAGE_FILE_MACHINE_I386;
|
|
||||||
// else if ( mode == "ARM" )
|
|
||||||
// processorMode = IMAGE_FILE_MACHINE_ARM;
|
|
||||||
// else if ( mode == "IA64" )
|
|
||||||
// processorMode = IMAGE_FILE_MACHINE_IA64;
|
|
||||||
// else if ( mode == "X64" )
|
|
||||||
// processorMode = IMAGE_FILE_MACHINE_AMD64;
|
|
||||||
// else
|
|
||||||
// throw DbgException( "Unknown processor type" );
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->SetEffectiveProcessorType( processorMode );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::SetEffectiveProcessorType failed" );
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//ULONG64
|
|
||||||
//getCurrentProcess()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
// ULONG64 processAddr = 0;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->system2->GetImplicitProcessDataOffset( &processAddr );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSystemObjects2::GetImplicitProcessDataOffset failed" );
|
|
||||||
//
|
|
||||||
// return processAddr;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//VOID
|
|
||||||
//setCurrentProcess(
|
|
||||||
// ULONG64 processAddr )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// processAddr = addr64(processAddr);
|
|
||||||
// hres = dbgExt->system2->SetImplicitProcessDataOffset( processAddr );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSystemObjects2::SetImplicitProcessDataOffset failed" );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//dbgStackFrameClass::dbgStackFrameClass( const DEBUG_STACK_FRAME &stackFrame )
|
|
||||||
//{
|
|
||||||
// memcpy( static_cast<DEBUG_STACK_FRAME*>( this ), &stackFrame, sizeof(DEBUG_STACK_FRAME) );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//dbgStackFrameClass::print() const
|
|
||||||
//{
|
|
||||||
// boost::format fmt(dbgExt->control->IsPointer64Bit() == S_OK ? "%1$4d %2$16x" : "%1$4d %2$08x");
|
|
||||||
// fmt % FrameNumber % ReturnOffset;
|
|
||||||
// return fmt.str();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//getLocals()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
// CComPtr<IDebugSymbolGroup> localSymbols;
|
|
||||||
// CComPtr<IDebugSymbolGroup2> localSymbols2;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->symbols->GetScopeSymbolGroup( DEBUG_SCOPE_GROUP_ARGUMENTS|DEBUG_SCOPE_GROUP_LOCALS, NULL, &localSymbols );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSymbols::GetScopeSymbolGroup failed" );
|
|
||||||
//
|
|
||||||
// hres = localSymbols->QueryInterface( __uuidof(IDebugSymbolGroup2), (void**) &localSymbols2 );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSymbols::QueryInterface failed to get IDebugSymbolGroup2" );
|
|
||||||
//
|
|
||||||
// ULONG localNumber;
|
|
||||||
// hres = localSymbols->GetNumberSymbols( &localNumber );
|
|
||||||
//
|
|
||||||
// boost::python::dict arr;
|
|
||||||
//
|
|
||||||
// for ( ULONG i = 0; i < localNumber; ++i )
|
|
||||||
// {
|
|
||||||
// char varName[0x100];
|
|
||||||
//
|
|
||||||
// hres = localSymbols->GetSymbolName( i, varName, sizeof(varName), NULL );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSymbolGroup::GetSymbolName failed" );
|
|
||||||
//
|
|
||||||
// DEBUG_SYMBOL_PARAMETERS symbolParam = {};
|
|
||||||
// hres = localSymbols->GetSymbolParameters( i, 1, &symbolParam );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSymbolGroup::GetSymbolParameters failed" );
|
|
||||||
//
|
|
||||||
// char typeName[0x100];
|
|
||||||
// hres = dbgExt->symbols->GetTypeName( symbolParam.Module, symbolParam.TypeId, typeName, sizeof(typeName), NULL );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSymbols::GetTypeName failed" );
|
|
||||||
//
|
|
||||||
// char moduleName[0x100];
|
|
||||||
// hres = dbgExt->symbols2->GetModuleNameString(
|
|
||||||
// DEBUG_MODNAME_MODULE,
|
|
||||||
// DEBUG_ANY_ID,
|
|
||||||
// symbolParam.Module,
|
|
||||||
// moduleName,
|
|
||||||
// sizeof(moduleName),
|
|
||||||
// NULL );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSymbols2::GetModuleNameString failed" );
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// ULONG64 varOffset;
|
|
||||||
// hres = localSymbols2->GetSymbolOffset( i, &varOffset );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSymbolGroup2::GetSymbolOffset failed" );
|
|
||||||
//
|
|
||||||
// arr[ varName ] = TypedVar( moduleName, typeName, varOffset );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return arr;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <dbgeng.h>
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//getThreadList();
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//setImplicitThread(
|
|
||||||
// ULONG64 newThreadAddr );
|
|
||||||
//
|
|
||||||
//ULONG64
|
|
||||||
//getImplicitThread();
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//getCurrentStack();
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//getLocals();
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//class dbgStackFrameClass : public DEBUG_STACK_FRAME {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// dbgStackFrameClass()
|
|
||||||
// {
|
|
||||||
// memset( static_cast<DEBUG_STACK_FRAME*>( this ), 0, sizeof(DEBUG_STACK_FRAME) );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// dbgStackFrameClass( const DEBUG_STACK_FRAME &stackFrame );
|
|
||||||
//
|
|
||||||
// std::string
|
|
||||||
// print() const;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
////boost::python::object
|
|
||||||
//std::string
|
|
||||||
//getProcessorMode();
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//setProcessorMode(
|
|
||||||
// const std::string &mode );
|
|
||||||
//
|
|
||||||
//ULONG64
|
|
||||||
//getCurrentProcess();
|
|
||||||
//
|
|
||||||
//VOID
|
|
||||||
//setCurrentProcess(
|
|
||||||
// ULONG64 processAddr );
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
162
pykd/dbgreg.cpp
162
pykd/dbgreg.cpp
@ -1,162 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//#include "dbgreg.h"
|
|
||||||
//#include "dbgexcept.h"
|
|
||||||
//
|
|
||||||
//using namespace std;
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//cpuReg::cpuReg( std::string regName )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// m_name = regName;
|
|
||||||
// m_lived = false;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->registers->GetIndexByName( m_name.c_str(), &m_index );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugRegister::GetIndexByName failed" );
|
|
||||||
//
|
|
||||||
// reloadValue();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//cpuReg::cpuReg( ULONG index )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// m_index = index;
|
|
||||||
// m_lived = false;
|
|
||||||
//
|
|
||||||
// ULONG nameSize = 0;
|
|
||||||
//
|
|
||||||
// hres =
|
|
||||||
// dbgExt->registers->GetDescription(
|
|
||||||
// m_index,
|
|
||||||
// NULL,
|
|
||||||
// 0,
|
|
||||||
// &nameSize,
|
|
||||||
// NULL );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugRegister::GetDescription failed" );
|
|
||||||
//
|
|
||||||
// std::vector<char> nameBuffer(nameSize);
|
|
||||||
//
|
|
||||||
// hres =
|
|
||||||
// dbgExt->registers->GetDescription(
|
|
||||||
// m_index,
|
|
||||||
// &nameBuffer[0],
|
|
||||||
// nameSize,
|
|
||||||
// NULL,
|
|
||||||
// NULL );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugRegister::GetDescription failed" );
|
|
||||||
//
|
|
||||||
// m_name = std::string( &nameBuffer[0] );
|
|
||||||
//
|
|
||||||
// reloadValue();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void cpuReg::reloadValue() const
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// DEBUG_VALUE debugValue;
|
|
||||||
// hres = dbgExt->registers->GetValue( m_index, &debugValue );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugRegister::GetValue failed" );
|
|
||||||
//
|
|
||||||
// switch( debugValue.Type )
|
|
||||||
// {
|
|
||||||
// case DEBUG_VALUE_INT8:
|
|
||||||
// m_value = debugValue.I8;
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case DEBUG_VALUE_INT16:
|
|
||||||
// m_value = debugValue.I16;
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case DEBUG_VALUE_INT32:
|
|
||||||
// m_value = debugValue.I32;
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case DEBUG_VALUE_INT64:
|
|
||||||
// m_value = debugValue.I64;
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//loadRegister( const std::string ®isterName )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// ULONG registerIndex = 0;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->registers->GetIndexByName( registerName.c_str(), ®isterIndex );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugRegister::GetIndexByName failed" );
|
|
||||||
//
|
|
||||||
// DEBUG_VALUE debugValue;
|
|
||||||
// hres = dbgExt->registers->GetValue( registerIndex, &debugValue );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugRegister::GetValue failed" );
|
|
||||||
//
|
|
||||||
// switch( debugValue.Type )
|
|
||||||
// {
|
|
||||||
// case DEBUG_VALUE_INT8:
|
|
||||||
// return boost::python::long_( debugValue.I8 );
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case DEBUG_VALUE_INT16:
|
|
||||||
// return boost::python::long_( debugValue.I16 );
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case DEBUG_VALUE_INT32:
|
|
||||||
// return boost::python::long_( debugValue.I32 );
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case DEBUG_VALUE_INT64:
|
|
||||||
// return boost::python::long_(debugValue.I64 );
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// throw DbgException( "Invalid register value" );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//ULONG64
|
|
||||||
//loadMSR( ULONG msr )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
// ULONG64 value;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->dataSpaces->ReadMsr( msr, &value );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugDataSpaces::ReadMsr failed" );
|
|
||||||
//
|
|
||||||
// return value;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void setMSR( ULONG msr, ULONG64 value)
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->dataSpaces->WriteMsr(msr, value);
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugDataSpaces::WriteMsr failed" );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,61 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <string>
|
|
||||||
//#include <list>
|
|
||||||
//
|
|
||||||
//#include "intbase.h"
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class cpuReg : public intBase {
|
|
||||||
//
|
|
||||||
//public :
|
|
||||||
//
|
|
||||||
// cpuReg( std::string regName );
|
|
||||||
//
|
|
||||||
// cpuReg( ULONG index );
|
|
||||||
//
|
|
||||||
// std::string
|
|
||||||
// name() const {
|
|
||||||
// return m_name;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG
|
|
||||||
// index() const {
|
|
||||||
// return m_index;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void beLive() {
|
|
||||||
// m_lived = true;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG64 value() const
|
|
||||||
// {
|
|
||||||
// if ( m_lived )
|
|
||||||
// reloadValue();
|
|
||||||
//
|
|
||||||
// return intBase::value();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// void reloadValue() const;
|
|
||||||
//
|
|
||||||
// std::string m_name;
|
|
||||||
//
|
|
||||||
// ULONG m_index;
|
|
||||||
//
|
|
||||||
// bool m_lived;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//loadRegister( const std::string ®isterName );
|
|
||||||
//
|
|
||||||
//ULONG64
|
|
||||||
//loadMSR( ULONG msr );
|
|
||||||
//
|
|
||||||
//void setMSR( ULONG msr, ULONG64 val);
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,78 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//#include "dbgsym.h"
|
|
||||||
//#include "dbgexcept.h"
|
|
||||||
//#include "dbgmem.h"
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//findSymbolForAddress( ULONG64 addr )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
// addr = addr64( addr );
|
|
||||||
//
|
|
||||||
// ULONG moduleIndex;
|
|
||||||
// ULONG64 moduleBase;
|
|
||||||
// hres = dbgExt->symbols->GetModuleByOffset( addr, 0, &moduleIndex, &moduleBase );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// {
|
|
||||||
// return boost::python::object();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// char moduleName[0x100];
|
|
||||||
// hres = dbgExt->symbols2->GetModuleNameString( DEBUG_MODNAME_MODULE, moduleIndex, moduleBase,
|
|
||||||
// moduleName, sizeof( moduleName ), NULL );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSymbol2::GetModuleNameString failed" );
|
|
||||||
//
|
|
||||||
// char symbolName[0x100];
|
|
||||||
// ULONG64 displace = 0;
|
|
||||||
// hres = dbgExt->symbols->GetNameByOffset( addr, symbolName, sizeof(symbolName), NULL, &displace );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSymbol::GetNameByOffset failed" );
|
|
||||||
//
|
|
||||||
// std::stringstream ss;
|
|
||||||
// displace == 0 ? ss << symbolName : ss << symbolName << '+' << std::hex << displace;
|
|
||||||
//
|
|
||||||
// return boost::python::object( ss.str() );
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// 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 boost::python::object();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//ULONG64
|
|
||||||
//findAddressForSymbol( const std::string &moduleName, const std::string &symbolName )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// std::string ModuleSymName = moduleName;
|
|
||||||
// ModuleSymName += "!";
|
|
||||||
// ModuleSymName += symbolName;
|
|
||||||
//
|
|
||||||
// ULONG64 offset = 0ULL;
|
|
||||||
// hres = dbgExt->symbols->GetOffsetByName( ModuleSymName.c_str(), &offset );
|
|
||||||
// if ( SUCCEEDED( hres ) )
|
|
||||||
// return offset;
|
|
||||||
//
|
|
||||||
// throw DbgException( "failed to find offset for symbol" );
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,13 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <string>
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//findSymbolForAddress( ULONG64 addr );
|
|
||||||
//
|
|
||||||
//ULONG64
|
|
||||||
//findAddressForSymbol( const std::string &moduleName, const std::string &symbolName );
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,651 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
//#include <boost/interprocess/sync/scoped_lock.hpp>
|
|
||||||
//#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
|
|
||||||
//#include <boost/interprocess/sync/interprocess_mutex.hpp>
|
|
||||||
//#include <list>
|
|
||||||
//
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//#include "dbgmem.h"
|
|
||||||
//#include "dbgmodule.h"
|
|
||||||
//#include "dbgexcept.h"
|
|
||||||
//#include "dbgsynsym.h"
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//struct SyntheticSymbol
|
|
||||||
//{
|
|
||||||
// std::string m_name;
|
|
||||||
// ULONG m_size;
|
|
||||||
//
|
|
||||||
// SyntheticSymbol()
|
|
||||||
// : m_size(0)
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
// SyntheticSymbol(
|
|
||||||
// const std::string &name
|
|
||||||
// ) : m_name(name)
|
|
||||||
// , m_size(0)
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
// SyntheticSymbol(
|
|
||||||
// const SyntheticSymbol &rhs
|
|
||||||
// ) : m_name(rhs.m_name)
|
|
||||||
// , m_size(rhs.m_size)
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// bool operator ==(const SyntheticSymbol &rhs) const
|
|
||||||
// {
|
|
||||||
// return m_name == rhs.m_name;
|
|
||||||
// }
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//// map of one module synthetic symbols
|
|
||||||
//typedef std::map<ULONG64, SyntheticSymbol> SynSymbolsForModule;
|
|
||||||
//
|
|
||||||
//// global synthetic symbols map by modules
|
|
||||||
//typedef std::map<ModuleInfo, SynSymbolsForModule> SynSymbolsMap;
|
|
||||||
//
|
|
||||||
//// synchro-object for global synthetic symbols map
|
|
||||||
//typedef boost::interprocess::interprocess_recursive_mutex SynSymbolsMapLockType;
|
|
||||||
//typedef boost::interprocess::interprocess_mutex SynSymbolsMapLockWriteType;
|
|
||||||
//
|
|
||||||
//// scoped lock synchro-object for global synthetic symbols map
|
|
||||||
//typedef boost::interprocess::scoped_lock<SynSymbolsMapLockType> SynSymbolsMapScopedLock;
|
|
||||||
//typedef boost::interprocess::scoped_lock<SynSymbolsMapLockWriteType> SynSymbolsMapScopedLockWrite;
|
|
||||||
//
|
|
||||||
//static struct _GlobalSyntheticSymbolMap : public SynSymbolsMap
|
|
||||||
//{
|
|
||||||
// SynSymbolsMapLockType m_Lock;
|
|
||||||
// SynSymbolsMapLockWriteType m_LockWrite;
|
|
||||||
//} g_SyntheticSymbolMap;
|
|
||||||
//
|
|
||||||
//#define _SynSymbolsMapScopedLock() \
|
|
||||||
// SynSymbolsMapScopedLock _lock(g_SyntheticSymbolMap.m_Lock)
|
|
||||||
//#define _SynSymbolsMapScopedLockWrite() \
|
|
||||||
// _SynSymbolsMapScopedLock(); \
|
|
||||||
// SynSymbolsMapScopedLockWrite _lockw(g_SyntheticSymbolMap.m_LockWrite)
|
|
||||||
//
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//bool addSyntheticSymbol(
|
|
||||||
// ULONG64 addr,
|
|
||||||
// ULONG size,
|
|
||||||
// const std::string &symName
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
//
|
|
||||||
// DEBUG_MODULE_AND_ID dbgModuleAndId = { 0 };
|
|
||||||
// addr = addr64(addr);
|
|
||||||
// HRESULT hres =
|
|
||||||
// dbgExt->symbols3->AddSyntheticSymbol(
|
|
||||||
// addr,
|
|
||||||
// size,
|
|
||||||
// symName.c_str(),
|
|
||||||
// DEBUG_ADDSYNTHSYM_DEFAULT,
|
|
||||||
// &dbgModuleAndId);
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "call IDebugSymbol3::AddSyntheticSymbol(...) failed" );
|
|
||||||
//
|
|
||||||
// DEBUG_MODULE_PARAMETERS dbgModuleParameters;
|
|
||||||
// hres = dbgExt->symbols->GetModuleParameters(
|
|
||||||
// 1,
|
|
||||||
// &dbgModuleAndId.ModuleBase,
|
|
||||||
// 0,
|
|
||||||
// &dbgModuleParameters);
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// {
|
|
||||||
// dbgExt->symbols3->RemoveSyntheticSymbol(&dbgModuleAndId);
|
|
||||||
// throw DbgException( "call IDebugSymbol3::GetModuleParameters(...) failed" );
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// _SynSymbolsMapScopedLockWrite();
|
|
||||||
//
|
|
||||||
// ModuleInfo moduleInfo(dbgModuleParameters);
|
|
||||||
// SynSymbolsForModule &mapSynSymbolsForModule =
|
|
||||||
// g_SyntheticSymbolMap[moduleInfo];
|
|
||||||
//
|
|
||||||
// ULONG64 addrSymbolOffset = addr - moduleInfo.m_base;
|
|
||||||
// SyntheticSymbol &synSymbol = mapSynSymbolsForModule[addrSymbolOffset];
|
|
||||||
//
|
|
||||||
// synSymbol.m_name = symName;
|
|
||||||
// synSymbol.m_size = size;
|
|
||||||
//
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// 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 false;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//bool addSyntheticSymbolForModule(
|
|
||||||
// ULONG64 offset,
|
|
||||||
// ULONG size,
|
|
||||||
// const std::string &symName,
|
|
||||||
// const ModuleInfo &moduleInfo
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// DEBUG_MODULE_AND_ID dbgModuleAndId = { 0 };
|
|
||||||
// offset = addr64(offset);
|
|
||||||
// HRESULT hres =
|
|
||||||
// dbgExt->symbols3->AddSyntheticSymbol(
|
|
||||||
// offset + moduleInfo.m_base,
|
|
||||||
// size,
|
|
||||||
// symName.c_str(),
|
|
||||||
// DEBUG_ADDSYNTHSYM_DEFAULT,
|
|
||||||
// &dbgModuleAndId);
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "call IDebugSymbol3::AddSyntheticSymbol(...) failed" );
|
|
||||||
//
|
|
||||||
// {
|
|
||||||
// DEBUG_MODULE_PARAMETERS dbgModuleParameters;
|
|
||||||
// hres = dbgExt->symbols->GetModuleParameters(
|
|
||||||
// 1,
|
|
||||||
// &dbgModuleAndId.ModuleBase,
|
|
||||||
// 0,
|
|
||||||
// &dbgModuleParameters);
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// {
|
|
||||||
// dbgExt->symbols3->RemoveSyntheticSymbol(&dbgModuleAndId);
|
|
||||||
// throw DbgException( "call IDebugSymbol3::GetModuleParameters(...) failed" );
|
|
||||||
// }
|
|
||||||
// ModuleInfo gettedModuleInfo(dbgModuleParameters);
|
|
||||||
// if (!(gettedModuleInfo == moduleInfo))
|
|
||||||
// {
|
|
||||||
// // module mismatch
|
|
||||||
// dbgExt->control->Output( DEBUG_OUTPUT_ERROR, "pykd!" __FUNCTION__ " mismatch modules\n" );
|
|
||||||
// dbgExt->symbols3->RemoveSyntheticSymbol(&dbgModuleAndId);
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// _SynSymbolsMapScopedLockWrite();
|
|
||||||
//
|
|
||||||
// SynSymbolsForModule &mapSynSymbolsForModule =
|
|
||||||
// g_SyntheticSymbolMap[moduleInfo];
|
|
||||||
//
|
|
||||||
// SyntheticSymbol &synSymbol = mapSynSymbolsForModule[offset];
|
|
||||||
//
|
|
||||||
// synSymbol.m_name = symName;
|
|
||||||
// synSymbol.m_size = size;
|
|
||||||
//
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// 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 false;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//struct SynSymbolNameCmp
|
|
||||||
//{
|
|
||||||
// SynSymbolNameCmp(const std::string &symName ) : m_symName(symName) { }
|
|
||||||
// bool operator() (const std::pair<ULONG64, SyntheticSymbol> &rhs) const
|
|
||||||
// {
|
|
||||||
// return m_symName == rhs.second.m_name;
|
|
||||||
// }
|
|
||||||
// const std::string &m_symName;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//ULONG64 getSyntheticSymbol(
|
|
||||||
// const ModuleInfo &moduleInfo,
|
|
||||||
// const std::string &symName
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// ULONG64 nAddress = 0;
|
|
||||||
//
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// _SynSymbolsMapScopedLock();
|
|
||||||
//
|
|
||||||
// // try find module
|
|
||||||
// SynSymbolsMap::const_iterator itSynSymbols =
|
|
||||||
// g_SyntheticSymbolMap.find( moduleInfo );
|
|
||||||
// if (itSynSymbols != g_SyntheticSymbolMap.end())
|
|
||||||
// {
|
|
||||||
// // try find symbol by name
|
|
||||||
// const SynSymbolsForModule &mapSynSymbolsForModule = itSynSymbols->second;
|
|
||||||
// SynSymbolNameCmp nameCmp(symName);
|
|
||||||
//
|
|
||||||
// // FIXME: get first matched by name
|
|
||||||
// SynSymbolsForModule::const_iterator itSynSymbol =
|
|
||||||
// find_if(
|
|
||||||
// mapSynSymbolsForModule.begin(),
|
|
||||||
// mapSynSymbolsForModule.end(),
|
|
||||||
// nameCmp);
|
|
||||||
// if (itSynSymbol != mapSynSymbolsForModule.end())
|
|
||||||
// nAddress = moduleInfo.m_base + itSynSymbol->first;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// 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 nAddress;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//// remove synthetic symbols by array of DEBUG_MODULE_AND_ID
|
|
||||||
//inline ULONG RemoveSyntheticSymbols(
|
|
||||||
// const std::vector<DEBUG_MODULE_AND_ID> &arrSymbols
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// ULONG nResult = 0;
|
|
||||||
// for (ULONG i = 0; i < arrSymbols.size(); ++i)
|
|
||||||
// {
|
|
||||||
// HRESULT hres =
|
|
||||||
// dbgExt->symbols3->RemoveSyntheticSymbol(
|
|
||||||
// const_cast<PDEBUG_MODULE_AND_ID>(&arrSymbols[i]));
|
|
||||||
// if (FAILED(hres))
|
|
||||||
// continue;
|
|
||||||
// ++nResult;
|
|
||||||
// }
|
|
||||||
// return nResult;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//static ULONG RemoveSynSymbolsByAddress(ULONG64 addr)
|
|
||||||
//{
|
|
||||||
// ULONG nEntries = 0;
|
|
||||||
// dbgExt->symbols3->GetSymbolEntriesByOffset(
|
|
||||||
// addr,
|
|
||||||
// 0,
|
|
||||||
// NULL,
|
|
||||||
// NULL,
|
|
||||||
// 0,
|
|
||||||
// &nEntries);
|
|
||||||
// if (nEntries)
|
|
||||||
// {
|
|
||||||
// std::vector<DEBUG_MODULE_AND_ID> arrSymbols(nEntries);
|
|
||||||
// HRESULT hres = dbgExt->symbols3->GetSymbolEntriesByOffset(
|
|
||||||
// addr,
|
|
||||||
// 0,
|
|
||||||
// &arrSymbols[0],
|
|
||||||
// NULL,
|
|
||||||
// (ULONG)arrSymbols.size(),
|
|
||||||
// NULL);
|
|
||||||
// if (SUCCEEDED(hres))
|
|
||||||
// return RemoveSyntheticSymbols(arrSymbols);
|
|
||||||
// }
|
|
||||||
// return 0;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//static void DeleteSynSymbolsForModule(
|
|
||||||
// const std::pair<ModuleInfo, SynSymbolsForModule> &synSymbolsForModule
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// DEBUG_MODULE_PARAMETERS dbgModuleParameters;
|
|
||||||
// HRESULT hres = dbgExt->symbols->GetModuleParameters(
|
|
||||||
// 1,
|
|
||||||
// const_cast<PULONG64>(&synSymbolsForModule.first.m_base),
|
|
||||||
// 0,
|
|
||||||
// &dbgModuleParameters);
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// return;
|
|
||||||
// ModuleInfo gettedModuleInfo(dbgModuleParameters);
|
|
||||||
// if (gettedModuleInfo == synSymbolsForModule.first)
|
|
||||||
// {
|
|
||||||
// // no clear - global map will be cleared on exit
|
|
||||||
// SynSymbolsForModule::const_iterator itSynSymbol =
|
|
||||||
// synSymbolsForModule.second.begin();
|
|
||||||
// while (itSynSymbol != synSymbolsForModule.second.end())
|
|
||||||
// {
|
|
||||||
// RemoveSynSymbolsByAddress(
|
|
||||||
// gettedModuleInfo.m_base + itSynSymbol->first);
|
|
||||||
// ++itSynSymbol;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void delAllSyntheticSymbols()
|
|
||||||
//{
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// _SynSymbolsMapScopedLockWrite();
|
|
||||||
//
|
|
||||||
// for_each(
|
|
||||||
// g_SyntheticSymbolMap.begin(),
|
|
||||||
// g_SyntheticSymbolMap.end(),
|
|
||||||
// DeleteSynSymbolsForModule);
|
|
||||||
// g_SyntheticSymbolMap.clear();
|
|
||||||
// }
|
|
||||||
// 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" );
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void delAllSyntheticSymbolsForModule(
|
|
||||||
// const ModuleInfo &moduleInfo
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// _SynSymbolsMapScopedLockWrite();
|
|
||||||
//
|
|
||||||
// SynSymbolsMap::iterator itSynSymbols =
|
|
||||||
// g_SyntheticSymbolMap.find(moduleInfo);
|
|
||||||
// if (itSynSymbols != g_SyntheticSymbolMap.end())
|
|
||||||
// {
|
|
||||||
// std::pair<ModuleInfo, SynSymbolsForModule> synSymbolsForModule(
|
|
||||||
// moduleInfo, itSynSymbols->second);
|
|
||||||
// DeleteSynSymbolsForModule(synSymbolsForModule);
|
|
||||||
// g_SyntheticSymbolMap.erase(itSynSymbols);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// 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" );
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//ULONG delSyntheticSymbolForModuleNoLock(
|
|
||||||
// ULONG64 offset,
|
|
||||||
// const ModuleInfo &moduleInfo
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// SynSymbolsMap::iterator itSynSymbols =
|
|
||||||
// g_SyntheticSymbolMap.find(moduleInfo);
|
|
||||||
// if (itSynSymbols != g_SyntheticSymbolMap.end())
|
|
||||||
// {
|
|
||||||
// offset = addr64(offset);
|
|
||||||
// SynSymbolsForModule::iterator itSynSymbol =
|
|
||||||
// itSynSymbols->second.find( offset );
|
|
||||||
// if (itSynSymbol != itSynSymbols->second.end())
|
|
||||||
// {
|
|
||||||
// ULONG nResult =
|
|
||||||
// RemoveSynSymbolsByAddress(moduleInfo.m_base + offset);
|
|
||||||
// itSynSymbols->second.erase(itSynSymbol);
|
|
||||||
// return nResult;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return 0;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//ULONG delSyntheticSymbol(
|
|
||||||
// ULONG64 addr
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// // query module information
|
|
||||||
// addr = addr64(addr);
|
|
||||||
// ULONG64 ptrModuleBase;
|
|
||||||
// HRESULT hres =
|
|
||||||
// dbgExt->symbols->GetModuleByOffset(addr, 0, NULL, &ptrModuleBase);
|
|
||||||
// if ( SUCCEEDED(hres) )
|
|
||||||
// {
|
|
||||||
// DEBUG_MODULE_PARAMETERS dbgModuleParameters;
|
|
||||||
// hres =
|
|
||||||
// dbgExt->symbols->GetModuleParameters(
|
|
||||||
// 1,
|
|
||||||
// &ptrModuleBase,
|
|
||||||
// 0,
|
|
||||||
// &dbgModuleParameters);
|
|
||||||
// if ( SUCCEEDED(hres) )
|
|
||||||
// {
|
|
||||||
// _SynSymbolsMapScopedLockWrite();
|
|
||||||
//
|
|
||||||
// ModuleInfo moduleInfo(dbgModuleParameters);
|
|
||||||
// return
|
|
||||||
// delSyntheticSymbolForModuleNoLock(
|
|
||||||
// addr - moduleInfo.m_base,
|
|
||||||
// moduleInfo);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// 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 0;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//ULONG delSyntheticSymbolForModule(
|
|
||||||
// ULONG64 offset,
|
|
||||||
// const ModuleInfo &moduleInfo
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// _SynSymbolsMapScopedLockWrite();
|
|
||||||
// return delSyntheticSymbolForModuleNoLock(offset, moduleInfo);
|
|
||||||
// }
|
|
||||||
// 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 0;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//// remove synthetic symbols from global map
|
|
||||||
//inline void RemoveSyntheticSymbolsFromMap(
|
|
||||||
// const std::vector<DEBUG_MODULE_AND_ID> &arrSymbols
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// for (ULONG i = 0; i < arrSymbols.size(); ++i)
|
|
||||||
// {
|
|
||||||
// DEBUG_SYMBOL_ENTRY dbgSymbolEntry;
|
|
||||||
// HRESULT hres = dbgExt->symbols3->GetSymbolEntryInformation(
|
|
||||||
// const_cast<PDEBUG_MODULE_AND_ID>(&arrSymbols[i]),
|
|
||||||
// &dbgSymbolEntry);
|
|
||||||
// if (FAILED(hres))
|
|
||||||
// continue;
|
|
||||||
//
|
|
||||||
// DEBUG_MODULE_PARAMETERS dbgModuleParameters;
|
|
||||||
// hres = dbgExt->symbols->GetModuleParameters(
|
|
||||||
// 1,
|
|
||||||
// &dbgSymbolEntry.ModuleBase,
|
|
||||||
// 0,
|
|
||||||
// &dbgModuleParameters);
|
|
||||||
// if (FAILED(hres))
|
|
||||||
// continue;
|
|
||||||
//
|
|
||||||
// ModuleInfo moduleInfo(dbgModuleParameters);
|
|
||||||
// SynSymbolsMap::iterator itSynSymbols =
|
|
||||||
// g_SyntheticSymbolMap.find(moduleInfo);
|
|
||||||
// if (itSynSymbols != g_SyntheticSymbolMap.end())
|
|
||||||
// {
|
|
||||||
// ULONG64 offset = dbgSymbolEntry.Offset - dbgSymbolEntry.ModuleBase;
|
|
||||||
// SynSymbolsForModule::iterator itSynSymbol =
|
|
||||||
// itSynSymbols->second.find( offset );
|
|
||||||
// if (itSynSymbol != itSynSymbols->second.end())
|
|
||||||
// itSynSymbols->second.erase(itSynSymbol);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//ULONG delSyntheticSymbolsMask(
|
|
||||||
// const std::string &moduleName,
|
|
||||||
// const std::string &symName
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// ULONG nResult = 0;
|
|
||||||
//
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// std::string symMask = moduleName + "!" + symName;
|
|
||||||
// ULONG nEntries = 0;
|
|
||||||
// dbgExt->symbols3->GetSymbolEntriesByName(
|
|
||||||
// symMask.c_str(),
|
|
||||||
// 0,
|
|
||||||
// NULL,
|
|
||||||
// 0,
|
|
||||||
// &nEntries);
|
|
||||||
// if (nEntries)
|
|
||||||
// {
|
|
||||||
// std::vector<DEBUG_MODULE_AND_ID> arrSymbols(nEntries);
|
|
||||||
// HRESULT hres = dbgExt->symbols3->GetSymbolEntriesByName(
|
|
||||||
// symMask.c_str(),
|
|
||||||
// 0,
|
|
||||||
// &arrSymbols[0],
|
|
||||||
// (ULONG)arrSymbols.size(),
|
|
||||||
// NULL);
|
|
||||||
// if (FAILED(hres))
|
|
||||||
// throw DbgException( "call IDebugSymbol3::GetSymbolEntriesByOffset(...) failed" );
|
|
||||||
//
|
|
||||||
// {
|
|
||||||
// _SynSymbolsMapScopedLockWrite();
|
|
||||||
// RemoveSyntheticSymbolsFromMap(arrSymbols);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return RemoveSyntheticSymbols(arrSymbols);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// 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 nResult;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//static void restoreSyntheticSymbolForModuleNoLock(
|
|
||||||
// const ModuleInfo &moduleInfo
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// SynSymbolsMap::const_iterator itSynSymbols =
|
|
||||||
// g_SyntheticSymbolMap.find( moduleInfo );
|
|
||||||
// if (itSynSymbols != g_SyntheticSymbolMap.end())
|
|
||||||
// {
|
|
||||||
// SynSymbolsForModule::const_iterator itSynSymbol =
|
|
||||||
// itSynSymbols->second.begin();
|
|
||||||
// while (itSynSymbol != itSynSymbols->second.end())
|
|
||||||
// {
|
|
||||||
// DEBUG_MODULE_AND_ID dbgModuleAndId;
|
|
||||||
// dbgExt->symbols3->AddSyntheticSymbol(
|
|
||||||
// moduleInfo.m_base + itSynSymbol->first,
|
|
||||||
// itSynSymbol->second.m_size,
|
|
||||||
// itSynSymbol->second.m_name.c_str(),
|
|
||||||
// DEBUG_ADDSYNTHSYM_DEFAULT,
|
|
||||||
// &dbgModuleAndId);
|
|
||||||
//
|
|
||||||
// ++itSynSymbol;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void restoreSyntheticSymbolForModule(
|
|
||||||
// const ModuleInfo &moduleInfo
|
|
||||||
//)
|
|
||||||
//{
|
|
||||||
// _SynSymbolsMapScopedLock();
|
|
||||||
//
|
|
||||||
// // see (**1)
|
|
||||||
// restoreSyntheticSymbolForModuleNoLock(moduleInfo);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void restoreSyntheticSymbolForAllModules()
|
|
||||||
//{
|
|
||||||
// try
|
|
||||||
// {
|
|
||||||
// _SynSymbolsMapScopedLock();
|
|
||||||
//
|
|
||||||
// if (g_SyntheticSymbolMap.empty())
|
|
||||||
// return;
|
|
||||||
//
|
|
||||||
// ULONG nLoaded;
|
|
||||||
// ULONG nUnloaded;
|
|
||||||
//
|
|
||||||
// HRESULT hres = dbgExt->symbols3->GetNumberModules(&nLoaded, &nUnloaded);
|
|
||||||
// if (SUCCEEDED(hres) && (nLoaded || nUnloaded))
|
|
||||||
// {
|
|
||||||
// std::vector<DEBUG_MODULE_PARAMETERS> arrModules(nLoaded + nUnloaded);
|
|
||||||
// hres =
|
|
||||||
// dbgExt->symbols3->GetModuleParameters(
|
|
||||||
// (ULONG)arrModules.size(),
|
|
||||||
// NULL,
|
|
||||||
// 0,
|
|
||||||
// &arrModules[0]);
|
|
||||||
// if (SUCCEEDED(hres))
|
|
||||||
// {
|
|
||||||
// for (ULONG i = 0; i < arrModules.size(); ++i)
|
|
||||||
// {
|
|
||||||
// ModuleInfo moduleInfo(arrModules[i]);
|
|
||||||
// restoreSyntheticSymbolForModuleNoLock(moduleInfo);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// catch (...)
|
|
||||||
// {
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,56 +0,0 @@
|
|||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//// Global functions
|
|
||||||
//
|
|
||||||
//bool addSyntheticSymbol(
|
|
||||||
// ULONG64 addr,
|
|
||||||
// ULONG size,
|
|
||||||
// const std::string &symName
|
|
||||||
//);
|
|
||||||
//
|
|
||||||
//void delAllSyntheticSymbols();
|
|
||||||
//
|
|
||||||
//ULONG delSyntheticSymbol(
|
|
||||||
// ULONG64 addr
|
|
||||||
//);
|
|
||||||
//
|
|
||||||
//ULONG delSyntheticSymbolsMask(
|
|
||||||
// const std::string &moduleName,
|
|
||||||
// const std::string &symName
|
|
||||||
//);
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//// Functions for dbgModuleClass
|
|
||||||
//
|
|
||||||
//ULONG64 getSyntheticSymbol(
|
|
||||||
// const ModuleInfo &moduleInfo,
|
|
||||||
// const std::string &symName
|
|
||||||
//);
|
|
||||||
//
|
|
||||||
//bool addSyntheticSymbolForModule(
|
|
||||||
// ULONG64 offset,
|
|
||||||
// ULONG size,
|
|
||||||
// const std::string &symName,
|
|
||||||
// const ModuleInfo &moduleInfo
|
|
||||||
//);
|
|
||||||
//
|
|
||||||
//ULONG delSyntheticSymbolForModule(
|
|
||||||
// ULONG64 offset,
|
|
||||||
// const ModuleInfo &moduleInfo
|
|
||||||
//);
|
|
||||||
//
|
|
||||||
//void delAllSyntheticSymbolsForModule(
|
|
||||||
// const ModuleInfo &moduleInfo
|
|
||||||
//);
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//// External callbacks
|
|
||||||
//
|
|
||||||
//void restoreSyntheticSymbolForModule(
|
|
||||||
// const ModuleInfo &moduleInfo );
|
|
||||||
//
|
|
||||||
//void restoreSyntheticSymbolForAllModules();
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,210 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
|
|
||||||
//#include <exception>
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//#include "dbgexcept.h"
|
|
||||||
//#include "dbgsystem.h"
|
|
||||||
//#include "dbgio.h"
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//bool
|
|
||||||
//is64bitSystem()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->IsPointer64Bit();
|
|
||||||
//
|
|
||||||
// return hres == S_OK;
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// 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 false;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//int
|
|
||||||
//ptrSize()
|
|
||||||
//{
|
|
||||||
// return is64bitSystem() ? 8 : 4;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//dbgSymPath()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
// std::string pathStr;
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
// ULONG size;
|
|
||||||
// dbgExt->symbols->GetSymbolPath( NULL, 0, &size );
|
|
||||||
//
|
|
||||||
// std::vector<char> path(size);
|
|
||||||
// hres = dbgExt->symbols->GetSymbolPath( &path[0], size, NULL );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugSymbols::GetSymbolPath failed" );
|
|
||||||
//
|
|
||||||
// pathStr = &path[0];
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// 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 pathStr;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//getPdbFile( ULONG64 moduleBase )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// IMAGEHLP_MODULEW64 imageHelpInfo = { 0 };
|
|
||||||
//
|
|
||||||
// hres =
|
|
||||||
// dbgExt->advanced2->GetSymbolInformation(
|
|
||||||
// DEBUG_SYMINFO_IMAGEHLP_MODULEW64,
|
|
||||||
// moduleBase,
|
|
||||||
// 0,
|
|
||||||
// &imageHelpInfo,
|
|
||||||
// sizeof( imageHelpInfo ),
|
|
||||||
// NULL,
|
|
||||||
// NULL,
|
|
||||||
// 0,
|
|
||||||
// NULL );
|
|
||||||
//
|
|
||||||
// char fileName[ 256 ];
|
|
||||||
// WideCharToMultiByte( CP_ACP, 0, imageHelpInfo.LoadedPdbName, 256, fileName, 256, NULL, NULL );
|
|
||||||
//
|
|
||||||
// return std::string( fileName );
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// 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 std::string();
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//reloadModule( const char * moduleName )
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
// // ïîäàâèòü âûâîä ñîîáùåíèé îá îòñóòñòâèè ñèìâîëîâ
|
|
||||||
// OutputReader outputReader( dbgExt->client );
|
|
||||||
//
|
|
||||||
// hres = dbgExt->symbols->Reload( moduleName );
|
|
||||||
//
|
|
||||||
// //if ( FAILED( hres ) )
|
|
||||||
// // throw DbgException( "IDebugSymbol::Reload failed" );
|
|
||||||
// }
|
|
||||||
// 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" );
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//bool
|
|
||||||
//isKernelDebugging()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
// bool result = false;
|
|
||||||
//
|
|
||||||
// try {
|
|
||||||
//
|
|
||||||
// ULONG debugClass, debugQualifier;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->GetDebuggeeType( &debugClass, &debugQualifier );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::GetDebuggeeType failed" );
|
|
||||||
//
|
|
||||||
// result = debugClass == DEBUG_CLASS_KERNEL;
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// 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;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//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;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,31 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <string>
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//bool
|
|
||||||
//is64bitSystem();
|
|
||||||
//
|
|
||||||
//int
|
|
||||||
//ptrSize();
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//dbgSymPath();
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//getPdbFile( ULONG64 moduleBase );
|
|
||||||
//
|
|
||||||
//std::string
|
|
||||||
//getImageFile( ULONG64 moduleBase );
|
|
||||||
//
|
|
||||||
//void
|
|
||||||
//reloadModule( const char * moduleName );
|
|
||||||
//
|
|
||||||
//bool
|
|
||||||
//isKernelDebugging();
|
|
||||||
//
|
|
||||||
//bool
|
|
||||||
//isDumpAnalyzing();
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
1113
pykd/dbgtype.cpp
1113
pykd/dbgtype.cpp
File diff suppressed because it is too large
Load Diff
295
pykd/dbgtype.h
295
pykd/dbgtype.h
@ -1,295 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
//#include <string>
|
|
||||||
//#include <map>
|
|
||||||
//
|
|
||||||
//#include "dbgmem.h"
|
|
||||||
//#include "dbgsystem.h"
|
|
||||||
//
|
|
||||||
//#include <boost/python/slice.hpp>
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class TypedVar;
|
|
||||||
//class TypeInfo;
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class TypeInfo {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// TypeInfo() :
|
|
||||||
// m_size(0),
|
|
||||||
// m_arraySize( 0 ),
|
|
||||||
// m_parentOffset( 0 ),
|
|
||||||
// m_align( 0 ),
|
|
||||||
// m_isFreezed( false ),
|
|
||||||
// m_isBaseType( false ),
|
|
||||||
// m_isPointer( false ),
|
|
||||||
// m_alignReq(1)
|
|
||||||
// {}
|
|
||||||
//
|
|
||||||
// TypeInfo( const std::string customName, ULONG align = 0) :
|
|
||||||
// m_typeName( customName ),
|
|
||||||
// m_size( 0 ),
|
|
||||||
// m_arraySize( 0 ),
|
|
||||||
// m_parentOffset( 0 ),
|
|
||||||
// m_isFreezed( false ),
|
|
||||||
// m_align( align ),
|
|
||||||
// m_isBaseType( false ),
|
|
||||||
// m_isPointer( false ),
|
|
||||||
// m_alignReq(1)
|
|
||||||
// {}
|
|
||||||
//
|
|
||||||
// TypeInfo( const std::string &moduleName, const std::string &typeName );
|
|
||||||
//
|
|
||||||
// TypeInfo( const std::string &moduleName, ULONG64 moduleBase, ULONG typeId );
|
|
||||||
//
|
|
||||||
// static
|
|
||||||
// const TypeInfo&
|
|
||||||
// get( const std::string &moduleName, const std::string &typeName );
|
|
||||||
//
|
|
||||||
// ULONG
|
|
||||||
// size() const {
|
|
||||||
// return m_size;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG
|
|
||||||
// count() const {
|
|
||||||
// assert( m_size != 0 && m_arraySize >= m_size );
|
|
||||||
// return m_arraySize / m_size;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG
|
|
||||||
// fullSize() const {
|
|
||||||
// return m_arraySize;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// const std::string
|
|
||||||
// name() const {
|
|
||||||
// return m_typeName;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// const std::string
|
|
||||||
// moduleName() const {
|
|
||||||
// return m_moduleName;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// boost::python::object
|
|
||||||
// load( void* buffer, size_t bufferLength ) const;
|
|
||||||
//
|
|
||||||
// std::string
|
|
||||||
// printField( size_t index, void* buffer, size_t bufferLength ) const;
|
|
||||||
//
|
|
||||||
// std::string
|
|
||||||
// print() const;
|
|
||||||
//
|
|
||||||
// TypeInfo
|
|
||||||
// getField( const std::string &fieldName ) const;
|
|
||||||
//
|
|
||||||
// TypeInfo
|
|
||||||
// getFieldAt( size_t index ) const;
|
|
||||||
//
|
|
||||||
// ULONG
|
|
||||||
// getFieldOffset() const {
|
|
||||||
// return m_parentOffset;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// boost::python::object
|
|
||||||
// getFieldByIndex( boost::python::object &index ) const;
|
|
||||||
//
|
|
||||||
// size_t
|
|
||||||
// getFieldCount() const {
|
|
||||||
// return m_fields.size();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// void
|
|
||||||
// appendField( const TypeInfo &typeInfo, const std::string &fieldName, ULONG count = 1 );
|
|
||||||
//
|
|
||||||
// bool
|
|
||||||
// isBaseType() const {
|
|
||||||
// return m_isBaseType;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// bool
|
|
||||||
// isPtr() const {
|
|
||||||
// return m_isPointer;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// bool
|
|
||||||
// isEnum() const {
|
|
||||||
// return !m_isBaseType && !m_isPointer && m_fields.size() == 0 && m_size == 4;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// boost::python::object
|
|
||||||
// loadVar( ULONG64 targetOffset, ULONG count = 1) const;
|
|
||||||
//
|
|
||||||
// void setAlignReq(ULONG alignReq) {
|
|
||||||
// m_alignReq = alignReq;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// typedef std::map< std::pair<std::string, std::string>, TypeInfo> TypeInfoMap;
|
|
||||||
//
|
|
||||||
// template< typename TTypeInfo>
|
|
||||||
// struct TypeFieldT {
|
|
||||||
//
|
|
||||||
// std::string name;
|
|
||||||
//
|
|
||||||
// ULONG offset;
|
|
||||||
//
|
|
||||||
// ULONG size;
|
|
||||||
//
|
|
||||||
// TTypeInfo type;
|
|
||||||
//
|
|
||||||
// TypeFieldT( const std::string &name_, const TTypeInfo &type_, ULONG size_, ULONG offset_ ) :
|
|
||||||
// name( name_ ),
|
|
||||||
// size( size_ ),
|
|
||||||
// offset( offset_ ),
|
|
||||||
// type( type_ )
|
|
||||||
// {}
|
|
||||||
//
|
|
||||||
// std::string print() const;
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
// typedef TypeFieldT<TypeInfo> TypeField;
|
|
||||||
//
|
|
||||||
// typedef std::vector<TypeField> TypeFieldList;
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// ULONG getAlignReq() const;
|
|
||||||
//
|
|
||||||
// void addField(
|
|
||||||
// const std::string &name_,
|
|
||||||
// const TypeInfo &type_,
|
|
||||||
// ULONG size_,
|
|
||||||
// ULONG offset_
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// typedef
|
|
||||||
// boost::python::object
|
|
||||||
// (*basicTypeLoader)( void* address, size_t size );
|
|
||||||
//
|
|
||||||
// typedef
|
|
||||||
// std::string
|
|
||||||
// (*basicTypePrinter)( void* address, size_t size );
|
|
||||||
//
|
|
||||||
// static TypeInfoMap g_typeInfoCache;
|
|
||||||
//
|
|
||||||
// static const char* basicTypeNames[];
|
|
||||||
//
|
|
||||||
// static size_t basicTypeSizes[];
|
|
||||||
//
|
|
||||||
// static basicTypeLoader basicTypeLoaders[];
|
|
||||||
//
|
|
||||||
// static basicTypePrinter basicTypePrinters[];
|
|
||||||
//
|
|
||||||
// ULONG m_size;
|
|
||||||
//
|
|
||||||
// ULONG m_arraySize;
|
|
||||||
//
|
|
||||||
// std::string m_typeName;
|
|
||||||
//
|
|
||||||
// std::string m_moduleName;
|
|
||||||
//
|
|
||||||
// TypeFieldList m_fields;
|
|
||||||
//
|
|
||||||
// bool m_isPointer;
|
|
||||||
//
|
|
||||||
// bool m_isBaseType;
|
|
||||||
//
|
|
||||||
// bool m_isFreezed;
|
|
||||||
//
|
|
||||||
// ULONG m_align;
|
|
||||||
//
|
|
||||||
// ULONG m_alignReq;
|
|
||||||
//
|
|
||||||
// ULONG m_parentOffset;
|
|
||||||
//
|
|
||||||
// static bool checkBaseType( const std::string &typeName );
|
|
||||||
//
|
|
||||||
// static ULONG getBaseTypeSize( const std::string &typeName );
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class TypedVar {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// TypedVar() :
|
|
||||||
// m_targetOffset ( 0 )
|
|
||||||
// {}
|
|
||||||
//
|
|
||||||
// TypedVar( const TypeInfo &typeInfo, ULONG64 targetOffset ) :
|
|
||||||
// m_typeInfo( typeInfo ),
|
|
||||||
// m_targetOffset( addr64(targetOffset) )
|
|
||||||
// {}
|
|
||||||
//
|
|
||||||
// TypedVar( const std::string &moduleName, const std::string &typeName, ULONG64 targetOffset ) :
|
|
||||||
// m_typeInfo( moduleName, typeName ),
|
|
||||||
// m_targetOffset( addr64(targetOffset) )
|
|
||||||
// {}
|
|
||||||
//
|
|
||||||
// TypedVar( ULONG64 targetOffset );
|
|
||||||
//
|
|
||||||
// TypedVar( const std::string &symbolName );
|
|
||||||
//
|
|
||||||
// ULONG64
|
|
||||||
// getAddress() const {
|
|
||||||
// return m_targetOffset;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG
|
|
||||||
// getSize() const {
|
|
||||||
// return m_typeInfo.fullSize();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// static
|
|
||||||
// boost::python::object
|
|
||||||
// getFieldWrap( PyObject* self, const std::string &fieldName );
|
|
||||||
//
|
|
||||||
// boost::python::object
|
|
||||||
// getField( boost::python::object &pyobj, const std::string &fieldName );
|
|
||||||
//
|
|
||||||
// ULONG64 getTargetOffset() const {
|
|
||||||
// return m_targetOffset;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// std::string data();
|
|
||||||
//
|
|
||||||
// std::string print();
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// void reallocBuffer();
|
|
||||||
//
|
|
||||||
// TypedVar( const TypeInfo &typeInfo, ULONG64 targetOffset, char* buffer, size_t bufferLength );
|
|
||||||
//
|
|
||||||
// ULONG64 m_targetOffset;
|
|
||||||
//
|
|
||||||
// TypeInfo m_typeInfo;
|
|
||||||
//
|
|
||||||
// std::vector<char> m_buffer;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//loadTypedVarList( ULONG64 address, const std::string &moduleName, const std::string &typeName, const std::string &listEntryName );
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//loadTypedVarArray( ULONG64 address, const std::string &moduleName, const std::string &typeName, long number );
|
|
||||||
//
|
|
||||||
//boost::python::object
|
|
||||||
//containingRecord( ULONG64 address, const std::string &moduleName, const std::string &typeName, const std::string &fieldName );
|
|
||||||
//
|
|
||||||
//ULONG
|
|
||||||
//sizeofType( const std::string &moduleName, const std::string &typeName );
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
@ -1,49 +0,0 @@
|
|||||||
#include "stdafx.h"
|
|
||||||
//#include "dbgext.h"
|
|
||||||
//#include "disasm.h"
|
|
||||||
//#include "dbgexcept.h"
|
|
||||||
//#include "dbgmem.h"
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//void disasm::doDisasm()
|
|
||||||
//{
|
|
||||||
// HRESULT hres;
|
|
||||||
// char buffer[0x100];
|
|
||||||
// ULONG disasmSize = 0;
|
|
||||||
// ULONG64 offset = addr64(m_currentOffset);
|
|
||||||
// ULONG64 endOffset = 0;
|
|
||||||
//
|
|
||||||
// if ( m_beginOffset == 0 )
|
|
||||||
// {
|
|
||||||
// ULONG64 currentOffset = 0;
|
|
||||||
//
|
|
||||||
// hres = dbgExt->registers->GetInstructionOffset( ¤tOffset );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugRegisters::GetInstructionOffset failed" );
|
|
||||||
//
|
|
||||||
// offset += currentOffset;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// hres =
|
|
||||||
// dbgExt->control->Disassemble(
|
|
||||||
// offset,
|
|
||||||
// DEBUG_DISASM_EFFECTIVE_ADDRESS,
|
|
||||||
// buffer,
|
|
||||||
// sizeof(buffer),
|
|
||||||
// &disasmSize,
|
|
||||||
// &endOffset );
|
|
||||||
//
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// throw DbgException( "IDebugControl::Disassemble failed" );
|
|
||||||
//
|
|
||||||
// hres = dbgExt->control->GetDisassembleEffectiveOffset( &m_ea );
|
|
||||||
// if ( FAILED( hres ) )
|
|
||||||
// m_ea = 0;
|
|
||||||
//
|
|
||||||
// m_length = (ULONG)(endOffset - offset);
|
|
||||||
//
|
|
||||||
// m_disasm = std::string( buffer, disasmSize - 2);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
@ -1,54 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//class disasm {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// disasm( ULONG64 offset = 0) :
|
|
||||||
// m_beginOffset( offset ),
|
|
||||||
// m_currentOffset( offset ) {
|
|
||||||
// doDisasm();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// std::string next() {
|
|
||||||
// m_currentOffset += m_length;
|
|
||||||
// doDisasm();
|
|
||||||
// return m_disasm;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// std::string instruction() const {
|
|
||||||
// return m_disasm;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG64 begin() const {
|
|
||||||
// return m_beginOffset;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG64 current() const {
|
|
||||||
// return m_currentOffset;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG length() const {
|
|
||||||
// return m_length;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ULONG64 ea() const {
|
|
||||||
// return m_ea;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
//
|
|
||||||
// void doDisasm();
|
|
||||||
//
|
|
||||||
// ULONG64 m_beginOffset;
|
|
||||||
// ULONG64 m_currentOffset;
|
|
||||||
// ULONG64 m_ea;
|
|
||||||
// ULONG m_length;
|
|
||||||
//
|
|
||||||
// std::string m_disasm;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
|
57
pykd/pyaux.h
57
pykd/pyaux.h
@ -1,57 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
//typedef PyThreadState *PyThreadStatePtr;
|
|
||||||
//extern __declspec( thread ) PyThreadStatePtr ptrPyThreadState;
|
|
||||||
//
|
|
||||||
//// --> call back
|
|
||||||
//// { PyThread_StateSave state( winext->getThreadState() );
|
|
||||||
//// do_callback();
|
|
||||||
//// }
|
|
||||||
////
|
|
||||||
//// Ĺńëč ęîëáĺę áűë âűçâŕí č ďđč ýňîě ó ňĺęůĺăî ďîňîęŕ ńîőđŕíĺí ęîíňĺęńň ( áűë âűçîâ setExecutionStatus )
|
|
||||||
//// ňî ďĺđĺä âűďîëíĺíčĺě ďčňîíîâńęîăî ęîäŕ íóćíî âîńńňŕíîâčňü ęîíňĺęńň, ŕ ďîńëĺ âîçâđŕňŕ óďđŕâëĺíč˙,
|
|
||||||
//// ńíîâŕ ńîőđŕíčňü ĺăî
|
|
||||||
//
|
|
||||||
//class PyThread_StateSave {
|
|
||||||
//
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// PyThread_StateSave()
|
|
||||||
// : m_bRestored(false)
|
|
||||||
// {
|
|
||||||
// if (ptrPyThreadState)
|
|
||||||
// {
|
|
||||||
// PyEval_RestoreThread( ptrPyThreadState );
|
|
||||||
// m_bRestored = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ~PyThread_StateSave() {
|
|
||||||
// if ( m_bRestored )
|
|
||||||
// ptrPyThreadState = PyEval_SaveThread();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//private:
|
|
||||||
// bool m_bRestored;
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
//// { PyThread_StateRestore state;
|
|
||||||
//// long_or_block_opreration();
|
|
||||||
//// }
|
|
||||||
//
|
|
||||||
//class PyThread_StateRestore
|
|
||||||
//{
|
|
||||||
//public:
|
|
||||||
//
|
|
||||||
// PyThread_StateRestore() {
|
|
||||||
// ptrPyThreadState = PyEval_SaveThread();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ~PyThread_StateRestore() {
|
|
||||||
// PyEval_RestoreThread( ptrPyThreadState );
|
|
||||||
// }
|
|
||||||
//};
|
|
||||||
//
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
@ -451,6 +451,10 @@
|
|||||||
RelativePath=".\diawrapper.h"
|
RelativePath=".\diawrapper.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\intbase.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\module.h"
|
RelativePath=".\module.h"
|
||||||
>
|
>
|
||||||
|
Loading…
Reference in New Issue
Block a user