Beispiel #1
0
 public function parse()
 {
     if ($this->isParsed()) {
         return;
     }
     $parser = new BinaryStreamParser($this->stream);
     $signature = $this->parseSignature($parser);
     if ($signature == "MPQ27") {
         $this->userData = UserData::parse($parser);
         $this->stream->seek($this->getUserDataOffset());
         $signature = $this->parseSignature($parser);
     }
     if ($signature == "MPQ26") {
         $this->header = Header::parse($parser);
     }
     $this->hashTable = $this->parseHashTable();
     $this->blockTable = $this->parseBlockTable();
     $this->parsed = true;
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function seek($position)
 {
     $this->stream->seek($position);
 }
Beispiel #3
0
 /**
  * {@inheritdoc}
  */
 public function seek($position)
 {
     $this->stream->seek($position);
     $this->bufferPointer = 0xff;
 }
Beispiel #4
0
 private function readSector(Sector $sector)
 {
     $this->stream->seek($this->file->getUserDataOffset() + $this->block->getFilePos() + $sector->getStart());
     $compressedStream = $this->createCompressedStream($sector);
     return $compressedStream->readBytes($this->block->getSize());
 }