- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
<?php
// init iso image
$iso = new \CISOFile;
$iso->open($filename);
$iso->ISOInit();
// get descriptor
$usedDesc = $this->iso->GetDescriptor(SUPPLEMENTARY_VOLUME_DESC);
if(!$usedDesc) $usedDesc = $this->iso->GetDescriptor(PRIMARY_VOLUME_DESC);
// get block size
$isoBlockSize = $usedDesc->iBlockSize;
// traverse directories and create files table
$files_locations = array();
$files_sizes = array();
$directories = $usedDesc->LoadMPathTable($this->iso);
foreach ($directories as $Directory) {
$directory = $Directory->GetFullPath($directories, false);
$directory = trim($directory, '/');
if ($directory != '') {
$directory .= '/';
}
$files = $Directory->LoadExtents($this->iso, $usedDesc->iBlockSize, true);
if ($files) {
foreach ($files as $file) {
if (in_array($file->strd_FileId, array('.', '..'))) continue;
$files_locations[$file->Location] = $directory.$file->strd_FileId;
$files_sizes[$directory.$file->strd_FileId] = $file->DataLen;
}
}
}
// find file position in iso image
// for example, let's use filename "README.txt"
$Location = array_search('README.txt', $files_locations);
$Location_Real = $Location * $isoBlockSize;
// seek file
$iso->Seek($Location_Real, SEEK_SET);
// read file
$content = $iso->Read($files_sizes['README.txt']);
guest 06.01.2017 12:37 # 0
guest 06.01.2017 14:11 # 0
bormand 06.01.2017 14:27 # 0
guest 06.01.2017 15:39 # 0
dacave 06.01.2017 18:08 # 0