def read_header(self):
with fopen(self.vpk_path, '<STR_LIT:rb>') as f:<EOL><INDENT>(self.signature,<EOL>self.version,<EOL>self.tree_length<EOL>) = struct.unpack("<STR_LIT>", f.read(<NUM_LIT:3>*<NUM_LIT:4>))<EOL>if self.signature != <NUM_LIT>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>elif self.version == <NUM_LIT:1>:<EOL><INDENT>self.header_length += <NUM_LIT:4>*<NUM_LIT:3><EOL><DEDENT>elif self.version == <NUM_LIT:2>:<EOL><INDENT>(self.embed_chunk_length,<EOL>self.chunk_hashes_length,<EOL>self.self_hashes_length,<EOL>self.signature_length<EOL>) = struct.unpack("<STR_LIT>", f.read(<NUM_LIT:4>*<NUM_LIT:4>))<EOL>self.header_length += <NUM_LIT:4>*<NUM_LIT:7><EOL>f.seek(self.tree_length + self.embed_chunk_length + self.chunk_hashes_length, <NUM_LIT:1>)<EOL>assert self.self_hashes_length == <NUM_LIT>, "<STR_LIT>"<EOL>(self.tree_checksum,<EOL>self.chunk_hashes_checksum,<EOL>self.file_checksum,<EOL>) = struct.unpack("<STR_LIT>", f.read(<NUM_LIT:16>*<NUM_LIT:3>))<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>
Reads VPK file header from the file