Пример #1
0
    def createFields(self):
        # First kilobyte: boot sectors
        yield RawBytes(self, "boot", 1024, "Space for disklabel etc.")

        # Header
        yield UInt32(self, "version")
        yield UInt32(self, "last_page")
        yield UInt32(self, "nb_badpage")
        yield UUID(self, "sws_uuid")
        yield UUID(self, "sws_volume")
        yield NullBytes(self, "reserved", 117*4)

        # Read bad pages (if any)
        count = self["nb_badpage"].value
        if count:
            if MAX_SWAP_BADPAGES < count:
                raise ParserError("Invalid number of bad page (%u)" % count)
            yield GenericVector(self, "badpages", count, UInt32, "badpage")

        # Read magic
        padding = self.seekByte(PAGE_SIZE - 10, "padding", null=True)
        if padding:
            yield padding
        yield String(self, "magic", 10, charset="ASCII")

        # Read all pages
        yield GenericVector(self, "pages", self["last_page"].value, Page, "page")

        # Padding at the end
        padding = self.seekBit(self.size, "end_padding", null=True)
        if padding:
            yield padding
Пример #2
0
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")
Пример #3
0
    def createFields(self):
        yield String(self,
                     "endian",
                     2,
                     'Endian ("II" or "MM")',
                     charset="ASCII")
        yield UInt16(self, "version", "TIFF version number")
        offset = UInt32(
            self, "img_dir_ofs[]",
            "Next image directory offset (in bytes from the beginning)")
        yield offset
        ifds = []
        while True:
            if offset.value == 0:
                break

            self.seekByte(offset.value, relative=False)
            ifd = IFD(self, "ifd[]", "Image File Directory", None)
            ifds.append(ifd)
            yield ifd
            offset = UInt32(
                self, "img_dir_ofs[]",
                "Next image directory offset (in bytes from the beginning)")
            yield offset
        for ifd in ifds:
            image = ImageFile(self, "image[]", "Image File", ifd)
            yield image
Пример #4
0
    def createFields(self):
        yield Enum(UInt16(self, "src"), self.port_name)
        yield Enum(UInt16(self, "dst"), self.port_name)
        yield UInt32(self, "seq_num")
        yield UInt32(self, "ack_num")

        yield Bits(self, "hdrlen", 6, "Header lenght")
        yield NullBits(self, "reserved", 2, "Reserved")

        yield Bit(self, "cgst", "Congestion Window Reduced")
        yield Bit(self, "ecn-echo", "ECN-echo")
        yield Bit(self, "urg", "Urgent")
        yield Bit(self, "ack", "Acknowledge")
        yield Bit(self, "psh", "Push mmode")
        yield Bit(self, "rst", "Reset connection")
        yield Bit(self, "syn", "Synchronize")
        yield Bit(self, "fin", "Stop the connection")

        yield UInt16(self, "winsize", "Windows size")
        yield textHandler(UInt16(self, "checksum"), hexadecimal)
        yield UInt16(self, "urgent")

        size = self["hdrlen"].value * 8 - self.current_size
        while 0 < size:
            option = TCP_Option(self, "option[]")
            yield option
            size -= option.size
Пример #5
0
 def createFields(self):
     yield textHandler(UInt8(self, "version"), hexadecimal)
     yield RawBytes(self, "flags", 3)
     yield UInt32(self, "nb_edits")
     yield UInt32(self, "length")
     yield UInt32(self, "start")
     yield QTFloat32(self, "playback_speed")
