#42 add output of a timestamp as a readable date for module print

This commit is contained in:
ussrhero 2019-04-29 22:05:21 +03:00
parent 56ca5c68e3
commit 850e986a03
2 changed files with 8 additions and 14 deletions

View File

@ -1,6 +1,8 @@
#include "stdafx.h" #include "stdafx.h"
#include "pymodule.h" #include "pymodule.h"
#include <iomanip>
#include <ctime>
namespace pykd { namespace pykd {
@ -48,20 +50,8 @@ std::wstring ModuleAdapter::print( kdlib::Module& module )
sstr << L"Image: " << module.getImageName() << std::endl; sstr << L"Image: " << module.getImageName() << std::endl;
sstr << L"Symbols: " << module.getSymFile() << std::endl; sstr << L"Symbols: " << module.getSymFile() << std::endl;
time_t timeStamp = module.getTimeDataStamp();
//if ( m_symSession ) sstr << L"Timestamp: " << timeStamp << " (" << std::put_time(std::gmtime(&timeStamp), L"%c") << L')' << std::endl;
//{
// sstr << "Symbols: " << m_symSession->getSymbolFileName() << std::endl;
// std::string buildDesc = m_symSession->getBuildDescription();
// if (!buildDesc.empty())
// sstr << "\t" << buildDesc << std::endl;
//}
//else
//{
// sstr << "Symbols: not found" << std::endl;
//}
sstr << L"Timestamp: " << module.getTimeDataStamp() << std::endl;
sstr << L"Check Sum: " << module.getCheckSum() << std::endl; sstr << L"Check Sum: " << module.getCheckSum() << std::endl;
return sstr.str(); return sstr.str();

View File

@ -145,3 +145,7 @@ class ModuleTest( unittest.TestCase ):
self.assertFalse("NotExist" in target.module) self.assertFalse("NotExist" in target.module)
self.assertRaises(Exception, lambda md : 2 in md, target.module) self.assertRaises(Exception, lambda md : 2 in md, target.module)
def testPrint(self):
modAsStr = str(target.module)
pass