From a58f7d18a0aaaeaf2419d2664aa5aeecaca11630 Mon Sep 17 00:00:00 2001 From: "SND\\EreTIk_cp" Date: Mon, 27 Jan 2014 09:03:31 +0000 Subject: [PATCH] [0.3.x] added : module flags "unloaded" and "user mode" git-svn-id: https://pykd.svn.codeplex.com/svn@87161 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/pymod.cpp | 8 ++++---- pykd/pymodule.h | 12 ++++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index 198c117..0e9c640 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -485,10 +485,10 @@ BOOST_PYTHON_MODULE( pykd ) "Return a image file checksum: IMAGE_OPTIONAL_HEADER.CheckSum" ) .def("timestamp", ModuleAdapter::getTimeDataStamp, "Return a low 32 bits of the time stamp of the image: IMAGE_FILE_HEADER.TimeDateStamp" ) - //.def("unloaded", &Module::isUnloaded, - // "Returns a flag that the module was unloaded") - //.def("um", &Module::isUserMode, - // "Returns a flag that the module is a user-mode module") + .def("unloaded", ModuleAdapter::isUnloaded, + "Returns a flag that the module was unloaded" ) + .def("um", ModuleAdapter::isUserMode, + "Returns a flag that the module is a user-mode module" ) //.def("queryVersion", &Module::queryVersion, // "Return string from the module's version resources" ) //.def("getVersion", &Module::getVersion, diff --git a/pykd/pymodule.h b/pykd/pymodule.h index a8766dc..a651f26 100644 --- a/pykd/pymodule.h +++ b/pykd/pymodule.h @@ -128,6 +128,18 @@ struct ModuleAdapter : public kdlib::Module return module.getTimeDataStamp(); } + static bool isUnloaded( kdlib::Module& module ) + { + AutoRestorePyState pystate; + return module.isUnloaded(); + } + + static bool isUserMode( kdlib::Module& module ) + { + AutoRestorePyState pystate; + return module.isUserMode(); + } + static std::wstring print( kdlib::Module& module ); static python::list enumSymbols( kdlib::Module& module, const std::wstring &mask = L"*" );