Пример #1
0
 def createValue(self):
     addr = self.absolute_address
     a = self.stream.readBits(addr, 32, self.endian)
     b = self.stream.readBits(addr + 32, 16, self.endian)
     c = self.stream.readBits(addr + 48, 16, self.endian)
     d = self.stream.readBytes(addr + 64, 2)
     e = self.stream.readBytes(addr + 80, 6)
     return "%08X-%04X-%04X-%s-%s" % (a, b, c, str2hex(d), str2hex(e))
Пример #2
0
 def createValue(self):
     addr = self.absolute_address
     a = self.stream.readBits (addr,      32, self.endian)
     b = self.stream.readBits (addr + 32, 16, self.endian)
     c = self.stream.readBits (addr + 48, 16, self.endian)
     d = self.stream.readBytes(addr + 64, 2)
     e = self.stream.readBytes(addr + 80, 6)
     return "%08X-%04X-%04X-%s-%s" % (a, b, c, str2hex(d), str2hex(e))
Пример #3
0
 def _createDisplay(self, human):
     max_bytes = config.max_byte_length
     if type(self._getValue) is type(lambda: None):
         display = self.value[:max_bytes]
     else:
         if self._display is None:
             address = self.absolute_address
             length = min(self._size / 8, max_bytes)
             self._display = self._parent.stream.readBytes(address, length)
         display = self._display
     truncated = (8 * len(display) < self._size)
     if human:
         if truncated:
             display += "(...)"
         return makePrintable(display, "latin-1", quote='"', to_unicode=True)
     else:
         display = str2hex(display, format=r"\x%02x")
         if truncated:
             return '"%s(...)"' % display
         else:
             return '"%s"' % display
Пример #4
0
 def createValue(self):
     bytes = self.stream.readBytes(self.absolute_address, 6)
     return str2hex(bytes, format="%02x:")[:-1]
Пример #5
0
 def createDisplay(self):
     text = str2hex(self.value, format=r"%02x")
     return "%s-%s-%s-%s-%s" % (
         text[:8], text[8:12], text[12:16], text[16:20], text[20:])
Пример #6
0
 def createRawDisplay(self):
     value = self.stream.readBytes(self.absolute_address, 16)
     return str2hex(value, format=r"\x%02x")
Пример #7
0
 def createRawDisplay(self):
     value = self.stream.readBytes(self.absolute_address, 16)
     return str2hex(value, format=r"\x%02x")
Пример #8
0
 def createValue(self):
     bytes = self.stream.readBytes(self.absolute_address, 6)
     return str2hex(bytes, format="%02x:")[:-1]