__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
namespace ZipStream;
use RuntimeException;
/**
* @internal
* TODO: Make class readonly when requiring PHP 8.2 exclusively
*/
class PackField
{
public const MAX_V = 0xFFFFFFFF;
public const MAX_v = 0xFFFF;
public function __construct(
public readonly string $format,
public readonly int|string $value
) {
}
/**
* Create a format string and argument list for pack(), then call
* pack() and return the result.
*/
public static function pack(self ...$fields): string
{
$fmt = array_reduce($fields, function (string $acc, self $field) {
return $acc . $field->format;
}, '');
$args = array_map(function (self $field) {
switch($field->format) {
case 'V':
if ($field->value > self::MAX_V) {
throw new RuntimeException(print_r($field->value, true) . ' is larger than 32 bits');
}
break;
case 'v':
if ($field->value > self::MAX_v) {
throw new RuntimeException(print_r($field->value, true) . ' is larger than 16 bits');
}
break;
case 'P': break;
default:
break;
}
return $field->value;
}, $fields);
return pack($fmt, ...$args);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Exception | Folder | 0777 |
|
|
| Zip64 | Folder | 0777 |
|
|
| Zs | Folder | 0777 |
|
|
| CentralDirectoryFileHeader.php | File | 1.91 KB | 0777 |
|
| CompressionMethod.php | File | 2.09 KB | 0777 |
|
| DataDescriptor.php | File | 616 B | 0777 |
|
| EndOfCentralDirectory.php | File | 1.22 KB | 0777 |
|
| Exception.php | File | 103 B | 0777 |
|
| File.php | File | 13.06 KB | 0777 |
|
| GeneralPurposeBitFlag.php | File | 2.39 KB | 0777 |
|
| LocalFileHeader.php | File | 1.31 KB | 0777 |
|
| OperationMode.php | File | 803 B | 0777 |
|
| PackField.php | File | 1.44 KB | 0777 |
|
| Time.php | File | 1.09 KB | 0777 |
|
| Version.php | File | 178 B | 0777 |
|
| ZipStream.php | File | 27.08 KB | 0777 |
|