php二次加密文件,找遍淘宝都没人能解

来求解的 发布于 2014/09/12 09:51
阅读 732
收藏 0
第一层加密以找人解开了,说第二层解不了,求大大们帮解
<?php
include("eykj_cn.php");
$client = new EYS_Client('http://api.eykj.cn/api.php');
$client->setCharset("utf-8");
eval($client->eys("4gZyhUemRTzZnT2oD3tLmaxIsKqBTPXFNwmIIyfOPnHJbDRv+lAwt/x2gL5ofDAr1LwK8y5gNyILEROxbmUKJZlGgQU13WpL7xziWQ75yCbE/QJEDVY5F+Gm2R98sa0Ob1SIyIPmZPVuB0uMgj187uY8a1Y1J2PzjaTR+1ny8GP9i6KBln6gJgqD27waDAN11rYP+7y+viLUq1OSqMcKJqjhJMp9wJaFwk5D+kWLrQ5S528R4FHCZ1+0f0ThQLKzBE3gPmc/4mCeK+fPvCrIlnkaUgRyf8Z06vc13o73iiwnFTs8KOkvMwvSdlieRIlLgivN9WJNBQ2GEa0pvvRwDXaHBzRBRVWCG8LbnIXa6hidEu6SjYXU5jahzQohDYAAHgpb+FGJDJlRxmc9nbmhV2jEAhbiXeN+QmL9lQqfVEiAalGs3s+6EE3SNuF4mD0rUHtoVcTA3mGeqbp6S2EtANDxXi/q/kHw2Cmh2c/LTsduJAaxep2uT7RycuAaHj/a00ZKrN/Kv0fS9qteVoNScHi1sY3pisk/+QrIBBTKwW+rtsmJy/5TuRILYONhukVy1IoX0O9Q3VuTQickhqZNcTBnw9L5TIupOOqXOGy9SENwt1jjmi8WfQhYZJbnzSkPxRhV0ySKMX770978Xz/lPzlTzKBadGdRb0e64TAWwPtdqx6+PUN5H8QaZ4L+k6WHfI1wjMm6N51zuWJSCGS4t3DgJptMTeNQVAyIGkyMHelBei/ljjigsAuU5azG3OO88i1wP4SkMXyKxhdCpRm77JKzpgwXPFkg9bEP9zZOk26IXd+cKX8q9rZVfmnVJ5sW42YJ94CBjFWmrvNtG5ILz3WKI6WX1kFAsNbBvIG7VWjfhP2m7Kgp1UaMIBLo/OyNvxTt9jB6gpHWEQKwv6ouBX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F66H0I3N+qSMs2NcO5X2fqsy92was3Lk0l4ovcGCynv2cOoSrr7rT7hWr67McP+fPOG+alldUKrF5iKsW+31HKNwnnkcrBAD+uafS2E1pcaDW69gVrN5kpRdGjYSbXcNMTX6hxbFjJkX+2rNRckQgzunq9NmfeMVvPPnRupZJrz72jNMzeJroIS3zTEFIn0uQ76vgaj+Wj800PBhxg49dtdcZAb+ek25bsO1wm1RWh9nyo0wTkgoIsnJwOvv00drsPjf25YfiLD/fg+k3eN3dXLrb4r/+f3PrOQNc3nPi504TCeUmJkoG8ezRepzQvCo5y5IrNNeBRlt5Fm1Btpt8auCcNMiRV9d/hoD91yxk4m1Y0EoIooOVKxAD+hwHv2aJCxXJqXshNcS55RQBiFEp2LYOk9j/LQJMFPfZvThTDzlX1CGQWT364wpYLYZho4vmbRw4W2b8Xw1i0vwuYKLGl1fgOqCepDxJoda7qpcRX3tiy2tPnxqlvMQr+wkWqhkEC4jEb5q2Ad1wVZghbkH8He5RIvm4XNutARcGsBv9uiWZflBbxpZjFuYmEmhsSFmMJsHfUlpM37T0iI4pUkFQwCUqndcornl1OgrViQrwWAQYb7NM/D0A3SHqELhlBi42eOJRFTPLJ1/nOtOdbcIV6mPe7yjmXEkSZdsu4ESYcZJD62QAUMGBCmO53Zx2z2DDNYl4X8lNBNw",base64_encode($_SERVER["SERVER_NAME"])));
?>
?


eykj_cn.php

