diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index 78caa01..a3f9fc8 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -666,6 +666,8 @@ BOOST_PYTHON_MODULE( pykd ) "Returns a flag that the module is a user-mode module" ) .def("queryVersion", ModuleAdapter::getVersionInfo, "Return string from the module's version resources" ) + .def("getVersion", ModuleAdapter::getVersion, + "Return tuple of the module's file version") .def("getFixedFileInfo", ModuleAdapter::getFixedFileInfo, "Return FixedFileInfo" ) .def("__getattr__", ModuleAdapter::getSymbolVa, diff --git a/pykd/pymodule.h b/pykd/pymodule.h index ad54419..86537cb 100644 --- a/pykd/pymodule.h +++ b/pykd/pymodule.h @@ -147,6 +147,14 @@ struct ModuleAdapter : public kdlib::Module return module.getVersionInfo(value); } + static python::tuple getVersion(kdlib::Module& module) + { + AutoRestorePyState pystate; + unsigned long a1, a2, a3, a4; + module.getFileVersion(a1, a2, a3, a4); + return python::make_tuple(a1, a2, a3, a4); + } + static FixedFileInfoPtr getFixedFileInfo( kdlib::Module& module ); static std::wstring print( kdlib::Module& module );