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]
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]
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]
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]
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]
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]
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]