本文整理汇总了Python中armoryengine.BinaryUnpacker.BinaryUnpacker.getRemainingSize方法的典型用法代码示例。如果您正苦于以下问题:Python BinaryUnpacker.getRemainingSize方法的具体用法?Python BinaryUnpacker.getRemainingSize怎么用?Python BinaryUnpacker.getRemainingSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类armoryengine.BinaryUnpacker.BinaryUnpacker
的用法示例。
在下文中一共展示了BinaryUnpacker.getRemainingSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: unserialize
# 需要导入模块: from armoryengine.BinaryUnpacker import BinaryUnpacker [as 别名]
# 或者: from armoryengine.BinaryUnpacker.BinaryUnpacker import getRemainingSize [as 别名]
def unserialize(self, toUnpack):
bu = BinaryUnpacker(toUnpack)
self.messageType = bu.get(VAR_STR)
self.rejectCode = bu.get(INT8)
self.message = bu.get(VAR_STR)
self.data = bu.get(BINARY_CHUNK, bu.getRemainingSize())
self.serializedData = toUnpack
return self
示例2: executeScript
# 需要导入模块: from armoryengine.BinaryUnpacker import BinaryUnpacker [as 别名]
# 或者: from armoryengine.BinaryUnpacker.BinaryUnpacker import getRemainingSize [as 别名]
def executeScript(self, binaryScript, stack=[]):
self.stack = stack
self.stackAlt = []
scriptData = BinaryUnpacker(binaryScript)
self.lastOpCodeSepPos = None
while scriptData.getRemainingSize() > 0:
opcode = scriptData.get(UINT8)
exitCode = self.executeOpCode(opcode, scriptData, self.stack, self.stackAlt)
if not exitCode == SCRIPT_NO_ERROR:
if exitCode==OP_NOT_IMPLEMENTED:
LOGERROR('***ERROR: OpCodes OP_IF, OP_NOTIF, OP_ELSE, OP_ENDIF,')
LOGERROR(' have not been implemented, yet. This script')
LOGERROR(' could not be evaluated.')
if exitCode==OP_DISABLED:
LOGERROR('***ERROR: This script included an op code that has been')
LOGERROR(' disabled for security reasons. Script eval')
LOGERROR(' failed.')
return exitCode
return SCRIPT_NO_ERROR