当前位置: 首页>>代码示例>>Python>>正文


Python TypeConvertor.pythonRawToNetzobRaw方法代码示例

本文整理汇总了Python中netzob.Common.Type.TypeConvertor.TypeConvertor.pythonRawToNetzobRaw方法的典型用法代码示例。如果您正苦于以下问题:Python TypeConvertor.pythonRawToNetzobRaw方法的具体用法?Python TypeConvertor.pythonRawToNetzobRaw怎么用?Python TypeConvertor.pythonRawToNetzobRaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在netzob.Common.Type.TypeConvertor.TypeConvertor的用法示例。


在下文中一共展示了TypeConvertor.pythonRawToNetzobRaw方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: reverse

# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import pythonRawToNetzobRaw [as 别名]
 def reverse(self, message):
     """reverse:
     This compress the provided message in bz2 format"""
     result = message
     rawData = TypeConvertor.netzobRawToPythonRaw(message)
     try:
         rawResult = bz2.compress(rawData)
         result = TypeConvertor.pythonRawToNetzobRaw(rawResult)
     except Exception as e:
         logging.info("Impossible to reverse BZ2 function (compress) on provided message (error= {0})".format(str(e)))
         result = ""
     return result
开发者ID:EnjoyHacking,项目名称:netzob,代码行数:14,代码来源:BZ2Function.py

示例2: apply

# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import pythonRawToNetzobRaw [as 别名]
 def apply(self, message):
     result = message
     rawData = TypeConvertor.netzobRawToPythonRaw(message)
     compressedstream = StringIO.StringIO(rawData)
     try:
         gzipper = gzip.GzipFile(fileobj=compressedstream)
         data = gzipper.read()
         result = TypeConvertor.pythonRawToNetzobRaw(data)
     except Exception as e:
         logging.info("Impossible to apply GZip function on provided message (error= {0})".format(str(e)))
         result = ""
     return result
开发者ID:EnjoyHacking,项目名称:netzob,代码行数:14,代码来源:GZipFunction.py

示例3: reverse

# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import pythonRawToNetzobRaw [as 别名]
 def reverse(self, message):
     """reverse:
     Encode in B64 the provided message"""
     result = message
     try:
         rawContent = TypeConvertor.netzobRawToPythonRaw(message)
         b64Content = base64.b64encode(rawContent)
         result = TypeConvertor.pythonRawToNetzobRaw(b64Content)
     except TypeError as error:
         logging.warning("Impossible to compute the base64 value of message (error={0})".format(str(error)))
         result = ""
     return result
开发者ID:EnjoyHacking,项目名称:netzob,代码行数:14,代码来源:Base64Function.py

示例4: reverse

# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import pythonRawToNetzobRaw [as 别名]
 def reverse(self, message):
     result = message
     rawData = TypeConvertor.netzobRawToPythonRaw(message)
     compressedstream = StringIO.StringIO()
     try:
         gzipper = gzip.GzipFile(fileobj=compressedstream, mode='w')
         gzipper.write(rawData)
         gzipper.close()
         result = TypeConvertor.pythonRawToNetzobRaw(compressedstream.getvalue())
     except Exception as e:
         logging.info("Impossible to apply GZip function on provided message (error= {0})".format(str(e)))
         result = ""
     return result
开发者ID:EnjoyHacking,项目名称:netzob,代码行数:15,代码来源:GZipFunction.py

示例5: __str__

# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import pythonRawToNetzobRaw [as 别名]
 def __str__(self):
     return str(self.format) + "_" + str(self.length) + "_" + str(self.type) + "_" + TypeConvertor.pythonRawToNetzobRaw(str(self.value))
开发者ID:EnjoyHacking,项目名称:netzob,代码行数:4,代码来源:Token.py


注:本文中的netzob.Common.Type.TypeConvertor.TypeConvertor.pythonRawToNetzobRaw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。