Пример #1
0
 def load_metadata(self, binfile):
     """
     Read the file metadata, update the seek accordingly
     :param binfile: file object
     :return:
     """
     data = struct.unpack("II", binfile.read(intsize * 2))
     self.id = data[1]
     self.name = get_string(binfile, 260)
     data = struct.unpack("IIIII", binfile.read(intsize * 5))
     self.comp_size = data[1]
     self.size = data[2]
     if data[3] != 0:
         self.compressed = True
     self.offset = data[4]   # note: the offset read here is relative to the beginning of the data area
Пример #2
0
 def load_metadata(self, binfile):
     """
     Read the file metadata, update the seek accordingly
     :param binfile: file object
     :return:
     """
     data = struct.unpack("II", binfile.read(intsize * 2))
     self.id = data[1]
     self.name = get_string(binfile, 260)
     data = struct.unpack("IIIII", binfile.read(intsize * 5))
     self.comp_size = data[1]
     self.size = data[2]
     if data[3] != 0:
         self.compressed = True
     self.offset = data[
         4]  # note: the offset read here is relative to the beginning of the data area
Пример #3
0
 def load_metadata(self, binfile):
     self.dwpack = get_string(binfile, 8)
     data = struct.unpack("III", binfile.read(intsize * 3))
     self.nfiles = data[1]
Пример #4
0
 def load_metadata(self, binfile):
     self.dwpack = get_string(binfile, 8)
     data = struct.unpack("III", binfile.read(intsize * 3))
     self.nfiles = data[1]