mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[0.3.x] added : loadMSR
git-svn-id: https://pykd.svn.codeplex.com/svn@84383 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
a07e0a848d
commit
b7555ab69a
@ -17,6 +17,22 @@ public:
|
|||||||
static python::object getRegisterByIndex( kdlib::CPUContext& cpu, size_t index );
|
static python::object getRegisterByIndex( kdlib::CPUContext& cpu, size_t index );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline python::object getRegisterByName( const std::wstring &name )
|
||||||
|
{
|
||||||
|
return CPUContextAdaptor::getRegisterByName( *kdlib::loadCPUCurrentContext().get(), name );
|
||||||
|
}
|
||||||
|
|
||||||
|
inline unsigned long long loadMSR( size_t msrIndex )
|
||||||
|
{
|
||||||
|
return kdlib::loadCPUCurrentContext()->loadMSR( msrIndex );
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void setMSR( size_t msrIndex, unsigned long long value )
|
||||||
|
{
|
||||||
|
return kdlib::loadCPUCurrentContext()->setMSR( msrIndex, value );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
} //end namespace pykd
|
} //end namespace pykd
|
||||||
|
@ -155,19 +155,20 @@ python::tuple findSymbolAndDisp( ULONG64 offset )
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
python::dict getSystemVersion()
|
python::object getSystemVersion()
|
||||||
{
|
{
|
||||||
|
|
||||||
kdlib::SystemInfo sysInfo;
|
kdlib::SystemInfo sysInfo;
|
||||||
kdlib::getSystemInfo( sysInfo );
|
kdlib::getSystemInfo( sysInfo );
|
||||||
|
|
||||||
python::dict dct;
|
python::object obj;
|
||||||
dct["majorVersion"] = sysInfo.majorVersion;
|
|
||||||
dct["minorVersion"] = sysInfo.minorVersion;
|
|
||||||
dct["buildNumber"] = sysInfo.buildNumber;
|
|
||||||
dct["buildDescription"] = sysInfo.buildDescription;
|
|
||||||
|
|
||||||
return dct;
|
obj.attr("majorVersion") = sysInfo.majorVersion;
|
||||||
|
obj.attr("minorVersion") = sysInfo.minorVersion;
|
||||||
|
obj.attr("buildNumber") = sysInfo.buildNumber;
|
||||||
|
obj.attr("buildDescription") = sysInfo.buildDescription;
|
||||||
|
|
||||||
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -25,7 +25,7 @@ python::tuple getSourceLine( kdlib::MEMOFFSET_64 offset = 0 );
|
|||||||
|
|
||||||
python::tuple findSymbolAndDisp( ULONG64 offset );
|
python::tuple findSymbolAndDisp( ULONG64 offset );
|
||||||
|
|
||||||
python::dict getSystemVersion();
|
python::object getSystemVersion();
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -248,16 +248,15 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
"Return instance of the typedVar class. It's value are loaded from the target memory."
|
"Return instance of the typedVar class. It's value are loaded from the target memory."
|
||||||
"The start address is calculated by the same method as the standard macro CONTAINING_RECORD does" );
|
"The start address is calculated by the same method as the standard macro CONTAINING_RECORD does" );
|
||||||
|
|
||||||
|
// CPU registers
|
||||||
|
python::def( "reg", &getRegisterByName,
|
||||||
|
"Return a CPU regsiter value by the register's name" );
|
||||||
|
python::def ( "rdmsr", &loadMSR,
|
||||||
|
"Return MSR value" );
|
||||||
|
python::def( "wrmsr", &setMSR,
|
||||||
|
"Set MSR value" );
|
||||||
|
|
||||||
|
|
||||||
// // CPU registers
|
|
||||||
// python::def( "reg", &getRegByName,
|
|
||||||
// "Return a CPU regsiter value by the register's name" );
|
|
||||||
// python::def( "reg", &getRegByIndex,
|
|
||||||
// "Return a CPU regsiter value by the register's value" );
|
|
||||||
// python::def ( "rdmsr", &loadMSR,
|
|
||||||
// "Return MSR value" );
|
|
||||||
// python::def( "wrmsr", &setMSR,
|
|
||||||
// "Set MSR value" );
|
|
||||||
// python::def( "getProcessorMode", &getProcessorMode,
|
// python::def( "getProcessorMode", &getProcessorMode,
|
||||||
// "Return current processor mode as string: X86, ARM, IA64 or X64" );
|
// "Return current processor mode as string: X86, ARM, IA64 or X64" );
|
||||||
// python::def( "getProcessorType", &getProcessorType,
|
// python::def( "getProcessorType", &getProcessorType,
|
||||||
|
Loading…
Reference in New Issue
Block a user