Пример #6
0
    def createFields(self):
        yield textHandler(
            UInt32(self, "magic", "File information magic (0xFEEF04BD)"),
            hexadecimal)
        if self["magic"].value != 0xFEEF04BD:
            raise ParserError("EXE resource: invalid file info magic")
        yield Version(self, "struct_ver", "Structure version (1.0)")
        yield Version(self, "file_ver_ms", "File version MS")
        yield Version(self, "file_ver_ls", "File version LS")
        yield Version(self, "product_ver_ms", "Product version MS")
        yield Version(self, "product_ver_ls", "Product version LS")
        yield textHandler(UInt32(self, "file_flags_mask"), hexadecimal)

        yield Bit(self, "debug")
        yield Bit(self, "prerelease")
        yield Bit(self, "patched")
        yield Bit(self, "private_build")
        yield Bit(self, "info_inferred")
        yield Bit(self, "special_build")
        yield NullBits(self, "reserved", 26)

        yield Enum(textHandler(UInt16(self, "file_os_major"), hexadecimal),
                   MAJOR_OS_NAME)
        yield Enum(textHandler(UInt16(self, "file_os_minor"), hexadecimal),
                   MINOR_OS_NAME)
        yield Enum(textHandler(UInt32(self, "file_type"), hexadecimal),
                   FILETYPE_NAME)
        field = textHandler(UInt32(self, "file_subfile"), hexadecimal)
        if field.value == FILETYPE_DRIVER:
            field = Enum(field, DRIVER_SUBTYPE_NAME)
        elif field.value == FILETYPE_FONT:
            field = Enum(field, FONT_SUBTYPE_NAME)
        yield field
        yield TimestampUnix32(self, "date_ms")
        yield TimestampUnix32(self, "date_ls")
Пример #7
0
    def createFields(self):
        # Read chunk header
        yield Bytes(self, "signature", 3, r"Property signature (\x8E\xAD\xE8)")
        if self["signature"].value != "\x8E\xAD\xE8":
            raise ParserError("Invalid property signature")
        yield UInt8(self, "version", "Signature version")
        yield NullBytes(self, "reserved", 4, "Reserved")
        yield UInt32(self, "count", "Count")
        yield UInt32(self, "size", "Size")

        # Read item header
        items = []
        for i in range(0, self["count"].value):
            item = ItemHeader(self, "item[]")
            yield item
            items.append(item)

        # Sort items by their offset
        items.sort(sortRpmItem)

        # Read item content
        start = self.current_size / 8
        for item in items:
            offset = item["offset"].value
            diff = offset - (self.current_size / 8 - start)
            if 0 < diff:
                yield NullBytes(self, "padding[]", diff)
            yield ItemContent(self, "content[]", item)
        size = start + self["size"].value - self.current_size / 8
        if 0 < size:
            yield NullBytes(self, "padding[]", size)
 def createFields(self):
     yield GUID(self, "file_id")
     yield TimedeltaWin64(self, "entry_interval")
     yield UInt32(self, "max_pckt_count")
     yield UInt32(self, "entry_count")
     for index in xrange(self["entry_count"].value):
         yield SimpleIndexEntry(self, "entry[]")
Пример #9
0
 def createFields(self):
     yield filesizeHandler(UInt32(self, "filesize", "Uncompressed file size"))
     yield UInt32(self, "offset", "File offset after decompression")
     yield UInt16(self, "iFolder", "file control id")
     yield DateTimeMSDOS32(self, "timestamp")
     yield MSDOSFileAttr16(self, "attributes")
     yield CString(self, "filename", charset="ASCII")
