code: def _updateDirectoriesData(self, peStr):
          
          dataDirs = self.ntHeaders.optionalHeader.dataDirectory
          wr = utils.WriteData(data)
          
          for dir in dataDirs:
              dataToWrite = str(dir.info)
              if len(dataToWrite) != dir.size.value and self._verbose:
                  print excep.DataLengthException("Warning: current size of %s directory does not match with dataToWrite length %d." % (dir.size.value, len(dataToWrite)))
              wr.setOffset(self.getOffsetFromRva(dir.rva.value))
              wr.write(dataToWrite)
          return str(wr)
docs: Updates the data in every L{Directory} object.
          
          @type peStr: str
          @param peStr: C{str} representation of the L{PE} object.
          
          @rtype: str
          @return: A C{str} representation of the L{PE} object.