def createFields(self): yield UInt8(self, "configurationVersion") yield UInt8(self, "AVCProfileIndication") yield UInt8(self, "profile_compatibility") yield UInt8(self, "AVCLevelIndication") yield NullBits(self, "reserved[]", 6) yield Bits(self, "lengthSizeMinusOne", 2) yield NullBits(self, "reserved[]", 3) yield Bits(self, "numOfSequenceParameterSets", 5) for i in range(self["numOfSequenceParameterSets"].value): yield PascalString16(self, "sequenceParameterSetNALUnit[]") yield UInt8(self, "numOfPictureParameterSets") for i in range(self["numOfPictureParameterSets"].value): yield PascalString16(self, "pictureParameterSetNALUnit[]") if self['AVCProfileIndication'].value in (100, 110, 122, 144) and not self.eof: yield NullBits(self, "reserved[]", 6) yield Bits(self, "chroma_format", 2) yield NullBits(self, "reserved[]", 5) yield Bits(self, "bit_depth_luma_minus8", 3) yield NullBits(self, "reserved[]", 5) yield Bits(self, "bit_depth_chroma_minus8", 3) yield UInt8(self, "numOfSequenceParameterSetExt") for i in range(self["numOfSequenceParameterSetExt"].value): yield PascalString16(self, "sequenceParameterSetExtNALUnit[]")
def fileHeader(self): yield filesizeHandler( UInt32(self, "compressed_size", "Size of the compressed file")) yield filesizeHandler( UInt32(self, "uncompressed_size", "Uncompressed file size")) yield TimeDateMSDOS32(self, "ftime", "Date and time (MS DOS format)") if self["/header/host_os"].value in (OS_MSDOS, OS_WIN32): yield MSDOSFileAttr32(self, "file_attr", "File attributes") else: yield textHandler(UInt32(self, "file_attr", "File attributes"), hexadecimal) yield textHandler( UInt32(self, "file_crc32", "CRC32 checksum over the compressed file)"), hexadecimal) yield Enum(UInt8(self, "compression_type", "Type of compression"), COMPRESSION_TYPE) yield Enum(UInt8(self, "compression_mode", "Quality of compression"), COMPRESSION_MODE) yield textHandler(UInt16(self, "parameters", "Compression parameters"), hexadecimal) yield textHandler(UInt16(self, "reserved", "Reserved data"), hexadecimal) # Filename yield PascalString16(self, "filename", "Filename") # Comment if self["flags/has_comment"].value: yield filesizeHandler( UInt16(self, "comment_size", "Size of the compressed comment")) if self["comment_size"].value > 0: yield RawBytes(self, "comment_data", self["comment_size"].value, "Comment data")
def createFields(self): yield Enum(UInt8(self, "typecode"), TYPECODE_NAMES) self.root.newHandle(self) yield Int32(self, "proxyInterfaceName_count") for i in range(self['proxyInterfaceName_count'].value): yield PascalString16(self, "proxyInterfaceName[]", charset="UTF-8") yield ClassAnnotation(self, "classAnnotation") yield SerializedContent(self, "superClassDesc")
def createFields(self): yield UInt16(self, "number_disk", "Number of this disk") yield UInt16(self, "number_disk2", "Number in the central dir") yield UInt16(self, "total_number_disk", "Total number of entries in this disk") yield UInt16(self, "total_number_disk2", "Total number of entries in the central dir") yield UInt32(self, "size", "Size of the central directory") yield UInt32(self, "offset", "Offset of start of central directory") yield PascalString16(self, "comment", "ZIP comment")
def createFields(self): yield PascalString16(self, "name", "Name", charset="UTF-16-LE", strip="\0") yield Enum(UInt16(self, "type"), self.TYPE_NAME) yield UInt16(self, "value_length") type = self["type"].value size = self["value_length"].value name = "value" if type == 0 and (size % 2) == 0: yield String(self, name, size, charset="UTF-16-LE", strip="\0") elif type in (2, 3): yield UInt32(self, name) elif type == 4: yield UInt64(self, name) else: yield RawBytes(self, name, size)
def createFields(self): yield Enum(UInt8(self, "typecode"), TYPECODE_NAMES) yield PascalString16(self, "className", charset="UTF-8") yield Int64(self, "serialVersionUID") self.root.newHandle(self) yield NullBits(self, "classDescFlags_reserved", 3) yield Bit(self, "classDescFlags_enum", "Is the class an Enum?") yield Bit( self, "classDescFlags_block_data", "Was the externalizable's block data written using stream version 2?" ) yield Bit(self, "classDescFlags_externalizable", "Does the class implement java.io.Externalizable?") yield Bit(self, "classDescFlags_serializable", "Does the class implement java.io.Serializable?") yield Bit(self, "classDescFlags_write_method", "Does the class have a writeObject method?") yield Int16(self, "fieldDesc_count") for i in range(self['fieldDesc_count'].value): yield FieldDesc(self, "fieldDesc[]") yield ClassAnnotation(self, "classAnnotation") yield SerializedContent(self, "superClassDesc")
def createFields(self): yield UInt8(self, "unk[]", "0x80 or 0x00") yield PascalString16(self, "tag_name", charset='UTF-8') yield UInt16(self, "unk[]", "0x0001") yield UInt16(self, "unk[]", "0x0000") yield PascalString16(self, "tag_value", charset='UTF-8')
def createFields(self): yield String(self, "typecode", 1) yield PascalString16(self, "fieldName", charset="UTF-8") if self['typecode'].value in ('[', 'L'): yield SerializedContent(self, "className")
def createFields(self): yield Enum(UInt8(self, "typecode"), TYPECODE_NAMES) self.root.newHandle(self) yield PascalString16(self, "value", charset="UTF-8")
def createFields(self): yield PascalString16(self, "signature", "Signature")
def createFields(self): yield UInt32(self, "size") yield UInt16(self, "obj_version") yield PascalString8(self, "name", charset="ASCII") yield UInt32(self, "type") yield PascalString16(self, "value", charset="ISO-8859-1", strip=" \0")
def parseContentDescription(self): yield PascalString16(self, "title", charset="ISO-8859-1", strip=" \0") yield PascalString16(self, "author", charset="ISO-8859-1", strip=" \0") yield PascalString16(self, "copyright", charset="ISO-8859-1", strip=" \0") yield PascalString16(self, "comment", charset="ISO-8859-1", strip=" \0")
def parseUTF8(parent): yield PascalString16(parent, "value", charset="UTF-8")
def createFields(self): yield PascalString16(self, "key", charset="UTF-8") yield UInt8(self, "type") for field in self.parser(self): yield field