-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #427 from StudioMaX/2.0-with-1.9.23-202310190849
Sync 2.0 with 1.9.23-202310190849
- Loading branch information
Showing
44 changed files
with
718 additions
and
544 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace JamesHeinrich\GetID3\Module\Archive; | ||
|
||
use JamesHeinrich\GetID3\Module\Handler; | ||
use JamesHeinrich\GetID3\Utils; | ||
|
||
///////////////////////////////////////////////////////////////// | ||
/// getID3() by James Heinrich <info@getid3.org> // | ||
// available at https://github.com/JamesHeinrich/getID3 // | ||
// or https://www.getid3.org // | ||
// or http://getid3.sourceforge.net // | ||
// see readme.txt for more details // | ||
///////////////////////////////////////////////////////////////// | ||
// // | ||
// module.archive.7zip.php // | ||
// module for analyzing 7zip files // | ||
// /// | ||
///////////////////////////////////////////////////////////////// | ||
|
||
class SevenZip extends Handler | ||
{ | ||
/** | ||
* @return bool | ||
*/ | ||
public function Analyze() { | ||
$info = &$this->getid3->info; | ||
|
||
$this->fseek($info['avdataoffset']); | ||
$z7header = $this->fread(32); | ||
|
||
// https://py7zr.readthedocs.io/en/latest/archive_format.html | ||
$info['7zip']['header']['magic'] = substr($z7header, 0, 6); | ||
if ($info['7zip']['header']['magic'] != '7z'."\xBC\xAF\x27\x1C") { | ||
$this->error('Invalid 7zip stream header magic (expecting 37 7A BC AF 27 1C, found '.Utils::PrintHexBytes($info['7zip']['header']['magic']).') at offset '.$info['avdataoffset']); | ||
return false; | ||
} | ||
$info['fileformat'] = '7zip'; | ||
|
||
$info['7zip']['header']['version_major'] = Utils::LittleEndian2Int(substr($z7header, 6, 1)); // always 0x00 (?) | ||
$info['7zip']['header']['version_minor'] = Utils::LittleEndian2Int(substr($z7header, 7, 1)); // always 0x04 (?) | ||
$info['7zip']['header']['start_header_crc'] = Utils::LittleEndian2Int(substr($z7header, 8, 4)); | ||
$info['7zip']['header']['next_header_offset'] = Utils::LittleEndian2Int(substr($z7header, 12, 8)); | ||
$info['7zip']['header']['next_header_size'] = Utils::LittleEndian2Int(substr($z7header, 20, 8)); | ||
$info['7zip']['header']['next_header_crc'] = Utils::LittleEndian2Int(substr($z7header, 28, 4)); | ||
|
||
$this->error('7zip parsing not enabled in this version of getID3() ['.$this->getid3->version().']'); | ||
return false; | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.