示例#1
0
文件: Searcher.py 项目: lindi2/netzob
 def getSearchedDataForDecimal(self, value):
     if not value.isdigit():
         return []
     # Creation of a SearchTask
     task = SearchTask(value, value, Format.DECIMAL)
     task.registerVariation(TypeConvertor.decimalToNetzobRaw(value), "Decimal representation of '{0}'".format(TypeConvertor.decimalToNetzobRaw(value)))
     task.registerVariation(TypeConvertor.decimalToNetzobRaw(value[::-1]), "Inverted decimal representation of '{0}'".format(TypeConvertor.decimalToNetzobRaw(value[::-1])))
     return [task]
示例#2
0
文件: Searcher.py 项目: lindi2/netzob
    def getSearchedDataForHexadecimal(self, value, extraInfo=None):
        typeIdentifier = TypeIdentifier()
        if not typeIdentifier.isHexString(value):
            return []
        # Creation of a SearchTask
        task = SearchTask(value, value, Format.HEX)
        task.registerVariation(value, "Hex repr of '{0}'({1}))".format(value, extraInfo))
#        task.registerVariation(value[::-1], "Inverted representation of '{0}'".format(value[::-1]))
        return [task]
示例#3
0
 def getSearchedDataForHexadecimal(self, value, extraInfo=None):
     typeIdentifier = TypeIdentifier()
     if not typeIdentifier.isHexString(value):
         return []
     # Creation of a SearchTask
     task = SearchTask(value, value, Format.HEX)
     task.registerVariation(
         value, "Hex repr of '{0}'({1}))".format(value, extraInfo))
     #        task.registerVariation(value[::-1], "Inverted representation of '{0}'".format(value[::-1]))
     print task
     return [task]
示例#4
0
 def getSearchedDataForDecimal(self, value):
     if not value.isdigit():
         return []
     # Creation of a SearchTask
     task = SearchTask(value, value, Format.DECIMAL)
     task.registerVariation(
         TypeConvertor.decimalToNetzobRaw(value),
         "Decimal representation of '{0}'".format(
             TypeConvertor.decimalToNetzobRaw(value)))
     task.registerVariation(
         TypeConvertor.decimalToNetzobRaw(value[::-1]),
         "Inverted decimal representation of '{0}'".format(
             TypeConvertor.decimalToNetzobRaw(value[::-1])))
     return [task]
示例#5
0
 def getSearchedDataForString(self, value):
     # Creation of a SearchTask
     task = SearchTask(value, value, Format.STRING)
     task.registerVariation(TypeConvertor.stringToNetzobRaw(value), "String representation of '%s'" % value)
     task.registerVariation(TypeConvertor.stringToNetzobRaw(value[::-1]), "Inverted string representation of '%s'" % value[::-1])
     task.registerVariation(TypeConvertor.stringToNetzobRaw(value.decode('utf-8')), "String representation of '%s' encoded in UTF-8" % value)
     return [task]
示例#6
0
 def getSearchedDataForString(self, value):
     # Creation of a SearchTask
     task = SearchTask(value, value, Format.STRING)
     task.registerVariation(TypeConvertor.stringToNetzobRaw(value),
                            "String representation of '%s'" % value)
     task.registerVariation(
         TypeConvertor.stringToNetzobRaw(value[::-1]),
         "Inverted string representation of '%s'" % value[::-1])
     task.registerVariation(
         TypeConvertor.stringToNetzobRaw(value.decode('utf-8')),
         "String representation of '%s' encoded in UTF-8" % value)
     return [task]
示例#7
0
文件: Searcher.py 项目: KurSh/netzob
 def getSearchedDataForHexadecimal(self, value):
     # Creation of a SearchTask
     task = SearchTask(value, value, Format.HEX)
     task.registerVariation(value, "Hexadecimal representation of '{0}'".format(value))
     task.registerVariation(value[::-1], "Inverted representation of '{0}'".format(value[::-1]))
     return [task]