added : getHostProcessPath ( return image path of the process running python interpreter with a pykd )

This commit is contained in:
ussrhero 2019-07-29 23:30:50 +03:00
parent dbbc41c16c
commit daaa04a5a4
3 changed files with 17 additions and 1 deletions

View File

@ -163,6 +163,19 @@ python::list getLocalProcesses()
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
std::wstring getHostProcessPath()
{
AutoRestorePyState pystate;
std::vector<WCHAR> fileNameBuffer(0x1000);
DWORD fileNameSize = GetModuleFileNameW(NULL, &fileNameBuffer.front(), fileNameBuffer.size() );
return std::wstring(&fileNameBuffer.front(), fileNameSize);
}
///////////////////////////////////////////////////////////////////////////////
python::tuple getBugCheckData() python::tuple getBugCheckData()
{ {
kdlib::SystemCrashInfo crashInfo = {}; kdlib::SystemCrashInfo crashInfo = {};

View File

@ -293,6 +293,7 @@ inline void setImplicitProcess(kdlib::MEMOFFSET_64 offset)
AutoRestorePyState pystate; AutoRestorePyState pystate;
kdlib::setImplicitProcess(offset); kdlib::setImplicitProcess(offset);
} }
inline kdlib::MEMOFFSET_64 getImplicitProcessOffset() inline kdlib::MEMOFFSET_64 getImplicitProcessOffset()
{ {
AutoRestorePyState pystate; AutoRestorePyState pystate;
@ -304,6 +305,8 @@ python::list getProcessThreads();
python::list getTargetProcesses(); python::list getTargetProcesses();
python::list getLocalProcesses(); python::list getLocalProcesses();
std::wstring getHostProcessPath();
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
inline inline

View File

@ -2,7 +2,7 @@
#define PYKD_VERSION_MAJOR 0 #define PYKD_VERSION_MAJOR 0
#define PYKD_VERSION_MINOR 3 #define PYKD_VERSION_MINOR 3
#define PYKD_VERSION_SUBVERSION 4 #define PYKD_VERSION_SUBVERSION 4
#define PYKD_VERSION_BUILDNO 7 #define PYKD_VERSION_BUILDNO 8
#define __VER_STR2__(x) #x #define __VER_STR2__(x) #x
#define __VER_STR1__(x) __VER_STR2__(x) #define __VER_STR1__(x) __VER_STR2__(x)