Пример #10
0
    def createFields(self):
        yield String(self, "magic", 4, "Magic (MSCF)", charset="ASCII")
        yield textHandler(UInt32(self, "hdr_checksum", "Header checksum (0 if not used)"), hexadecimal)
        yield filesizeHandler(UInt32(self, "filesize", "Cabinet file size"))
        yield textHandler(UInt32(self, "fld_checksum", "Folders checksum (0 if not used)"), hexadecimal)
        yield UInt32(self, "off_file", "Offset of first file")
        yield textHandler(UInt32(self, "files_checksum", "Files checksum (0 if not used)"), hexadecimal)
        yield textHandler(UInt16(self, "cab_version", "Cabinet version"), hexadecimal)
        yield UInt16(self, "nb_folder", "Number of folders")
        yield UInt16(self, "nb_files", "Number of files")
        yield Flags(self, "flags")
        yield UInt16(self, "setid")
        yield UInt16(self, "number", "Zero-based cabinet number")

        # --- TODO: Support flags
        if self["flags/has_reserved"].value:
            yield Reserved(self, "reserved")
        #(3) Previous cabinet name, if CAB_HEADER.flags & CAB_FLAG_HASPREV
        #(4) Previous disk name, if CAB_HEADER.flags & CAB_FLAG_HASPREV
        #(5) Next cabinet name, if CAB_HEADER.flags & CAB_FLAG_HASNEXT
        #(6) Next disk name, if CAB_HEADER.flags & CAB_FLAG_HASNEXT
        # ----

        for index in xrange(self["nb_folder"].value):
            yield Folder(self, "folder[]")
        for index in xrange(self["nb_files"].value):
            yield File(self, "file[]")

        end = self.seekBit(self.size, "endraw")
        if end:
            yield end
