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


Python TypeConvertor.stringB2bin方法代码示例

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


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

示例1: read

# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import stringB2bin [as 别名]
    def read(self, timeout):
        self.log.debug("Reading from the socket some data (timeout = " + str(timeout))
        result = bitarray(endian='big')

        chars = []
        try:
            if timeout > 0:
                ready = select.select([self.socket], [], [], timeout)
                if ready[0]:
                    chars = self.socket.recv(4096)
            else:
                ready = select.select([self.socket], [], [])
                self.log.debug("ready = " + str(ready[0]))
                if ready[0]:
                    chars = self.socket.recv(4096)
        except:
            self.log.debug("Impossible to read from the network socket")
            return None

        if (len(chars) == 0):
            return result
        result = TypeConvertor.stringB2bin(chars)

        self.log.debug("Received : {0}".format(TypeConvertor.bin2strhex(result)))
        return result
开发者ID:EnjoyHacking,项目名称:netzob,代码行数:27,代码来源:InstanciatedNetworkServer.py

示例2: str2bin

# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import stringB2bin [as 别名]
 def str2bin(self, stri):
     return TypeConvertor.stringB2bin(stri)
开发者ID:lindi2,项目名称:netzob,代码行数:4,代码来源:AbstractWordType.py

示例3: guessValue

# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import stringB2bin [as 别名]
 def guessValue(self):
     """guessValue:
             Try to guess the pointed variable's value and give it to the current value.
     """
     # The 'TEMP' value is explicit enough.
     self.currentValue = TypeConvertor.stringB2bin("TEMP")
开发者ID:lindi2,项目名称:netzob,代码行数:8,代码来源:ComputedRelationVariable.py

示例4: configureMemory

# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import stringB2bin [as 别名]
    def configureMemory(self):
        """Presets the meta-variables of the channel with specified values"""

        self.varL4Protocol = DataVariable(AbstractChannel.varID_L4_PROTOCOL, AbstractChannel.varID_L4_PROTOCOL, True, True, WordType(True, 0, 5), TypeConvertor.stringB2bin(self.originalProtocol))
        self.varBindIP = DataVariable(AbstractChannel.varID_BIND_IP, AbstractChannel.varID_BIND_IP, True, True, IPv4WordType(True, 7, 15), TypeConvertor.stringB2bin(self.originalBindIp))
        self.varBindPort = DataVariable(AbstractChannel.varID_BIND_PORT, AbstractChannel.varID_BIND_PORT, True, True, DecimalWordType(True, 0, 5), TypeConvertor.stringB2bin(str(self.originalBindPort)))
        self.varTargetIP = DataVariable(AbstractChannel.varID_TARGET_IP, AbstractChannel.varID_TARGET_IP, True, True, IPv4WordType(True), TypeConvertor.stringB2bin(self.originalTargetIp))
        self.varTargetPort = DataVariable(AbstractChannel.varID_TARGET_PORT, AbstractChannel.varID_TARGET_PORT, True, True, DecimalWordType(True, 0, 5), TypeConvertor.stringB2bin(str(self.originalTargetPort)))

        self.memory.forget(self.varL4Protocol)
        self.memory.memorize(self.varL4Protocol)

        self.memory.forget(self.varBindIP)
        self.memory.memorize(self.varBindIP)

        self.memory.forget(self.varBindPort)
        self.memory.memorize(self.varBindPort)

        self.memory.forget(self.varTargetIP)
        self.memory.memorize(self.varTargetIP)

        self.memory.forget(self.varTargetPort)
        self.memory.memorize(self.varTargetPort)
开发者ID:EnjoyHacking,项目名称:netzob,代码行数:25,代码来源:AbstractChannel.py


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