示例#1
0
    def __str__(self):
        resultStr = Output.Y(u"\n原始信息:\n")
        resultStr = resultStr + Output.B(
            "{0:>9} : ".format('URL')) + self['meta']['url'] + "\n"
        resultStr = resultStr + Output.B("{0:>9} : ".format('Status')) + str(
            self['meta']['statusCode']) + "\n"
        resultStr = resultStr + Output.B(
            "{0:>9} : ".format('Title')) + self['meta']['title'] + "\n"
        resultStr = resultStr + Output.B("{0:>9} : ".format('Headers')) + "\n"
        for key, value in self['meta']['headers'].iteritems():
            resultStr = resultStr + Output.G(
                "{0:>20} : ".format(key)) + value + "\n"

        resultStr = resultStr + Output.Y(u"\n识别结果:\n")
        for key, value in self['apps'].iteritems():
            appsInfo = ""
            for line in value:
                if line[3]:
                    appsInfo = appsInfo + line[0] + " " + line[3] + " ; "
                else:
                    appsInfo = appsInfo + line[0] + " ; "
            resultStr = resultStr + Output.Y(
                "{0:>11} : ".format(key)) + appsInfo + "\n"

        return resultStr
示例#2
0
 def _getByteReal(self, data, i, j):
     if i * 16 + j >= len(data):
         return " "
     else:
         return Output.B(self._getAsciiVirualByte(data[i * 16 + j]))