[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:
SND\kernelnet_cp 2013-07-20 11:29:11 +00:00 committed by Mikhail I. Izmestev
parent a07e0a848d
commit b7555ab69a
4 changed files with 35 additions and 19 deletions

View File

@ -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

View File

@ -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;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -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();
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -248,17 +248,16 @@ 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
// // CPU registers python::def( "reg", &getRegisterByName,
// python::def( "reg", &getRegByName, "Return a CPU regsiter value by the register's name" );
// "Return a CPU regsiter value by the register's name" ); python::def ( "rdmsr", &loadMSR,
// python::def( "reg", &getRegByIndex, "Return MSR value" );
// "Return a CPU regsiter value by the register's value" ); python::def( "wrmsr", &setMSR,
// python::def ( "rdmsr", &loadMSR, "Set MSR value" );
// "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,
// "Return type of physical processor: X86, ARM, IA64 or X64" ); // "Return type of physical processor: X86, ARM, IA64 or X64" );