mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-20 03:23:23 +08:00
[+] added: loadTypedVarList routine
[!] fixed: typedVar git-svn-id: https://pykd.svn.codeplex.com/svn@53270 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
ea92b6e472
commit
4f95f0e722
@ -42,6 +42,7 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
boost::python::def( "is64bitSystem", is64bitSystem );
|
boost::python::def( "is64bitSystem", is64bitSystem );
|
||||||
boost::python::def( "reg", &loadRegister );
|
boost::python::def( "reg", &loadRegister );
|
||||||
boost::python::def( "typedVar", &loadTypedVar );
|
boost::python::def( "typedVar", &loadTypedVar );
|
||||||
|
boost::python::def( "typedVarList", &loadTypedVarList );
|
||||||
boost::python::def( "containingRecord", &containingRecord );
|
boost::python::def( "containingRecord", &containingRecord );
|
||||||
boost::python::def( "loadModule", &loadModule );
|
boost::python::def( "loadModule", &loadModule );
|
||||||
boost::python::def( "findSymbol", &findSymbolForAddress );
|
boost::python::def( "findSymbol", &findSymbolForAddress );
|
||||||
|
@ -137,27 +137,20 @@ loadPtrArray( ULONG64 address, ULONG number )
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
boost::python::object
|
ULONG64
|
||||||
loadPtrByPtr( ULONG64 address )
|
loadPtrByPtr( ULONG64 address )
|
||||||
{
|
{
|
||||||
|
ULONG64 value = 0;
|
||||||
|
|
||||||
if ( is64bitSystem() )
|
if ( is64bitSystem() )
|
||||||
{
|
loadMemory( address, &value, sizeof(ULONG64) );
|
||||||
ULONG64 value;
|
|
||||||
|
|
||||||
if ( loadMemory( address, &value, sizeof(ULONG64) ) )
|
|
||||||
return boost::python::object( value );
|
|
||||||
|
|
||||||
return boost::python::object();
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ULONG value;
|
|
||||||
|
|
||||||
if ( loadMemory( address, &value, sizeof(ULONG) ) )
|
if ( loadMemory( address, &value, sizeof(ULONG) ) )
|
||||||
return boost::python::object( addr64( value ) );
|
value = addr64( value );
|
||||||
|
|
||||||
return boost::python::object();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -9,6 +9,10 @@
|
|||||||
bool
|
bool
|
||||||
loadMemory( ULONG64 address, PVOID dest, ULONG length );
|
loadMemory( ULONG64 address, PVOID dest, ULONG length );
|
||||||
|
|
||||||
|
ULONG64
|
||||||
|
loadPtrByPtr( ULONG64 address );
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
boost::python::object
|
boost::python::object
|
||||||
loadArray( ULONG64 address, ULONG number )
|
loadArray( ULONG64 address, ULONG number )
|
||||||
@ -46,9 +50,6 @@ loadByPtr( ULONG64 address )
|
|||||||
return boost::python::object();
|
return boost::python::object();
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::python::object
|
|
||||||
loadPtrByPtr( ULONG64 address );
|
|
||||||
|
|
||||||
boost::python::object
|
boost::python::object
|
||||||
loadPtrArray( ULONG64 address, ULONG number );
|
loadPtrArray( ULONG64 address, ULONG number );
|
||||||
|
|
||||||
|
@ -47,9 +47,13 @@ basicTypeNames[] = {
|
|||||||
"short",
|
"short",
|
||||||
"unsigned long",
|
"unsigned long",
|
||||||
"long",
|
"long",
|
||||||
|
"int",
|
||||||
|
"unsigned int",
|
||||||
"<function>",
|
"<function>",
|
||||||
"void",
|
"void",
|
||||||
"double"
|
"double",
|
||||||
|
"int64",
|
||||||
|
"unsigned int64"
|
||||||
};
|
};
|
||||||
|
|
||||||
basicTypeLoader basicTypeLoaders[] = {
|
basicTypeLoader basicTypeLoaders[] = {
|
||||||
@ -59,9 +63,14 @@ basicTypeLoader basicTypeLoaders[] = {
|
|||||||
valueLoader<short>,
|
valueLoader<short>,
|
||||||
valueLoader<unsigned long>,
|
valueLoader<unsigned long>,
|
||||||
valueLoader<long>,
|
valueLoader<long>,
|
||||||
|
valueLoader<int>,
|
||||||
|
valueLoader<unsigned int>,
|
||||||
valueLoader<void*>,
|
valueLoader<void*>,
|
||||||
voidLoader,
|
voidLoader,
|
||||||
valueLoader<double> };
|
valueLoader<double>,
|
||||||
|
valueLoader<__int64>,
|
||||||
|
valueLoader<unsigned __int64>
|
||||||
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
@ -104,6 +113,10 @@ loadTypedVar( const std::string &moduleName, const std::string &typeName, ULONG6
|
|||||||
char fieldTypeName[100];
|
char fieldTypeName[100];
|
||||||
hres = dbgExt->symbols->GetTypeName( moduleBase, fieldTypeId, fieldTypeName, sizeof(fieldTypeName), NULL );
|
hres = dbgExt->symbols->GetTypeName( moduleBase, fieldTypeId, fieldTypeName, sizeof(fieldTypeName), NULL );
|
||||||
|
|
||||||
|
std::string fieldTypeNameStr( fieldTypeName );
|
||||||
|
if ( fieldTypeNameStr == "__unnamed" || fieldTypeNameStr == "<unnamed-tag>" )
|
||||||
|
continue;
|
||||||
|
|
||||||
ULONG fieldSize;
|
ULONG fieldSize;
|
||||||
hres = dbgExt->symbols->GetTypeSize( moduleBase, fieldTypeId, &fieldSize );
|
hres = dbgExt->symbols->GetTypeSize( moduleBase, fieldTypeId, &fieldSize );
|
||||||
|
|
||||||
@ -183,6 +196,23 @@ containingRecord( ULONG64 address, const std::string &moduleName, const std::str
|
|||||||
return boost::python::str( "VAR_ERR" );
|
return boost::python::str( "VAR_ERR" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
boost::python::object
|
||||||
|
loadTypedVarList( ULONG64 address, const std::string &moduleName, const std::string &typeName, const std::string &listEntryName )
|
||||||
|
{
|
||||||
|
ULONG64 entryAddress = 0;
|
||||||
|
|
||||||
|
boost::python::list objList;
|
||||||
|
|
||||||
|
for( entryAddress = loadPtrByPtr( address ); entryAddress != address; entryAddress = loadPtrByPtr( entryAddress ) )
|
||||||
|
{
|
||||||
|
objList.append( containingRecord( entryAddress, moduleName, typeName, listEntryName ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return objList;
|
||||||
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -34,6 +34,9 @@ private:
|
|||||||
boost::python::object
|
boost::python::object
|
||||||
loadTypedVar( const std::string &moduleName, const std::string &typeName, ULONG64 address );
|
loadTypedVar( const std::string &moduleName, const std::string &typeName, ULONG64 address );
|
||||||
|
|
||||||
|
boost::python::object
|
||||||
|
loadTypedVarList( ULONG64 address, const std::string &moduleName, const std::string &typeName, const std::string &listEntryName );
|
||||||
|
|
||||||
boost::python::object
|
boost::python::object
|
||||||
containingRecord( ULONG64 address, const std::string &moduleName, const std::string &typeName, const std::string &fieldName );
|
containingRecord( ULONG64 address, const std::string &moduleName, const std::string &typeName, const std::string &fieldName );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user