Пример #11
0
    def createFields(self):
        yield String(self,
                     "signature",
                     4,
                     'Format signature (".snd")',
                     charset="ASCII")
        yield UInt32(self, "data_ofs", "Data offset")
        yield filesizeHandler(UInt32(self, "data_size", "Data size"))
        yield Enum(UInt32(self, "codec", "Audio codec"), self.CODEC_NAME)
        yield displayHandler(
            UInt32(self, "sample_rate", "Number of samples/second"),
            humanFrequency)
        yield UInt32(self, "channels", "Number of interleaved channels")

        size = self["data_ofs"].value - self.current_size // 8
        if 0 < size:
            yield String(self,
                         "info",
                         size,
                         "Information",
                         strip=" \0",
                         charset="ISO-8859-1")

        size = min(self["data_size"].value,
                   (self.size - self.current_size) // 8)
        yield RawBytes(self, "audio_data", size, "Audio data")
Пример #12
0
 def createFields(self):
     yield Bytes(self, "signature", 4, r"RealAudio identifier ('.ra\xFD')")
     yield UInt16(self, "version", "Version")
     if self["version"].value == 3:
         yield UInt16(self, "header_size", "Header size")
         yield RawBytes(self, "Unknown1", 10)
         yield UInt32(self, "data_size", "Data size")
         yield Metadata(self, "metadata")
         yield UInt8(self, "Unknown2")
         yield PascalString8(self, "FourCC")
         audio_size = self["data_size"].value
     else: # version = 4
         yield UInt16(self, "reserved1", "Reserved, should be 0")
         yield String(self, "ra4sig", 4, "'.ra4' signature")
         yield UInt32(self, "filesize", "File size (minus 40 bytes)")
         yield UInt16(self, "version2", "Version 2 (always equal to version)")
         yield UInt32(self, "headersize", "Header size (minus 16)")
         yield UInt16(self, "codec_flavor", "Codec flavor")
         yield UInt32(self, "coded_frame_size", "Coded frame size")
         yield RawBytes(self, "unknown1", 12)
         yield UInt16(self, "subpacketh", "Subpacket h (?)")
         yield UInt16(self, "frame_size", "Frame size")
         yield UInt16(self, "sub_packet_size", "Subpacket size")
         yield UInt16(self, "unknown2", "Unknown")
         yield displayHandler(UInt16(self, "sample_rate", "Sample rate"), humanFrequency)
         yield UInt16(self, "unknown3", "Unknown")
         yield UInt16(self, "sample_size", "Sample size")
         yield UInt16(self, "channels", "Channels")
         yield PascalString8(self, "Interleaving ID String")
         yield PascalString8(self, "FourCC")
         yield RawBytes(self, "unknown4", 3)
         yield Metadata(self, "metadata")
         audio_size = (self["filesize"].value + 40) - (self["headersize"].value + 16)
     if 0 < audio_size:
         yield RawBytes(self, "audio_data", audio_size)
Пример #13
0
    def createFields(self):
        yield Bytes(self, "header", 4, r"PE header signature (PE\0\0)")
        if self["header"].value != "PE\0\0":
            raise ParserError("Invalid PE header signature")
        yield Enum(UInt16(self, "cpu", "CPU type"), self.cpu_name)
        yield UInt16(self, "nb_section", "Number of sections")
        yield TimestampUnix32(self, "creation_date", "Creation date")
        yield UInt32(self, "ptr_to_sym", "Pointer to symbol table")
        yield UInt32(self, "nb_symbols", "Number of symbols")
        yield UInt16(self, "opt_hdr_size", "Optional header size")

        yield Bit(self, "reloc_stripped",
                  "If true, don't contain base relocations.")
        yield Bit(self, "exec_image", "Executable image?")
        yield Bit(self, "line_nb_stripped", "COFF line numbers stripped?")
        yield Bit(self, "local_sym_stripped",
                  "COFF symbol table entries stripped?")
        yield Bit(self, "aggr_ws", "Aggressively trim working set")
        yield Bit(self, "large_addr",
                  "Application can handle addresses greater than 2 GB")
        yield NullBits(self, "reserved", 1)
        yield Bit(self, "reverse_lo",
                  "Little endian: LSB precedes MSB in memory")
        yield Bit(self, "32bit", "Machine based on 32-bit-word architecture")
        yield Bit(self, "is_stripped", "Debugging information removed?")
        yield Bit(
            self, "swap",
            "If image is on removable media, copy and run from swap file")
        yield PaddingBits(self, "reserved2", 1)
        yield Bit(self, "is_system", "It's a system file")
        yield Bit(self, "is_dll", "It's a dynamic-link library (DLL)")
        yield Bit(self, "up", "File should be run only on a UP machine")
        yield Bit(self, "reverse_hi", "Big endian: MSB precedes LSB in memory")
Пример #14
0
    def createFields(self):
        yield String(self, "signature", 2, "Header (\"BM\")", charset="ASCII")
        yield UInt32(self, "file_size", "File size (bytes)")
        yield PaddingBytes(self, "reserved", 4, "Reserved")
        yield UInt32(self, "data_start", "Data start position")
        yield BmpHeader(self, "header")

        # Compute number of color
        header = self["header"]
        bpp = header["bpp"].value
        if 0 < bpp <= 8:
            if "used_colors" in header and header["used_colors"].value:
                nb_color = header["used_colors"].value
            else:
                nb_color = (1 << bpp)
        else:
            nb_color = 0

        # Color palette (if any)
        if nb_color:
            yield PaletteRGBA(self, "palette", nb_color)

        # Seek to data start
        field = self.seekByte(self["data_start"].value)
        if field:
            yield field

        # Image pixels
        size = min(self["file_size"].value - self["data_start"].value,
                   (self.size - self.current_size) // 8)
        yield parseImageData(self, "pixels", size, header)
Пример #15
0
    def createFields(self):
        yield textHandler(UInt8(self, "version"), hexadecimal)

        # TODO: sum of :
        # TrackEnabled = 1;
        # TrackInMovie = 2;
        # TrackInPreview = 4;
        # TrackInPoster = 8
        yield RawBytes(self, "flags", 3)

        yield TimestampMac32(self, "creation_date")
        yield TimestampMac32(self, "lastmod_date")
        yield UInt32(self, "track_id")
        yield PaddingBytes(self, "reserved[]", 8)
        yield UInt32(self, "duration")
        yield PaddingBytes(self, "reserved[]", 8)
        yield Int16(self, "video_layer", "Middle is 0, negative in front")
        yield PaddingBytes(self, "other", 2)
        yield QTFloat32(self, "geom_a", "Width scale")
        yield QTFloat32(self, "geom_b", "Width rotate")
        yield QTFloat32(self, "geom_u", "Width angle")
        yield QTFloat32(self, "geom_c", "Height rotate")
        yield QTFloat32(self, "geom_d", "Height scale")
        yield QTFloat32(self, "geom_v", "Height angle")
        yield QTFloat32(self, "geom_x", "Position X")
        yield QTFloat32(self, "geom_y", "Position Y")
        yield QTFloat32(self, "geom_w", "Divider scale")
        yield QTFloat32(self, "frame_size_width")
        yield QTFloat32(self, "frame_size_height")
Пример #16
0
 def createFields(self):
     if self["../.."].name.startswith("doc_summary"):
         enum = self.DOCUMENT_PROPERTY
     else:
         enum = self.COMPONENT_PROPERTY
     yield Enum(UInt32(self, "id"), enum)
     yield UInt32(self, "offset")
Пример #17
0
 def createFields(self):
     yield String(self, "name", 32, strip="\0")
     yield PaddingBytes(self, "unknown[]", 32, pattern="\xCC")
     yield UInt32(self, "flags")
     yield UInt32(self, "id")
     yield UInt32(self, "type")
     yield Int32(self, "mesh_id")
     yield UInt32(self, "depth")
     yield Int32(self, "parent_offset")
     yield UInt32(self, "nchildren")
     yield UInt32(self, "first_child_offset")
     yield UInt32(self, "next_sibling_offset")
     yield Vertex(self, "pivot")
     yield Vertex(self, "position")
     yield Float32(self, "pitch")
     yield Float32(self, "yaw")
     yield Float32(self, "roll")
     for index in xrange(4):
         yield Vertex(self, "unknown_vertex[]")
     if self["parent_offset"].value != 0:
         yield UInt32(self, "parent_id")
     if self["first_child_offset"].value != 0:
         yield UInt32(self, "first_child_id")
     if self["next_sibling_offset"].value != 0:
         yield UInt32(self, "next_sibling_id")
Пример #18
0
    def createFields(self):
        yield String(self,
                     "signature",
                     4,
                     "PSD signature (8BPS)",
                     charset="ASCII")
        yield UInt16(self, "version")
        yield NullBytes(self, "reserved[]", 6)
        yield UInt16(self, "nb_channels")
        yield UInt32(self, "width")
        yield UInt32(self, "height")
        yield UInt16(self, "depth")
        yield Enum(UInt16(self, "color_mode"), self.COLOR_MODE)

        # Mode data
        yield UInt32(self, "mode_data_size")
        size = self["mode_data_size"].value
        if size:
            yield RawBytes(self, "mode_data", size)

        # Resources
        yield Config(self, "config")

        # Reserved
        yield UInt32(self, "reserved_data_size")
        size = self["reserved_data_size"].value
        if size:
            yield RawBytes(self, "reserved_data", size)

        yield Enum(UInt16(self, "compression"), self.COMPRESSION_NAME)

        size = (self.size - self.current_size) // 8
        if size:
            yield RawBytes(self, "end", size)
def parseCode(parent):
    if 0x3000000 <= parent.root.getVersion():
        yield UInt32(parent, "arg_count", "Argument count")
        yield UInt32(parent, "kwonlyargcount", "Keyword only argument count")
        yield UInt32(parent, "nb_locals", "Number of local variables")
        yield UInt32(parent, "stack_size", "Stack size")
        yield UInt32(parent, "flags")
    elif 0x2030000 <= parent.root.getVersion():
        yield UInt32(parent, "arg_count", "Argument count")
        yield UInt32(parent, "nb_locals", "Number of local variables")
        yield UInt32(parent, "stack_size", "Stack size")
        yield UInt32(parent, "flags")
    else:
        yield UInt16(parent, "arg_count", "Argument count")
        yield UInt16(parent, "nb_locals", "Number of local variables")
        yield UInt16(parent, "stack_size", "Stack size")
        yield UInt16(parent, "flags")
    yield Object(parent, "compiled_code")
    yield Object(parent, "consts")
    yield Object(parent, "names")
    yield Object(parent, "varnames")
    if 0x2000000 <= parent.root.getVersion():
        yield Object(parent, "freevars")
        yield Object(parent, "cellvars")
    yield Object(parent, "filename")
    yield Object(parent, "name")
    if 0x2030000 <= parent.root.getVersion():
        yield UInt32(parent, "firstlineno", "First line number")
    else:
        yield UInt16(parent, "firstlineno", "First line number")
    yield Object(parent, "lnotab")
Пример #20
0
 def createFields(self):
     yield Bytes(self, "jmp", 3, "Jump instruction (to skip over header on boot)")
     yield Bytes(self, "oem_name", 8, "OEM Name (padded with spaces)")
     yield UInt16(self, "sector_size", "Bytes per sector")
     yield UInt8 (self, "cluster_size", "Sectors per cluster")
     yield UInt16(self, "reserved_sectors", "Reserved sector count (including boot sector)")
     yield UInt8 (self, "fat_nb", "Number of file allocation tables")
     yield UInt16(self, "max_root", "Maximum number of root directory entries")
     yield UInt16(self, "sectors1", "Total sectors (if zero, use 'sectors2')")
     yield UInt8 (self, "media_desc", "Media descriptor")
     yield UInt16(self, "fat_size", "Sectors per FAT")
     yield UInt16(self, "track_size", "Sectors per track")
     yield UInt16(self, "head_nb", "Number of heads")
     yield UInt32(self, "hidden", "Hidden sectors")
     yield UInt32(self, "sectors2", "Total sectors (if greater than 65535)")
     if self.parent.version == 32:
         yield UInt32(self, "fat32_size", "Sectors per FAT")
         yield UInt16(self, "fat_flags", "FAT Flags")
         yield UInt16(self, "version", "Version")
         yield UInt32(self, "root_start", "Cluster number of root directory start")
         yield UInt16(self, "inf_sector", "Sector number of FS Information Sector")
         yield UInt16(self, "boot_copy", "Sector number of a copy of this boot sector")
         yield NullBytes(self, "reserved[]", 12, "Reserved")
     yield UInt8(self, "phys_drv", "Physical drive number")
     yield NullBytes(self, "reserved[]", 1, 'Reserved ("current head")')
     yield UInt8(self, "sign", "Signature")
     yield textHandler(UInt32(self, "serial", "ID (serial number)"), hexadecimal)
     yield String(self, "label", 11, "Volume Label", strip=' ', charset="ASCII")
     yield String(self, "fs_type", 8, "FAT file system type", strip=' ', charset="ASCII")
     yield Bytes(self, "code", 510-self.current_size/8, "Operating system boot code")
     yield Bytes(self, "trail_sig", 2, "Signature (0x55 0xAA)")
Пример #21
0
    def createFields(self):
        yield ZipVersion(self, "version_made_by", "Version made by")
        for field in ZipStartCommonFields(self):
            yield field

        # Check unicode status
        charset = zipGetCharset(self)

        yield UInt16(self, "comment_length", "Comment length")
        yield UInt16(self, "disk_number_start", "Disk number start")
        yield UInt16(self, "internal_attr", "Internal file attributes")
        yield UInt32(self, "external_attr", "External file attributes")
        yield UInt32(self, "offset_header", "Relative offset of local header")
        yield String(self,
                     "filename",
                     self["filename_length"].value,
                     "Filename",
                     charset=charset)
        if 0 < self["extra_length"].value:
            yield RawBytes(self, "extra", self["extra_length"].value,
                           "Extra fields")
        if 0 < self["comment_length"].value:
            yield String(self,
                         "comment",
                         self["comment_length"].value,
                         "Comment",
                         charset=charset)
Пример #22
0
 def createFields(self):
     yield String(self,
                  "magic",
                  4,
                  "File signature (MARC)",
                  charset="ASCII")
     yield UInt32(self, "version")
     yield UInt32(self, "nb_file")
     files = []
     for index in xrange(self["nb_file"].value):
         item = FileIndex(self, "file[]")
         yield item
         if item["filesize"].value:
             files.append(item)
     files.sort(key=lambda item: item["offset"].value)
     for index in files:
         padding = self.seekByte(index["offset"].value)
         if padding:
             yield padding
         size = index["filesize"].value
         desc = "File %s" % index["filename"].value
         yield SubFile(self,
                       "data[]",
                       size,
                       desc,
                       filename=index["filename"].value)
 def createFields(self):
     yield UInt32(self, "size")
     while not self.eof:
         yield UInt32(self, "marker")
         if self["marker"].value == 'DWRT':
             yield Float32(self, "dry_ratio")
         elif self["marker"].value == 'PORG':
             yield UInt32(self, "default_program")
Пример #24
0
 def createFields(self):
     yield textHandler(UInt32(self, "file_crc32", "Checksum (CRC32)"),
                       hexadecimal)
     yield filesizeHandler(
         UInt32(self, "file_compressed_size", "Compressed size (bytes)"))
     yield filesizeHandler(
         UInt32(self, "file_uncompressed_size",
                "Uncompressed size (bytes)"))
Пример #25
0
 def createFields(self):
     yield UInt32(self, "start")
     yield UInt32(self, "length")
     yield UInt32(self,
                  "flags")  # PreloadAlways = 1 or TrackEnabledPreload = 2
     yield UInt32(
         self, "hints"
     )  # KeepInBuffer = 0x00000004; HighQuality = 0x00000100; SingleFieldVideo = 0x00100000
Пример #26
0
 def createFields(self):
     yield UInt32(self, "width", "Channel width")
     yield UInt32(self, "height", "Channel height")
     yield PascalString32(self, "name", "Channel name", strip="\0", charset="UTF-8")
     for field in readProperties(self):
         yield field
     yield UInt32(self, "hierarchy_ofs", "Hierarchy offset")
     yield XcfHierarchy(self, "hierarchy", "Hierarchy")
Пример #27
0
 def createFields(self):
     yield textHandler(UInt32(self, "plugin_id1"), hexadecimal)
     yield textHandler(UInt32(self, "plugin_id2"), hexadecimal)
     yield UInt32(self, "input_routing")
     yield UInt32(self, "output_routing")
     yield GenericVector(self, "routing_info", 4, UInt32, "reserved")
     yield String(self, "name", 32, strip='\0')
     yield String(self, "dll_name", 64, desc="Original DLL name", strip='\0')
Пример #28
0
 def createFields(self):
     yield UInt32(self, "data_offset")
     yield UInt8(self, "logical_width")
     yield UInt8(self, "unknown[]")
     yield UInt8(self, "unknown[]")
     yield UInt8(self, "unknown[]")
     yield UInt32(self, "width_pixels")
     yield UInt32(self, "height_pixels")
Пример #29
0
 def createFields(self):
     yield UInt8(self, "width", "Width")
     yield UInt8(self, "height", "Height")
     yield UInt8(self, "nb_color", "Number of colors")
     yield UInt8(self, "reserved", "(reserved)")
     yield UInt16(self, "planes", "Color planes (=1)")
     yield UInt16(self, "bpp", "Bits per pixel")
     yield UInt32(self, "size", "Content size in bytes")
     yield UInt32(self, "offset", "Data offset")
Пример #30
0
 def createFields(self):
     yield UInt32(self, "version")
     yield UInt8(self, "has_realm")
     yield PascalStringWin32(self, "writer_name", charset="UTF-16-BE")
     yield PascalStringWin32(self, "reader_name", charset="UTF-16-BE")
     yield UInt32(self, "file_version")
     size = (self.size - self.current_size) // 8
     if size:
         yield NullBytes(self, "padding", size)