mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-19 02:53:22 +08:00
[0.3.x] added : module.typedVar method with prototype argument
git-svn-id: https://pykd.svn.codeplex.com/svn@91108 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
683241ce2f
commit
381b06610b
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user