diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index 712541a..ef19d06 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -795,6 +795,8 @@ BOOST_PYTHON_MODULE( pykd ) "Return a typedVar class instance") .def("typedVar", ModuleAdapter::getTypedVarByTypeName, "Return a typedVar class instance") + .def("typedVar", ModuleAdapter::getTypedVarWithPrototype, + "Return a typedVar class instance") .def("typedVarList", ModuleAdapter::getTypedVarListByTypeName, "Return a list of the typedVar class instances. Each item represents an item of the linked list in the target memory") .def("typedVarArray", ModuleAdapter::getTypedVarArrayByTypeName, diff --git a/pykd/pymodule.h b/pykd/pymodule.h index ab5bc61..5c938d6 100644 --- a/pykd/pymodule.h +++ b/pykd/pymodule.h @@ -131,6 +131,12 @@ struct ModuleAdapter : public kdlib::Module return module.getTypedVarByTypeName(typeName, offset); } + static kdlib::TypedVarPtr getTypedVarWithPrototype(kdlib::Module& module, const std::wstring &symbolName, const std::wstring &prototype) + { + AutoRestorePyState pystate; + return module.getTypedVarWithPrototype(symbolName, prototype); + } + static kdlib::TypedVarPtr containingRecord(kdlib::Module& module, kdlib::MEMOFFSET_64 offset, const std::wstring &typeName, const std::wstring &fieldName ) { AutoRestorePyState pystate; diff --git a/test/scripts/typedvar.py b/test/scripts/typedvar.py index c7bb187..3373295 100644 --- a/test/scripts/typedvar.py +++ b/test/scripts/typedvar.py @@ -387,6 +387,8 @@ class TypedVarTest( unittest.TestCase ): functype.append("arg1", pykd.baseTypes.Int1B) functype.append("arg2", pykd.baseTypes.Long) self.assertEqual( 500 / 25, pykd.callFunctionByAddr(functype, target.module.offset("StdcallFuncRet"), 25, 500 ) ) + + self.assertTrue( target.module.typedVar("OverloadedFunc", "Bool(__cdecl)(Int4B,Int4B)").call(100,299) ) def testCallFunctionWithTypedVar(self): funcptr = target.module.typedVar("StdcallFuncRet");