<?php

 $_PHPRPC_COOKIES = array(); $_PHPRPC_COOKIE = ''; $_PHPRPC_SID = 0; if (defined('KEEP_PHPRPC_COOKIE_IN_SESSION')) { if (isset($_SESSION['phprpc_cookies']) and isset($_SESSION['phprpc_cookie'])) { $_PHPRPC_COOKIES = $_SESSION['phprpc_cookies']; $_PHPRPC_COOKIE = $_SESSION['phprpc_cookie']; } function keep_phprpc_cookie_in_session() { global $_PHPRPC_COOKIES, $_PHPRPC_COOKIE; $_SESSION['phprpc_cookies'] = $_PHPRPC_COOKIES; $_SESSION['phprpc_cookie'] = $_PHPRPC_COOKIE; } register_shutdown_function('keep_phprpc_cookie_in_session'); } class PHPRPC_Error { var $Number; var $Message; function PHPRPC_Error($errno, $errstr) { $this->Number = $errno; $this->Message = $errstr; } function toString() { return $this->Number . ":" . $this->Message; } function __toString() { return $this->toString(); } function getNumber() { return $this->Number; } function getMessage() { return $this->Message; } } class _EYS_Client { var $_server; var $_timeout; var $_output; var $_warning; var $_proxy; var $_key; var $_keylen; var $_encryptMode; var $_charset; var $_socket; var $_clientid; var $_http_version; var $_keep_alive; function _EYS_Client($serverURL = '') { global $_PHPRPC_SID; require_once('compat.php'); $this->_proxy = NULL; $this->_timeout = 30; $this->_clientid = 'php' . rand(1 << 30, 1 << 31) . time() . $_PHPRPC_SID; $_PHPRPC_SID++; $this->_socket = false; if ($serverURL != '') { $this->useService($serverURL); } } function useService($serverURL, $username = NULL, $password = NULL) { $this->_disconnect(); $this->_http_version = "1.1"; $this->_keep_alive = true; $this->_server = array(); $this->_key = NULL; $this->_keylen = 128; $this->_encryptMode = 0; $this->_charset = 'utf-8'; $urlparts = parse_url($serverURL); if (!isset($urlparts['host'])) { if (isset($_SERVER["HTTP_HOST"])) { $urlparts['host'] = $_SERVER["HTTP_HOST"]; } else if (isset($_SERVER["SERVER_NAME"])) { $urlparts['host'] = $_SERVER["SERVER_NAME"]; } else { $urlparts['host'] = "localhost"; } if (!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] == "off" || $_SERVER["HTTPS"] == "") { $urlparts['scheme'] = "http"; } else { $urlparts['scheme'] = "https"; } $urlparts['port'] = $_SERVER["SERVER_PORT"]; } if (!isset($urlparts['port'])) { if ($urlparts['scheme'] == "https") { $urlparts['port'] = 443; } else { $urlparts['port'] = 80; } } if (!isset($urlparts['path'])) { $urlparts['path'] = "/"; } else if (($urlparts['path']{0} != '/') && ($_SERVER["PHP_SELF"]{0} == '/')) { $urlparts['path'] = substr($_SERVER["PHP_SELF"], 0, strrpos($_SERVER["PHP_SELF"], '/') + 1) . $urlparts['path']; } if (isset($urlparts['query'])) { $urlparts['path'] .= '?' . $urlparts['query']; } if (!isset($urlparts['user']) || !is_null($username)) { $urlparts['user'] = $username; } if (!isset($urlparts['pass']) || !is_null($password)) { $urlparts['pass'] = $password; } $this->_server['scheme'] = $urlparts['scheme']; $this->_server['host'] = $urlparts['host']; $this->_server['port'] = $urlparts['port']; $this->_server['path'] = $urlparts['path']; $this->_server['user'] = $urlparts['user']; $this->_server['pass'] = $urlparts['pass']; } function setProxy($host, $port = NULL, $username = NULL, $password = NULL) { if (is_null($host)) { $this->_proxy = NULL; } else { if (is_null($port)) { $urlparts = parse_url($host); if (isset($urlparts['host'])) { $host = $urlparts['host']; } if (isset($urlparts['port'])) { $port = $urlparts['port']; } else { $port = 80; } if (isset($urlparts['user']) && is_null($username)) { $username = $urlparts['user']; } if (isset($urlparts['pass']) && is_null($password)) { $password = $urlparts['pass']; } } $this->_proxy = array(); $this->_proxy['host'] = $host; $this->_proxy['port'] = $port; $this->_proxy['user'] = $username; $this->_proxy['pass'] = $password; } } function setKeyLength($keylen) { if (!is_null($this->_key)) { return false; } else { $this->_keylen = $keylen; return true; } } function getKeyLength() { return $this->_keylen; } function setEncryptMode($encryptMode) { if (($encryptMode >= 0) && ($encryptMode <= 3)) { $this->_encryptMode = (int)($encryptMode); return true; } else { $this->_encryptMode = 0; return false; } } function getEncryptMode() { return $this->_encryptMode; } function setCharset($charset) { $this->_charset = $charset; } function getCharset() { return $this->_charset; } function setTimeout($timeout) { $this->_timeout = $timeout; } function getTimeout() { return $this->_timeout; } function invoke($funcname, &$args, $byRef = false) { $result = $this->_key_exchange(); if (is_a($result, 'PHPRPC_Error')) { return $result; } $request = "phprpc_func=$funcname"; if (count($args) > 0) { $request .= "&phprpc_args=" . base64_encode($this->_encrypt(serialize_fix($args), 1)); } $request .= "&phprpc_encrypt={$this->_encryptMode}"; if (!$byRef) { $request .= "&phprpc_ref=false"; } $request = str_replace('+', '%2B', $request); $result = $this->_post($request); if (is_a($result, 'PHPRPC_Error')) { return $result; } $phprpc_errno = 0; $phprpc_errstr = NULL; if (isset($result['phprpc_errno'])) { $phprpc_errno = intval($result['phprpc_errno']); } if (isset($result['phprpc_errstr'])) { $phprpc_errstr = base64_decode($result['phprpc_errstr']); } $this->_warning = new PHPRPC_Error($phprpc_errno, $phprpc_errstr); if (array_key_exists('phprpc_output', $result)) { $this->_output = base64_decode($result['phprpc_output']); if ($this->_server['version'] >= 3) { $this->_output = $this->_decrypt($this->_output, 3); } } else { $this->_output = ''; } if (array_key_exists('phprpc_result', $result)) { if (array_key_exists('phprpc_args', $result)) { $arguments = unserialize($this->_decrypt(base64_decode($result['phprpc_args']), 1)); for ($i = 0; $i < count($arguments); $i++) { $args[$i] = $arguments[$i]; } } $result = unserialize($this->_decrypt(base64_decode($result['phprpc_result']), 2)); } else { $result = $this->_warning; } return $result; } function getOutput() { return $this->_output; } function getWarning() { return $this->_warning; } function _connect() { if (is_null($this->_proxy)) { $host = (($this->_server['scheme'] == "https") ? "ssl://" : "") . $this->_server['host']; $this->_socket = @pfsockopen($host, $this->_server['port'], $errno, $errstr, $this->_timeout); } else { $host = (($this->_server['scheme'] == "https") ? "ssl://" : "") . $this->_proxy['host']; $this->_socket = @pfsockopen($host, $this->_proxy['port'], $errno, $errstr, $this->_timeout); } if ($this->_socket === false) { return new PHPRPC_Error($errno, $errstr); } stream_set_write_buffer($this->_socket, 0); socket_set_timeout($this->_socket, $this->_timeout); return true; } function _disconnect() { if ($this->_socket !== false) { fclose($this->_socket); $this->_socket = false; } } function _socket_read($size) { $content = ""; while (!feof($this->_socket) && ($size > 0)) { $str = fread($this->_socket, $size); $content .= $str; $size -= strlen($str); } return $content; } function _post($request_body) { global $_PHPRPC_COOKIE; $request_body = 'phprpc_id=' . $this->_clientid . '&' . $request_body; if ($this->_socket === false) { $error = $this->_connect(); if (is_a($error, 'PHPRPC_Error')) { return $error; } } if (is_null($this->_proxy)) { $url = $this->_server['path']; $connection = "Connection: " . ($this->_keep_alive ? 'Keep-Alive' : 'Close') . "\r\n" . "Cache-Control: no-cache\r\n"; } else { $url = "{$this->_server['scheme']}://{$this->_server['host']}:{$this->_server['port']}{$this->_server['path']}"; $connection = "Proxy-Connection: " . ($this->_keep_alive ? 'keep-alive' : 'close') . "\r\n"; if (!is_null($this->_proxy['user'])) { $connection .= "Proxy-Authorization: Basic " . base64_encode($this->_proxy['user'] . ":" . $this->_proxy['pass']) . "\r\n"; } } $auth = ''; if (!is_null($this->_server['user'])) { $auth = "Authorization: Basic " . base64_encode($this->_server['user'] . ":" . $this->_server['pass']) . "\r\n"; } $cookie = ''; if ($_PHPRPC_COOKIE) { $cookie = "Cookie: " . $_PHPRPC_COOKIE . "\r\n"; } $content_len = strlen($request_body); $request = "POST $url HTTP/{$this->_http_version}\r\n" . "Host: {$this->_server['host']}:{$this->_server['port']}\r\n" . "User-Agent: PHPRPC Client 3.0 for PHP\r\n" . $auth . $connection . $cookie . "Accept: */*\r\n" . "Accept-Encoding: gzip,deflate\r\n" . "Content-Type: application/x-www-form-urlencoded; charset={$this->_charset}\r\n" . "Content-Length: {$content_len}\r\n" . "\r\n" . $request_body; fputs($this->_socket, $request, strlen($request)); while (!feof($this->_socket)) { $line = fgets($this->_socket); if (preg_match('/HTTP\/(\d\.\d)\s+(\d+)([^(\r|\n)]*)(\r\n|$)/i', $line, $match)) { $this->_http_version = $match[1]; $status = (int)$match[2]; $status_message = trim($match[3]); if ($status != 100 && $status != 200) { $this->_disconnect(); return new PHPRPC_Error($status, $status_message); } } else { $this->_disconnect(); return new PHPRPC_Error(E_ERROR, "Illegal HTTP server."); } $header = array(); while (!feof($this->_socket) && (($line = fgets($this->_socket)) != "\r\n")) { $line = explode(':', $line, 2); $header[strtolower($line[0])][] =trim($line[1]); } if ($status == 100) continue; $response_header = $this->_parseHeader($header); if (is_a($response_header, 'PHPRPC_Error')) { $this->_disconnect(); return $response_header; } break; } $response_body = ''; if (isset($response_header['transfer_encoding']) && (strtolower($response_header['transfer_encoding']) == 'chunked')) { $s = fgets($this->_socket); if ($s == "") { $this->_disconnect(); return array(); } $chunk_size = (int)hexdec($s); while ($chunk_size > 0) { $response_body .= $this->_socket_read($chunk_size); if (fgets($this->_socket) != "\r\n") { $this->_disconnect(); return new PHPRPC_Error(1, "Response is incorrect."); } $chunk_size = (int)hexdec(fgets($this->_socket)); } fgets($this->_socket); } elseif (isset($response_header['content_length']) && !is_null($response_header['content_length'])) { $response_body = $this->_socket_read($response_header['content_length']); } else { while (!feof($this->_socket)) { $response_body .= fread($this->_socket, 4096); } $this->_keep_alive = false; $this->_disconnect(); } if (isset($response_header['content_encoding']) && (strtolower($response_header['content_encoding']) == 'gzip')) { $response_body = gzdecode($response_body); } if (!$this->_keep_alive) $this->_disconnect(); if ($this->_keep_alive && strtolower($response_header['connection']) == 'close') { $this->_keep_alive = false; $this->_disconnect(); } return $this->_parseBody($response_body); } function _parseHeader($header) { global $_PHPRPC_COOKIE, $_PHPRPC_COOKIES; if (preg_match('/PHPRPC Server\/([^,]*)(,|$)/i', implode(',', $header['x-powered-by']), $match)) { $this->_server['version'] = (float)$match[1]; } else { return new PHPRPC_Error(E_ERROR, "Illegal PHPRPC server."); } if (preg_match('/text\/plain\; charset\=([^,;]*)([,;]|$)/i', $header['content-type'][0], $match)) { $this->_charset = $match[1]; } if (isset($header['set-cookie'])) { foreach ($header['set-cookie'] as $cookie) { foreach (preg_split('/[;,]\s?/', $cookie) as $c) { list($name, $value) = explode('=', $c, 2); if (!in_array($name, array('domain', 'expires', 'path', 'secure'))) { $_PHPRPC_COOKIES[$name] = $value; } } } $cookies = array(); foreach ($_PHPRPC_COOKIES as $name => $value) { $cookies[] = "$name=$value"; } $_PHPRPC_COOKIE = join('; ', $cookies); } if (isset($header['content-length'])) { $content_length = (int)$header['content-length'][0]; } else { $content_length = NULL; } $transfer_encoding = isset($header['transfer-encoding']) ? $header['transfer-encoding'][0] : ''; $content_encoding = isset($header['content-encoding']) ? $header['content-encoding'][0] : ''; $connection = isset($header['connection']) ? $header['connection'][0] : 'close'; return array('transfer_encoding' => $transfer_encoding, 'content_encoding' => $content_encoding, 'content_length' => $content_length, 'connection' => $connection); } function _parseBody($body) { $body = explode(";\r\n", $body); $result = array(); $n = count($body); for ($i = 0; $i < $n; $i++) { $p = strpos($body[$i], '='); if ($p !== false) { $l = substr($body[$i], 0, $p); $r = substr($body[$i], $p + 1); $result[$l] = trim($r, '"'); } } return $result; } function _key_exchange() { if (!is_null($this->_key) || ($this->_encryptMode == 0)) return true; $request = "phprpc_encrypt=true&phprpc_keylen={$this->_keylen}"; $result = $this->_post($request); if (is_a($result, 'PHPRPC_Error')) { return $result; } if (array_key_exists('phprpc_keylen', $result)) { $this->_keylen = (int)$result['phprpc_keylen']; } else { $this->_keylen = 128; } if (array_key_exists('phprpc_encrypt', $result)) { $encrypt = unserialize(base64_decode($result['phprpc_encrypt'])); require_once('bigint.php'); require_once('xxtea.php'); $x = bigint_random($this->_keylen - 1, true); $key = bigint_powmod(bigint_dec2num($encrypt['y']), $x, bigint_dec2num($encrypt['p'])); if ($this->_keylen == 128) { $key = bigint_num2str($key); } else { $key = pack('H*', md5(bigint_num2dec($key))); } $this->_key = str_pad($key, 16, "\0", STR_PAD_LEFT); $encrypt = bigint_num2dec(bigint_powmod(bigint_dec2num($encrypt['g']), $x, bigint_dec2num($encrypt['p']))); $request = "phprpc_encrypt=$encrypt"; $result = $this->_post($request); if (is_a($result, 'PHPRPC_Error')) { return $result; } } else { $this->_key = NULL; $this->_encryptMode = 0; } return true; } function _encrypt($str, $level) { if (!is_null($this->_key) && ($this->_encryptMode >= $level)) { $str = xxtea_encrypt($str, $this->_key); } return $str; } function _decrypt($str, $level) { if (!is_null($this->_key) && ($this->_encryptMode >= $level)) { $str = xxtea_decrypt($str, $this->_key); } return $str; } } if (function_exists("overload") && version_compare(phpversion(), "5", "<")) { eval('

    class EYS_Client extends _EYS_Client {

        function __call($function, $arguments, &$return) {

            $return = $this->invoke($function, $arguments);

            return true;

        }

    }

    overload("EYS_Client");

    '); } else { class EYS_Client extends _EYS_Client { function __call($function, $arguments) { return $this->invoke($function, $arguments); } } } ?>



compat.php

<?php

 require_once("eykj_date.php"); if (!function_exists('file_get_contents')) { function file_get_contents($filename, $incpath = false, $resource_context = null) { if (false === $fh = fopen($filename, 'rb', $incpath)) { user_error('file_get_contents() failed to open stream: No such file or directory', E_USER_WARNING); return false; } clearstatcache(); if ($fsize = @filesize($filename)) { $data = fread($fh, $fsize); } else { $data = ''; while (!feof($fh)) { $data .= fread($fh, 8192); } } fclose($fh); return $data; } } if (!function_exists('ob_get_clean')) { function ob_get_clean() { $contents = ob_get_contents(); if ($contents !== false) ob_end_clean(); return $contents; } } function gzdecode($data, &$filename = '', &$error = '', $maxlength = null) { $len = strlen($data); if ($len < 18 || strcmp(substr($data, 0, 2), "\x1f\x8b")) { $error = "Not in GZIP format."; return null; } $method = ord(substr($data, 2, 1)); $flags = ord(substr($data, 3, 1)); if ($flags & 31 != $flags) { $error = "Reserved bits not allowed."; return null; } $mtime = unpack("V", substr($data, 4, 4)); $mtime = $mtime[1]; $xfl = substr($data, 8, 1); $os = substr($data, 8, 1); $headerlen = 10; $extralen = 0; $extra = ""; if ($flags & 4) { if ($len - $headerlen - 2 < 8) { return false; } $extralen = unpack("v", substr($data, 8, 2)); $extralen = $extralen[1]; if ($len - $headerlen - 2 - $extralen < 8) { return false; } $extra = substr($data, 10, $extralen); $headerlen += 2 + $extralen; } $filenamelen = 0; $filename = ""; if ($flags & 8) { if ($len - $headerlen - 1 < 8) { return false; } $filenamelen = strpos(substr($data, $headerlen), chr(0)); if ($filenamelen === false || $len - $headerlen - $filenamelen - 1 < 8) { return false; } $filename = substr($data, $headerlen, $filenamelen); $headerlen += $filenamelen + 1; } $commentlen = 0; $comment = ""; if ($flags & 16) { if ($len - $headerlen - 1 < 8) { return false; } $commentlen = strpos(substr($data, $headerlen), chr(0)); if ($commentlen === false || $len - $headerlen - $commentlen - 1 < 8) { return false; } $comment = substr($data, $headerlen, $commentlen); $headerlen += $commentlen + 1; } $headercrc = ""; if ($flags & 2) { if ($len - $headerlen - 2 < 8) { return false; } $calccrc = crc32(substr($data, 0, $headerlen)) & 0xffff; $headercrc = unpack("v", substr($data, $headerlen, 2)); $headercrc = $headercrc[1]; if ($headercrc != $calccrc) { $error = "Header checksum failed."; return false; } $headerlen += 2; } $datacrc = unpack("V", substr($data, -8, 4)); $datacrc = sprintf('%u', $datacrc[1] & 0xFFFFFFFF); $isize = unpack("V", substr($data, -4)); $isize = $isize[1]; $bodylen = $len - $headerlen - 8; if ($bodylen < 1) { return null; } $body = substr($data, $headerlen, $bodylen); $data = ""; if ($bodylen > 0) { switch ($method) { case 8: $data = gzinflate($body, $maxlength); break; default: $error = "Unknown compression method."; return false; } } $crc = sprintf("%u", crc32($data)); $crcOK = $crc == $datacrc; $lenOK = $isize == strlen($data); if (!$lenOK || !$crcOK) { $error = ( $lenOK ? '' : 'Length check FAILED. ') . ( $crcOK ? '' : 'Checksum FAILED.'); return false; } return $data; } if (version_compare(phpversion(), "5", "<")) { function serialize_fix($v) { return str_replace('O:11:"phprpc_date":7:{', 'O:11:"PHPRPC_Date":7:{', serialize($v)); } } else { function serialize_fix($v) { return serialize($v); } } function declare_empty_class($classname) { static $callback = null; $classname = preg_replace('/[^a-zA-Z0-9\_]/', '', $classname); if ($callback===null) { $callback = $classname; return; } if ($callback) { call_user_func($callback, $classname); } if (!class_exists($classname)) { if (version_compare(phpversion(), "5", "<")) { eval('class ' . $classname . ' { }'); } else { eval('

    class ' . $classname . ' {

        private function __get($name) {

            $vars = (array)$this;

            $protected_name = "\0*\0$name";

            $private_name = "\0'.$classname.'\0$name";

            if (array_key_exists($name, $vars)) {

                return $this->$name;

            }

            else if (array_key_exists($protected_name, $vars)) {

                return $vars[$protected_name];

            }

            else if (array_key_exists($private_name, $vars)) {

                return $vars[$private_name];

            }

            else {

                $keys = array_keys($vars);

                $keys = array_values(preg_grep("/^\\\\x00.*?\\\\x00".$name."$/", $keys));

                if (isset($keys[0])) {

                    return $vars[$keys[0]];

                }

                else {

                    return NULL;

                }

            }

        }

    }'); } } } declare_empty_class(ini_get('unserialize_callback_func')); ini_set('unserialize_callback_func', 'declare_empty_class'); ?>



eykj_date.php

<?php

 class PHPRPC_Date { var $year = 1; var $month = 1; var $day = 1; var $hour = 0; var $minute = 0; var $second = 0; var $millisecond = 0; function PHPRPC_Date() { $num = func_num_args(); $time = false; if ($num == 0) { $time = getdate(); } if ($num == 1) { $arg = func_get_arg(0); if (is_int($arg)) { $time = getdate($arg); } elseif (is_string($arg)) { $time = getdate(strtotime($arg)); } } if (is_array($time)) { $this->year = $time['year']; $this->month = $time['mon']; $this->day = $time['mday']; $this->hour = $time['hours']; $this->minute = $time['minutes']; $this->second = $time['seconds']; } } function addMilliseconds($milliseconds) { if (!is_int($milliseconds)) return false; if ($milliseconds == 0) return true; $millisecond = $this->millisecond + $milliseconds; $milliseconds = $millisecond % 1000; if ($milliseconds < 0) { $milliseconds += 1000; } $seconds = (int)(($millisecond - $milliseconds) / 1000); $millisecond = (int)$milliseconds; if ($this->addSeconds($seconds)) { $this->millisecond = (int)$milliseconds; return true; } else { return false; } } function addSeconds($seconds) { if (!is_int($seconds)) return false; if ($seconds == 0) return true; $second = $this->second + $seconds; $seconds = $second % 60; if ($seconds < 0) { $seconds += 60; } $minutes = (int)(($second - $seconds) / 60); if ($this->addMinutes($minutes)) { $this->second = (int)$seconds; return true; } else { return false; } } function addMinutes($minutes) { if (!is_int($minutes)) return false; if ($minutes == 0) return true; $minute = $this->minute + $minutes; $minutes = $minute % 60; if ($minutes < 0) { $minutes += 60; } $hours = (int)(($minute - $minutes) / 60); if ($this->addHours($hours)) { $this->minute = (int)$minutes; return true; } else { return false; } } function addHours($hours) { if (!is_int($hours)) return false; if ($hours == 0) return true; $hour = $this->hour + $hours; $hours = $hour % 24; if ($hours < 0) { $hours += 24; } $days = (int)(($hour - $hours) / 24); if ($this->addDays($days)) { $this->hour = (int)$hours; return true; } else { return false; } } function addDays($days) { if (!is_int($days)) return false; $year = $this->year; if ($days == 0) return true; if ($days >= 146097 || $days <= -146097) { $remainder = $days % 146097; if ($remainder < 0) { $remainder += 146097; } $years = 400 * (int)(($days - $remainder) / 146097); $year += $years; if ($year < 1 || $year > 9999) return false; $days = $remainder; } if ($days >= 36524 || $days <= -36524) { $remainder = $days % 36524; if ($remainder < 0) { $remainder += 36524; } $years = 100 * (int)(($days - $remainder) / 36524); $year += $years; if ($year < 1 || $year > 9999) return false; $days = $remainder; } if ($days >= 1461 || $days <= -1461) { $remainder = $days % 1461; if ($remainder < 0) { $remainder += 1461; } $years = 4 * (int)(($days - $remainder) / 1461); $year += $years; if ($year < 1 || $year > 9999) return false; $days = $remainder; } $month = $this->month; while ($days >= 365) { if ($year >= 9999) return false; if ($month <= 2) { if ((($year % 4) == 0) ? (($year % 100) == 0) ? (($year % 400) == 0) : true : false) { $days -= 366; } else { $days -= 365; } $year++; } else { $year++; if ((($year % 4) == 0) ? (($year % 100) == 0) ? (($year % 400) == 0) : true : false) { $days -= 366; } else { $days -= 365; } } } while ($days < 0) { if ($year <= 1) return false; if ($month <= 2) { $year--; if ((($year % 4) == 0) ? (($year % 100) == 0) ? (($year % 400) == 0) : true : false) { $days += 366; } else { $days += 365; } } else { if ((($year % 4) == 0) ? (($year % 100) == 0) ? (($year % 400) == 0) : true : false) { $days += 366; } else { $days += 365; } $year--; } } $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year); $day = $this->day; while ($day + $days > $daysInMonth) { $days -= $daysInMonth - $day + 1; $month++; if ($month > 12) { if ($year >= 9999) return false; $year++; $month = 1; } $day = 1; $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $month, $year); } $day += $days; $this->year = $year; $this->month = $month; $this->day = $day; return true; } function addMonths($months) { if (!is_int($months)) return false; if ($months == 0) return true; $month = $this->month + $months; $months = ($month - 1) % 12 + 1; if ($months < 1) { $months += 12; } $years = (int)(($month - $months) / 12); if ($this->addYears($years)) { $daysInMonth = cal_days_in_month(CAL_GREGORIAN, $months, $this->year); if ($this->day > $daysInMonth) { $months++; $this->day -= $daysInMonth; } $this->month = (int)$months; return true; } else { return false; } } function addYears($years) { if (!is_int($years)) return false; if ($years == 0) return true; $year = $this->year + $years; if ($year < 1 || $year > 9999) return false; $this->year = $year; return true; } function after($when) { if (!is_a($when, 'PHPRPC_Date')) { $when = PHPRPC_Date::parse($when); } if ($this->year < $when->year) return false; if ($this->year > $when->year) return true; if ($this->month < $when->month) return false; if ($this->month > $when->month) return true; if ($this->day < $when->day) return false; if ($this->day > $when->day) return true; if ($this->hour < $when->hour) return false; if ($this->hour > $when->hour) return true; if ($this->minute < $when->minute) return false; if ($this->minute > $when->minute) return true; if ($this->second < $when->second) return false; if ($this->second > $when->second) return true; if ($this->millisecond < $when->millisecond) return false; if ($this->millisecond > $when->millisecond) return true; return false; } function before($when) { if (!is_a($when, 'PHPRPC_Date')) { $when = new PHPRPC_Date($when); } if ($this->year < $when->year) return true; if ($this->year > $when->year) return false; if ($this->month < $when->month) return true; if ($this->month > $when->month) return false; if ($this->day < $when->day) return true; if ($this->day > $when->day) return false; if ($this->hour < $when->hour) return true; if ($this->hour > $when->hour) return false; if ($this->minute < $when->minute) return true; if ($this->minute > $when->minute) return false; if ($this->second < $when->second) return true; if ($this->second > $when->second) return false; if ($this->millisecond < $when->millisecond) return true; if ($this->millisecond > $when->millisecond) return false; return false; } function equals($when) { if (!is_a($when, 'PHPRPC_Date')) { $when = new PHPRPC_Date($when); } return (($this->year == $when->year) && ($this->month == $when->month) && ($this->day == $when->day) && ($this->hour == $when->hour) && ($this->minute == $when->minute) && ($this->second == $when->second) && ($this->millisecond == $when->millisecond)); } function set() { $num = func_num_args(); $args = func_get_args(); if ($num >= 3) { if (!PHPRPC_Date::isValidDate($args[0], $args[1], $args[2])) { return false; } $this->year = (int)$args[0]; $this->month = (int)$args[1]; $this->day = (int)$args[2]; if ($num == 3) { return true; } } if ($num >= 6) { if (!PHPRPC_Date::isValidTime($args[3], $args[4], $args[5])) { return false; } $this->hour = (int)$args[3]; $this->minute = (int)$args[4]; $this->second = (int)$args[5]; if ($num == 6) { return true; } } if (($num == 7) && ($args[6] >= 0 && $args[6] <= 999)) { $this->millisecond = (int)$args[6]; return true; } return false; } function time() { return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year); } function toString() { return sprintf('%04d-%02d-%02d %02d:%02d:%02d.%03d', $this->year, $this->month, $this->day, $this->hour, $this->minute, $this->second, $this->millisecond); } function __toString() { return $this->toString(); } function dayOfWeek() { $num = func_num_args(); if ($num == 3) { $args = func_get_args(); $y = $args[0]; $m = $args[1]; $d = $args[2]; } else { $y = $this->year; $m = $this->month; $d = $this->day; } $d += $m < 3 ? $y-- : $y - 2; return ((int)(23 * $m / 9) + $d + 4 + (int)($y / 4) - (int)($y / 100) + (int)($y / 400)) % 7; } function dayOfYear() { static $daysToMonth365 = array(0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365); static $daysToMonth366 = array(0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366); $num = func_num_args(); if ($num == 3) { $args = func_get_args(); $y = $args[0]; $m = $args[1]; $d = $args[2]; } else { $y = $this->year; $m = $this->month; $d = $this->day; } $days = PHPRPC_Date::isLeapYear($y) ? $daysToMonth365 : $daysToMonth366; return $days[$m - 1] + $d; } function now() { $date = new PHPRPC_Date(); return $date; } function today() { $date = PHPRPC_Date::now(); $date->hour = 0; $date->minute = 0; $date->second = 0; return $date; } function parse($dt) { if (is_a($dt, 'PHPRPC_Date')) { return $dt; } if (is_int($dt)) { return new PHPRPC_Date($dt); } $shortFormat = '(\d|\d{2}|\d{3}|\d{4})-([1-9]|0[1-9]|1[012])-([1-9]|0[1-9]|[12]\d|3[01])'; if (preg_match("/^$shortFormat$/", $dt, $match)) { $year = intval($match[1]); $month = intval($match[2]); $day = intval($match[3]); if (PHPRPC_Date::isValidDate($year, $month, $day)) { $date = new PHPRPC_Date(false); $date->year = $year; $date->month = $month; $date->day = $day; return $date; } else { return false; } } $longFormat = $shortFormat . ' (\d|0\d|1\d|2[0-3]):(\d|[0-5]\d):(\d|[0-5]\d)'; if (preg_match("/^$longFormat$/", $dt, $match)) { $year = intval($match[1]); $month = intval($match[2]); $day = intval($match[3]); if (PHPRPC_Date::isValidDate($year, $month, $day)) { $date = new PHPRPC_Date(false); $date->year = $year; $date->month = $month; $date->day = $day; $date->hour = intval($match[4]); $date->minute = intval($match[5]); $date->second = intval($match[6]); return $date; } else { return false; } } $fullFormat = $longFormat . '\.(\d|\d{2}|\d{3})'; if (preg_match("/^$fullFormat$/", $dt, $match)) { $year = intval($match[1]); $month = intval($match[2]); $day = intval($match[3]); if (PHPRPC_Date::isValidDate($year, $month, $day)) { $date = new PHPRPC_Date(false); $date->year = $year; $date->month = $month; $date->day = $day; $date->hour = intval($match[4]); $date->minute = intval($match[5]); $date->second = intval($match[6]); $date->millisecond = intval($match[7]); return $date; } else { return false; } } return false; } function isLeapYear($year) { return (($year % 4) == 0) ? (($year % 100) == 0) ? (($year % 400) == 0) : true : false; } function daysInMonth($year, $month) { if (($month < 1) || ($month > 12)) { return false; } return cal_days_in_month(CAL_GREGORIAN, $month, $year); } function isValidDate($year, $month, $day) { if (($year >= 1) && ($year <= 9999)) { return checkdate($month, $day, $year); } return false; } function isValidTime($hour, $minute, $second) { return !(($hour < 0) || ($hour > 23) || ($minute < 0) || ($minute > 59) || ($second < 0) || ($second > 59)); } } ?>



加载中
0
leo108
leo108
把eval改成echo就行了
leo108
leo108
回复 @来求解的 : 第一个文件的eval啊,改成echo就行了
来求解的
能说下具体操作方法吗,大哥,,我是小白
0
zhzhwcn
zhzhwcn
eykj_cn.php 少了这个文件没法解
来求解的
恩,看来是解不了了,谢谢了
zhzhwcn
zhzhwcn
回复 @来求解的 : 初步分析了一下 这个是要把加密的内容发到服务器(http://api.eykj.cn/api.php)上去解密的 如果你没有正确的key来认证的话本地解不了
来求解的
恩,文件都放上了,大哥你看能不能解
0
旧城的骁珖
旧城的骁珖
有些企业开发的程序,把一些脏代码放到自己的服务器上,然后用户程序每次执行都需要访问他们的服务器调用。
0
realanan
realanan
看协议是http的,可以抓包分析,把与http://api.eykj.cn/api.php里的所有传输数据全部抓下来,如果直接是明文的话,就可以直接拿来用了。如果是密文,那还得按照eykj_cn.php里的内容进行解密。大体思路就是这样。不过前提是你可以正常运行这个文件
来求解的
我是新手,不是很懂。。
返回顶部
顶部