Example #1
0
	def parse_compressed_list(self, stream, identifier, blocksizes):
		rawsize = dword2py_int(stream.read(4))
		list_identifier = stream.read(4)
		print list_identifier

		size = blocksizes[rawsize]

		size_field = py_int2dword(size)
		if size & 1:size += 1

		offset = stream.tell()

		obj = model.RiffList(identifier + size_field + list_identifier)

		while stream.tell() <= offset + size - 8:
			ret = self.parse_comressed_stream(stream, blocksizes)
			if ret is None:
				stream.seek(offset)
				chunk = stream.read(size - 4)
				return model.RiffUnparsedList(identifier + size_field + \
										list_identifier + chunk)
			else:
				obj.childs.append(ret)

		return obj
Example #2
0
    def parse_compressed_list(self, stream, identifier, blocksizes):
        rawsize = dword2py_int(stream.read(4))
        list_identifier = stream.read(4)
        print list_identifier

        size = blocksizes[rawsize]

        size_field = py_int2dword(size)
        if size & 1: size += 1

        offset = stream.tell()

        obj = model.RiffList(identifier + size_field + list_identifier)

        while stream.tell() <= offset + size - 8:
            ret = self.parse_comressed_stream(stream, blocksizes)
            if ret is None:
                stream.seek(offset)
                chunk = stream.read(size - 4)
                return model.RiffUnparsedList(identifier + size_field + \
                      list_identifier + chunk)
            else:
                obj.childs.append(ret)

        return obj
Example #3
0
 def parse_compressed_object(self, stream, identifier, blocksizes):
     if not identifier[:3].isalnum():
         return None
     rawsize = dword2py_int(stream.read(4))
     size = blocksizes[rawsize]
     size_field = py_int2dword(size)
     if size & 1: size += 1
     chunk = stream.read(size)
     return model.RiffObject(identifier + size_field + chunk)
Example #4
0
	def parse_compressed_object(self, stream, identifier, blocksizes):
		if not identifier[:3].isalnum():
			return None
		rawsize = dword2py_int(stream.read(4))
		size = blocksizes[rawsize]
		size_field = py_int2dword(size)
		if size & 1:size += 1
		chunk = stream.read(size)
		return model.RiffObject(identifier + size_field + chunk)
Example #5
0
 def parse_compressed_object(self, stream, identifier, blocksizes):
     if not identifier[:3].isalnum():
         return None
     rawsize = dword2py_int(stream.read(4))
     size = blocksizes[rawsize]
     size_field = py_int2dword(size)
     if size & 1: size += 1
     chunk = stream.read(size)
     self.report_stream_position(stream.tell())
     class_ = self.get_class(identifier)
     return class_(identifier + size_field + chunk)
Example #6
0
	def parse_compressed_object(self, stream, identifier, blocksizes):
		if not identifier[:3].isalnum():
			return None
		rawsize = dword2py_int(stream.read(4))
		size = blocksizes[rawsize]
		size_field = py_int2dword(size)
		if size & 1:size += 1
		chunk = stream.read(size)
		self.report_stream_position(stream.tell())
		class_ = self.get_class(identifier)
		return class_(identifier + size_field + chunk)
Example #7
0
 def __init__(self, chunk=''):
     if not chunk:
         chunk = 'RIFF' + py_int2dword(4) + 'riff'
     RiffList.__init__(self, chunk)
     self.version = self.chunk_tag
Example #8
0
	def __init__(self, chunk=''):
		if not chunk:
			chunk = 'RIFF' + py_int2dword(4) + 'riff'
		RiffList.__init__(self, chunk)
		self.version = self.chunk_tag