mirror of
https://github.com/ivellioscolin/pykd.git
synced 2025-04-29 20:03:33 +08:00
[0.2.x] added : systemUptime routine ( return the number of seconds the target system has been running )
[0.2.x] added : getCurrentTime routine ( return the number of seconds since the beginning of 1970 at the target system ) git-svn-id: https://pykd.svn.codeplex.com/svn@82391 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
parent
11829511aa
commit
6602337447
@ -35,6 +35,8 @@ void eprintln( const std::wstring &str );
|
|||||||
ULONG ptrSize();
|
ULONG ptrSize();
|
||||||
bool is64bitSystem();
|
bool is64bitSystem();
|
||||||
ULONG getPageSize();
|
ULONG getPageSize();
|
||||||
|
ULONG getSystemUptime();
|
||||||
|
ULONG getCurrentTime();
|
||||||
|
|
||||||
//manage debug module
|
//manage debug module
|
||||||
ULONG64 findModuleBase( const std::string &moduleName );
|
ULONG64 findModuleBase( const std::string &moduleName );
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define PYKD_VERSION_MAJOR 0
|
#define PYKD_VERSION_MAJOR 0
|
||||||
#define PYKD_VERSION_MINOR 2
|
#define PYKD_VERSION_MINOR 2
|
||||||
#define PYKD_VERSION_SUBVERSION 0
|
#define PYKD_VERSION_SUBVERSION 0
|
||||||
#define PYKD_VERSION_BUILDNO 15
|
#define PYKD_VERSION_BUILDNO 16
|
||||||
|
|
||||||
|
|
||||||
#define __VER_STR2__(x) #x
|
#define __VER_STR2__(x) #x
|
||||||
|
@ -142,6 +142,10 @@ BOOST_PYTHON_MODULE( pykd )
|
|||||||
"Check if target system has 64 address space" );
|
"Check if target system has 64 address space" );
|
||||||
python::def( "pageSize", &getPageSize,
|
python::def( "pageSize", &getPageSize,
|
||||||
"Get the page size for the currently executing processor context" );
|
"Get the page size for the currently executing processor context" );
|
||||||
|
python::def( "systemUptime", &getSystemUptime,
|
||||||
|
"Return the number of seconds the computer has been running" );
|
||||||
|
python::def( "currentTime", &getCurrentTime,
|
||||||
|
"Return the number of seconds since the beginning of 1970" );
|
||||||
|
|
||||||
// Manage target memory access
|
// Manage target memory access
|
||||||
python::def( "addr64", &addr64,
|
python::def( "addr64", &addr64,
|
||||||
|
@ -721,6 +721,38 @@ ULONG getPageSize()
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG getSystemUptime()
|
||||||
|
{
|
||||||
|
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );
|
||||||
|
|
||||||
|
HRESULT hres;
|
||||||
|
ULONG time;
|
||||||
|
|
||||||
|
hres = g_dbgEng->control->GetCurrentSystemUpTime( &time );
|
||||||
|
if ( FAILED( hres ) )
|
||||||
|
throw DbgException( "IDebugControl2::GetCurrentSystemUpTime", hres );
|
||||||
|
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
ULONG getCurrentTime()
|
||||||
|
{
|
||||||
|
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );
|
||||||
|
|
||||||
|
HRESULT hres;
|
||||||
|
ULONG time;
|
||||||
|
|
||||||
|
hres = g_dbgEng->control->GetCurrentTimeDate( &time );
|
||||||
|
if ( FAILED( hres ) )
|
||||||
|
throw DbgException( "IDebugControl2::GetCurrentTimeDate", hres );
|
||||||
|
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
ULONG64 loadMSR( ULONG msr )
|
ULONG64 loadMSR( ULONG msr )
|
||||||
{
|
{
|
||||||
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );
|
PyThread_StateRestore pyThreadRestore( g_dbgEng->pystate );
|
||||||
|
Loading…
Reference in New Issue
Block a user