mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-21 12:53:23 +08:00
[+] added : isValid() routine; it validates virtual address
git-svn-id: https://pykd.svn.codeplex.com/svn@61122 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
f198999116
commit
c74a81d560
@ -98,6 +98,7 @@ BOOST_PYTHON_MODULE( pykd )
|
||||
boost::python::def( "dprintln", &DbgPrint::dprintln, dprintln( boost::python::args( "str", "dml" ), "" ) );
|
||||
boost::python::def( "loadDump", &dbgLoadDump );
|
||||
boost::python::def( "dbgCommand", &dbgCommand );
|
||||
boost::python::def( "isValid", &isOffsetValid );
|
||||
boost::python::def( "is64bitSystem", &is64bitSystem );
|
||||
boost::python::def( "isKernelDebugging", &isKernelDebugging );
|
||||
boost::python::def( "ptrSize", ptrSize );
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "dbgexcept.h"
|
||||
#include "dbgmem.h"
|
||||
#include "dbgsystem.h"
|
||||
#include "dbgcallback.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -526,3 +527,44 @@ loadLinkedList( ULONG64 address )
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool
|
||||
isOffsetValid( ULONG64 addr )
|
||||
{
|
||||
HRESULT hres;
|
||||
|
||||
try {
|
||||
|
||||
// íóæíî ïîäàâèòü âîçìîæíûé âûâîä â êîíñîëü îá îòñóòñòâóþùåé ñòðàíèöå ïàìÿòè
|
||||
OutputReader outputReader( dbgExt->client );
|
||||
|
||||
ULONG offsetInfo;
|
||||
|
||||
hres =
|
||||
dbgExt->dataSpaces4->GetOffsetInformation(
|
||||
DEBUG_DATA_SPACE_VIRTUAL,
|
||||
DEBUG_OFFSINFO_VIRTUAL_SOURCE,
|
||||
addr,
|
||||
&offsetInfo,
|
||||
sizeof( offsetInfo ),
|
||||
NULL );
|
||||
|
||||
if ( FAILED( hres ) )
|
||||
throw DbgException( "IDebugDataSpace4::GetOffsetInformation failed" );
|
||||
|
||||
return offsetInfo != DEBUG_VSOURCE_INVALID;
|
||||
|
||||
}
|
||||
catch( std::exception &e )
|
||||
{
|
||||
dbgExt->control->Output( DEBUG_OUTPUT_ERROR, "pykd error: %s\n", e.what() );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
dbgExt->control->Output( DEBUG_OUTPUT_ERROR, "pykd unexpected error\n" );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
@ -91,4 +91,7 @@ addr64( ULONG64 addr );
|
||||
boost::python::object
|
||||
loadLinkedList( ULONG64 address );
|
||||
|
||||
bool
|
||||
isOffsetValid( ULONG64 addr );
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
Loading…
Reference in New Issue
Block a user