Пример #1
0
 def useHeader(self, gzip):
     self.compression = gzip["compression"].display
     if gzip["mtime"]:
         self.last_modification = gzip["mtime"].value
     self.os = gzip["os"].display
     if gzip["has_filename"].value:
         self.filename = getValue(gzip, "filename")
     if gzip["has_comment"].value:
         self.comment = getValue(gzip, "comment")
     self.compr_size = gzip["file"].size/8
     self.file_size = gzip["size"].value
Пример #2
0
 def useAviHeader(self, header):
     microsec = header["microsec_per_frame"].value
     if microsec:
         self.frame_rate = 1000000.0 / microsec
         total_frame = getValue(header, "total_frame")
         if total_frame and not self.has("duration"):
             self.duration = timedelta(microseconds=total_frame * microsec)
     self.width = header["width"].value
     self.height = header["height"].value
Пример #3
0
    def extractPE(self, exe):
        # Read information from headers
        if "pe_header" in exe:
            self.usePE_Header(exe["pe_header"])
        if "pe_opt_header" in exe:
            self.usePE_OptHeader(exe["pe_opt_header"])

        # Use PE resource
        resource = exe.getResource()
        if resource and "version_info/node[0]" in resource:
            for node in resource.array("version_info/node[0]/node"):
                if getValue(node, "name") == "StringFileInfo" \
                and "node[0]" in node:
                    self.readVersionInfo(node["node[0]"])
Пример #4
0
 def extract(self, riff):
     type = riff["type"].value
     if type == "WAVE":
         self.extractWAVE(riff)
         size = getValue(riff, "audio_data/size")
         if size:
             computeAudioComprRate(self, size * 8)
     elif type == "AVI ":
         if "headers" in riff:
             self.extractAVI(riff["headers"])
             self.extractInfo(riff["headers"])
     elif type == "ACON":
         self.extractAnim(riff)
     if "info" in riff:
         self.extractInfo(riff["info"])