From 9512318443a518621ee8c1b4c8191bd668f21199 Mon Sep 17 00:00:00 2001 From: "SND\\kernelnet_cp" Date: Mon, 19 Oct 2015 07:24:08 +0000 Subject: [PATCH] [0.3.x] fixed : issue # 13745 ( the method module.getVersion is missed ) git-svn-id: https://pykd.svn.codeplex.com/svn@90850 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/pymod.cpp | 2 ++ pykd/pymodule.h | 8 ++++++++ 2 files changed, 10 insertions(+) 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 );