[0.3.x] added : setProcessorMode, switchProcessorMode

git-svn-id: https://pykd.svn.codeplex.com/svn@84520 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2013-08-01 12:35:43 +00:00 committed by Mikhail I. Izmestev
parent c73351207a
commit b94a9cdaae
2 changed files with 16 additions and 3 deletions

View File

@ -47,6 +47,14 @@ inline kdlib::CPUType getProcessorType() {
return kdlib::loadCPUCurrentContext()->getCPUType(); return kdlib::loadCPUCurrentContext()->getCPUType();
} }
inline void setProcessorMode( kdlib::CPUType mode ) {
kdlib::loadCPUCurrentContext()->setCPUMode(mode);
}
inline void switchProcessorMode() {
kdlib::loadCPUCurrentContext()->switchCPUMode();
}
inline python::list getCurrentStack() { inline python::list getCurrentStack() {
return CPUContextAdaptor::getStack( *kdlib::loadCPUCurrentContext() ); return CPUContextAdaptor::getStack( *kdlib::loadCPUCurrentContext() );
} }

View File

@ -259,8 +259,10 @@ BOOST_PYTHON_MODULE( pykd )
"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" );
// python::def( "setProcessorMode", &setProcessorMode, python::def( "setProcessorMode", &setProcessorMode,
// "Set current processor mode by string (X86, ARM, IA64 or X64)" ); "Set current processor mode (X86, ARM, IA64 or X64)" );
python::def( "switchProcessorMode", &switchProcessorMode,
"Switch processor mode ( X86 <-> X64 )" );
// stack and local variables // stack and local variables
python::def( "getStack", &getCurrentStack, python::def( "getStack", &getCurrentStack,
@ -560,6 +562,8 @@ BOOST_PYTHON_MODULE( pykd )
.add_property("fp", &kdlib::CPUContext::getSP ) .add_property("fp", &kdlib::CPUContext::getSP )
.def("getCPUType", &kdlib::CPUContext::getCPUType ) .def("getCPUType", &kdlib::CPUContext::getCPUType )
.def("getCPUMode", &kdlib::CPUContext::getCPUMode ) .def("getCPUMode", &kdlib::CPUContext::getCPUMode )
.def("setCPUMode", &kdlib::CPUContext::setCPUMode )
.def("switchCPUMode", &kdlib::CPUContext::switchCPUMode )
.def("getStack", &CPUContextAdaptor::getStack ) .def("getStack", &CPUContextAdaptor::getStack )
.def("__getattr__", &CPUContextAdaptor::getRegisterByName ) .def("__getattr__", &CPUContextAdaptor::getRegisterByName )
.def("__getitem__", &CPUContextAdaptor::getRegisterByIndex ); .def("__getitem__", &CPUContextAdaptor::getRegisterByIndex );
@ -671,7 +675,8 @@ BOOST_PYTHON_MODULE( pykd )
.def( "reset", &kdlib::Disasm::reset, "Reset current offset to begin" ) .def( "reset", &kdlib::Disasm::reset, "Reset current offset to begin" )
.def( "findOffset", &kdlib::Disasm::getNearInstruction, "Return the location of a processor instruction relative to a given location" ) .def( "findOffset", &kdlib::Disasm::getNearInstruction, "Return the location of a processor instruction relative to a given location" )
.def( "jump", &kdlib::Disasm::jump, "Change the current instruction" ) .def( "jump", &kdlib::Disasm::jump, "Change the current instruction" )
.def( "jumprel", &kdlib::Disasm::jumprel, "Change the current instruction" ); .def( "jumprel", &kdlib::Disasm::jumprel, "Change the current instruction" )
.def( "__str__", &kdlib::Disasm::instruction );
python::enum_<kdlib::DebugCallbackResult>("eventResult", "Return value of event handler") python::enum_<kdlib::DebugCallbackResult>("eventResult", "Return value of event handler")