listContents($path) as $item) { /** @var StorageAttributes $item */ if (!$item->isFile() || !str_ends_with($item->path(), '.dll')) { continue; } $handle = $fs->readStream($item->path()); $hex = bin2hex(fread($handle, 4)); if (str_contains($hex, self::HEX_SIGNATURE)) { return new MatchResult($path); } } return new EmptyMatchResult(); } }