def __str__(self): entry_str = '' if self.index is None else ('[{:03d}] '.format( self.index)) entry_str += ( 'Entry at offset 0x{:04X} (len = 0x{:X}, header len = 0x{:X}):'. format(self.offset_in_script, self.length, self.header_length)) if self.data: entry_str = entry_str + '\nData:\n' + dump_buffer(self.data, 16) if self.decoded_opcode: entry_str = entry_str + 'Decoded:\n' + str(self.decoded_opcode) return entry_str
def __str__(self): str_r = " Opcode : {} (0x{:04X})\n".format(self.name, self.opcode) str_r += " Width : 0x{:02X} ({:X} bytes)\n".format(self.width, script_width_sizes[self.width]) str_r += " Address: 0x{:08X}\n".format(self.address) if self.value is not None: str_r += " Value : 0x{:08X}\n".format(self.value) if self.mask is not None: str_r += " Mask : 0x{:08X}\n".format(self.mask) if self.unknown is not None: str_r += " Unknown: 0x{:04X}\n".format(self.unknown) if self.count is not None: str_r += " Count : 0x{:X}\n".format(self.count) if self.values is not None: fmt = '0x{}'.format( '{{:0{:d}X}}'.format(script_width_sizes[self.width] *2) ) str_r += " Values : {}\n".format(" ".join( [fmt.format(v) for v in self.values] )) elif self.buffer is not None: str_r += (" Buffer (size = 0x{:X}):\n".format(len(self.buffer)) + dump_buffer( self.buffer, 16 )) return str_r