[+] added : ptrMWord, ptrSignMWord for reading target's machine word ( 32 or 64 bits ) from memory

git-svn-id: https://pykd.svn.codeplex.com/svn@58965 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\kernelnet_cp 2010-12-20 16:46:21 +00:00
parent ca6c731376
commit c486a6c782
3 changed files with 39 additions and 1 deletions

View File

@ -131,6 +131,8 @@ BOOST_PYTHON_MODULE( pykd )
boost::python::def( "ptrQWord", &loadByPtr<unsigned __int64> ); boost::python::def( "ptrQWord", &loadByPtr<unsigned __int64> );
boost::python::def( "ptrSignQWord", &loadByPtr<__int64> ); boost::python::def( "ptrSignQWord", &loadByPtr<__int64> );
boost::python::def( "ptrPtr", &loadPtrByPtr ); boost::python::def( "ptrPtr", &loadPtrByPtr );
boost::python::def( "ptrMWord", &loadMWord );
boost::python::def( "ptrSignMWord", &loadSignMWord );
boost::python::def( "compareMemory", &compareMemory, compareMemoryOver( boost::python::args( "addr1", "addr2", "length", "phyAddr" ), "" ) ); boost::python::def( "compareMemory", &compareMemory, compareMemoryOver( boost::python::args( "addr1", "addr2", "length", "phyAddr" ), "" ) );
boost::python::def( "getCurrentStack", &getCurrentStack ); boost::python::def( "getCurrentStack", &getCurrentStack );
boost::python::def( "reloadModule", &reloadModule ); boost::python::def( "reloadModule", &reloadModule );

View File

@ -179,6 +179,36 @@ loadPtrByPtr( ULONG64 address )
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
ULONG64
loadMWord( ULONG64 address )
{
ULONG64 value = 0;
if ( is64bitSystem() )
loadMemory( address, &value, sizeof(ULONG64) );
else
loadMemory( address, &value, sizeof(ULONG) );
return value;
}
///////////////////////////////////////////////////////////////////////////////////
LONG64
loadSignMWord( ULONG64 address )
{
LONG64 value = 0;
if ( is64bitSystem() )
loadMemory( address, &value, sizeof(LONG64) );
else
loadMemory( address, &value, sizeof(LONG) );
return value;
}
///////////////////////////////////////////////////////////////////////////////////
boost::python::object boost::python::object
loadUnicodeStr( ULONG64 address ) loadUnicodeStr( ULONG64 address )
{ {

View File

@ -12,6 +12,12 @@ loadMemory( ULONG64 address, PVOID dest, ULONG length, BOOLEAN phyAddr = FALSE )
ULONG64 ULONG64
loadPtrByPtr( ULONG64 address ); loadPtrByPtr( ULONG64 address );
ULONG64
loadMWord( ULONG64 address );
LONG64
loadSignMWord( ULONG64 address );
template<typename T> template<typename T>
boost::python::object boost::python::object