mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 04:13:22 +08:00
[+] write MSR value
git-svn-id: https://pykd.svn.codeplex.com/svn@68044 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
76aa604568
commit
9c9164daef
@ -103,6 +103,8 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
"Return CPU's register value" );
|
"Return CPU's register value" );
|
||||||
boost::python::def( "rdmsr", &loadMSR,
|
boost::python::def( "rdmsr", &loadMSR,
|
||||||
"Return MSR value" );
|
"Return MSR value" );
|
||||||
|
boost::python::def( "wrmsr", &setMSR,
|
||||||
|
"Set MSR value" );
|
||||||
boost::python::def( "typedVarList", &loadTypedVarList,
|
boost::python::def( "typedVarList", &loadTypedVarList,
|
||||||
"Return list of typedVarClass instances. Each item represents one item of the linked list in the target memory" );
|
"Return list of typedVarClass instances. Each item represents one item of the linked list in the target memory" );
|
||||||
boost::python::def( "typedVarArray", &loadTypedVarArray,
|
boost::python::def( "typedVarArray", &loadTypedVarArray,
|
||||||
|
@ -11,8 +11,8 @@ using namespace std;
|
|||||||
boost::python::object
|
boost::python::object
|
||||||
loadRegister( const std::string ®isterName )
|
loadRegister( const std::string ®isterName )
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
ULONG registerIndex = 0;
|
ULONG registerIndex = 0;
|
||||||
|
|
||||||
hres = dbgExt->registers->GetIndexByName( registerName.c_str(), ®isterIndex );
|
hres = dbgExt->registers->GetIndexByName( registerName.c_str(), ®isterIndex );
|
||||||
@ -52,13 +52,24 @@ ULONG64
|
|||||||
loadMSR( ULONG msr )
|
loadMSR( ULONG msr )
|
||||||
{
|
{
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
ULONG64 value;
|
ULONG64 value;
|
||||||
|
|
||||||
hres = dbgExt->dataSpaces->ReadMsr( msr, &value );
|
hres = dbgExt->dataSpaces->ReadMsr( msr, &value );
|
||||||
if ( FAILED( hres ) )
|
if ( FAILED( hres ) )
|
||||||
throw DbgException( "IDebugDataSpaces::ReadMsr failed" );
|
throw DbgException( "IDebugDataSpaces::ReadMsr failed" );
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void setMSR( ULONG msr, ULONG64 value)
|
||||||
|
{
|
||||||
|
HRESULT hres;
|
||||||
|
|
||||||
|
hres = dbgExt->dataSpaces->WriteMsr(msr, value);
|
||||||
|
if ( FAILED( hres ) )
|
||||||
|
throw DbgException( "IDebugDataSpaces::WriteMsr failed" );
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -10,4 +10,6 @@ loadRegister( const std::string ®isterName );
|
|||||||
ULONG64
|
ULONG64
|
||||||
loadMSR( ULONG msr );
|
loadMSR( ULONG msr );
|
||||||
|
|
||||||
|
void setMSR( ULONG msr, ULONG64 val);
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////////
|
Loading…
Reference in New Issue
Block a user