def parse_object(self, fileptr, identifier): if not identifier[:3].isalnum(): return None size_field = fileptr.read(4) size = get_chunk_size(size_field) chunk = fileptr.read(size) return model.RiffObject(identifier + size_field + chunk)
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)