예제 #1
0
파일: win32.py 프로젝트: markogle/hachoir3
 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
파일: win32.py 프로젝트: JackDandy/SickGear
 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 isinstance(self._getValue, types.FunctionType):
         display = makePrintable(self.value[:max_bytes], "ASCII")
     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 = makePrintable(self._display, "ASCII")
     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
     try:
         display = makePrintable(self.value[:max_bytes], "ASCII")
     except Exception:
         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 = makePrintable(self._display, "ASCII")
     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
파일: win32.py 프로젝트: markogle/hachoir3
 def createRawDisplay(self):
     value = self.stream.readBytes(self.absolute_address, 16)
     return str2hex(value, format=r"\x%02x")
예제 #6
0
파일: common.py 프로젝트: esc777690/LGK-Hub
 def createValue(self):
     bytes = self.stream.readBytes(self.absolute_address, 6)
     return str2hex(bytes, format="%02x:")[:-1]
예제 #7
0
 def createValue(self):
     bytes = self.stream.readBytes(self.absolute_address, 6)
     return str2hex(bytes, format="%02x:")[:-1]
예제 #8
0
 def createDisplay(self):
     text = str2hex(self['uuid'].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
파일: win32.py 프로젝트: JackDandy/SickGear
 def createRawDisplay(self):
     value = self.stream.readBytes(self.absolute_address, 16)
     return str2hex(value, format=r"\x%02x")