コード例 #1
0
ファイル: win32.py プロジェクト: BeegorMif/HTPC-Manager
 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
ファイル: byte_field.py プロジェクト: 070499/Sick-Beard
 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 _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
コード例 #5
0
 def createRawDisplay(self):
     value = self.stream.readBytes(self.absolute_address, 16)
     return str2hex(value, format=r"\x%02x")
コード例 #6
0
ファイル: common.py プロジェクト: 070499/Sick-Beard
 def createValue(self):
     bytes = self.stream.readBytes(self.absolute_address, 6)
     return str2hex(bytes, format="%02x:")[:-1]
コード例 #7
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:])
コード例 #8
0
ファイル: linux_swap.py プロジェクト: 070499/Sick-Beard
 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:])
コード例 #9
0
 def createValue(self):
     bytes = self.stream.readBytes(self.absolute_address, 6)
     return str2hex(bytes, format="%02x:")[:-1]
コード例 #10
0
ファイル: win32.py プロジェクト: BeegorMif/HTPC-Manager
 def createRawDisplay(self):
     value = self.stream.readBytes(self.absolute_address, 16)
     return str2hex(value, format=r"\x%02x")