diff --git a/pykd/module.cpp b/pykd/module.cpp index 5d9828d..fa995a8 100644 --- a/pykd/module.cpp +++ b/pykd/module.cpp @@ -37,7 +37,7 @@ Module::Module( IDebugClient4 *client, SynSymbolsPtr synSymbols, const std::stri m_size = moduleParam.Size; m_timeDataStamp = moduleParam.TimeDateStamp; - m_checkSumm = moduleParam.Checksum; + m_checkSum = moduleParam.Checksum; char imageName[0x100]; @@ -107,7 +107,7 @@ Module::Module( IDebugClient4 *client, SynSymbolsPtr synSymbols, ULONG64 offset m_size = moduleParam.Size; m_timeDataStamp = moduleParam.TimeDateStamp; - m_checkSumm = moduleParam.Checksum; + m_checkSum = moduleParam.Checksum; } /////////////////////////////////////////////////////////////////////////////////// @@ -284,7 +284,7 @@ ULONG Module::getRvaByName(const std::string &symName) if ( SUCCEEDED(hres) ) return (ULONG)(offset - m_base); - return (ULONG)m_synSymbols->getRvaByName(m_timeDataStamp, m_checkSumm, symName); + return (ULONG)m_synSymbols->getRvaByName(m_timeDataStamp, m_checkSum, symName); //try { // pyDia::SymbolPtr sym = getDia()->getChildByName( symName ); @@ -380,5 +380,21 @@ python::list Module::getTypedVarArrayByType( ULONG64 address, const TypeInfoPtr /////////////////////////////////////////////////////////////////////////////////// +std::string Module::print() +{ + std::stringstream sstr; + + sstr << "Module: " << m_name << std::endl; + sstr << "Start: " << std::hex << m_base << " End: " << getEnd() << " Size: " << m_size << std::endl; + sstr << "Image: " << m_imageName << std::endl; + sstr << "Pdb: " << getPdbName() << std::endl; + sstr << "Timestamp: " << m_timeDataStamp << std::endl; + sstr << "Check Sum: " << m_checkSum << std::endl; + + return sstr.str(); +} + +/////////////////////////////////////////////////////////////////////////////////// + }; // end of namespace pykd diff --git a/pykd/module.h b/pykd/module.h index 159d36d..7fc6573 100644 --- a/pykd/module.h +++ b/pykd/module.h @@ -99,14 +99,16 @@ public: return m_dia; } - ULONG getCheckSumm() const { - return m_checkSumm; + ULONG getCheckSum() const { + return m_checkSum; } ULONG getTimeDataStamp() const { return m_timeDataStamp; } + std::string print(); + private: void @@ -128,7 +130,7 @@ private: pyDia::GlobalScopePtr m_dia; ULONG m_timeDataStamp; - ULONG m_checkSumm; + ULONG m_checkSum; SynSymbolsPtr m_synSymbols; }; diff --git a/pykd/pymod.cpp b/pykd/pymod.cpp index 92813ac..11f038f 100644 --- a/pykd/pymod.cpp +++ b/pykd/pymod.cpp @@ -603,12 +603,13 @@ BOOST_PYTHON_MODULE( pykd ) .def("containingRecord", &Module::containingRecordByType, "Return instance of the typedVar class. It's value are loaded from the target memory." "The start address is calculated by the same method as the standard macro CONTAINING_RECORD does" ) - .def("checksum",&Module::getCheckSumm, + .def("checksum",&Module::getCheckSum, "Return a image file checksum: IMAGE_OPTIONAL_HEADER.CheckSum" ) .def("timestamp",&Module::getTimeDataStamp, "Return a low 32 bits of the time stamp of the image: IMAGE_FILE_HEADER.TimeDateStamp" ) .def("__getattr__", &Module::getSymbol, - "Return address of the symbol" ); + "Return address of the symbol" ) + .def( "__str__", &Module::print ); python::class_<DbgOut>( "dout", "dout", python::no_init ) .def( "write", &DbgOut::write ); diff --git a/snippets/pytowiki.py b/snippets/pytowiki.py index 5c77c29..9b97c7a 100644 --- a/snippets/pytowiki.py +++ b/snippets/pytowiki.py @@ -66,13 +66,15 @@ def buildDoc( ioStream, formatter, apiInfo ): for func in apiInfo.funcs: ioStream.write( formatter.anchor( func.__name__ ) ) ioStream.write( formatter.header3( func.__name__ ) ) - ioStream.write( formatter.escapeMarkup( func.__doc__) + formatter.endl() ) + if func.__doc__ != None: + ioStream.write( formatter.escapeMarkup( func.__doc__) + formatter.endl() ) for cls in apiInfo.classes: ioStream.write( formatter.anchor( cls.__name__ ) ) ioStream.write( formatter.header3( cls.__name__ ) ) - ioStream.write( formatter.escapeMarkup( cls.__doc__) + formatter.endl() ) + if cls.__doc__ != None: + ioStream.write( formatter.escapeMarkup( cls.__doc__) + formatter.endl() ) for m in cls.methods: if m.__doc__ != None: