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 goto imuzd; imuzd: defined("\102\x41\123\x45\120\x41\124\110") or die("\116\x6f\40\..
Decoded Output download
<?php
goto imuzd; imuzd: defined("BASEPATH") or die("No direct script access allowed"); goto hvSIr; VqnJJ: class XML_RPC_Response { public $val = 0; public $errno = 0; public $errstr = ''; public $headers = array(); public $xss_clean = TRUE; public function __construct($val, $code = 0, $fstr = '') { if ($code !== 0) { $this->errno = $code; $this->errstr = htmlspecialchars($fstr, ENT_XML1 | ENT_NOQUOTES, "UTF-8"); } elseif (!is_object($val)) { error_log("Invalid type '" . gettype($val) . "' (value: " . $val . ") passed to XML_RPC_Response. Defaulting to empty value."); $this->val = new XML_RPC_Values(); } else { $this->val = $val; } } public function faultCode() { return $this->errno; } public function faultString() { return $this->errstr; } public function value() { return $this->val; } public function prepare_response() { return "<methodResponse>\xa" . ($this->errno ? "<fault>
<value>
<struct>\xa \x9<member>\xa \x9\x9<name>faultCode</name>\xa \x9\x9 <value><int>" . $this->errno . "</int></value>
\x9 \x9</member>
\x9\x9\x9<member>\xa \x9 \x9<name>faultString</name>\xa \x9\x9\x9<value><string>" . $this->errstr . "</string></value>
\x9\x9</member>\xa\x9\x9</struct>\xa </value>\xa</fault>" : "<params>\xa<param>\xa" . $this->val->serialize_class() . "</param>
</params>") . "
</methodResponse>"; } public function decode($array = NULL) { $CI =& get_instance(); if (is_array($array)) { foreach ($array as $key => &$value) { if (is_array($value)) { $array[$key] = $this->decode($value); } elseif ($this->xss_clean) { $array[$key] = $CI->security->xss_clean($value); } } return $array; } $result = $this->xmlrpc_decoder($this->val); if (is_array($result)) { $result = $this->decode($result); } elseif ($this->xss_clean) { $result = $CI->security->xss_clean($result); } return $result; } public function xmlrpc_decoder($xmlrpc_val) { $kind = $xmlrpc_val->kindOf(); if ($kind === "scalar") { return $xmlrpc_val->scalarval(); } elseif ($kind === "array") { reset($xmlrpc_val->me); $b = current($xmlrpc_val->me); $arr = array(); for ($i = 0, $size = count($b); $i < $size; $i++) { $arr[] = $this->xmlrpc_decoder($xmlrpc_val->me["array"][$i]); } return $arr; } elseif ($kind === "struct") { reset($xmlrpc_val->me["struct"]); $arr = array(); foreach ($xmlrpc_val->me["struct"] as $key => &$value) { $arr[$key] = $this->xmlrpc_decoder($value); } return $arr; } } public function iso8601_decode($time, $utc = FALSE) { $t = 0; if (preg_match("/([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/", $time, $regs)) { $fnc = $utc === TRUE ? "gmmktime" : "mktime"; $t = $fnc($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); } return $t; } } goto aaIet; hvSIr: if (!function_exists("xml_parser_create")) { show_error("Your PHP installation does not support XML"); } goto picmi; aaIet: class XML_RPC_Message extends CI_Xmlrpc { public $payload; public $method_name; public $params = array(); public $xh = array(); public function __construct($method, $pars = FALSE) { parent::__construct(); $this->method_name = $method; if (is_array($pars) && count($pars) > 0) { for ($i = 0, $c = count($pars); $i < $c; $i++) { $this->params[] = $pars[$i]; } } } public function createPayload() { $this->payload = "<?xml version="1.0"?" . ">\xd\xa<methodCall>
\xa" . "<methodName>" . $this->method_name . "</methodName>
\xa" . "<params>
"; for ($i = 0, $c = count($this->params); $i < $c; $i++) { $p = $this->params[$i]; $this->payload .= "<param>\xd\xa" . $p->serialize_class() . "</param>\xd
"; } $this->payload .= "</params>
\xa</methodCall>
"; } public function parseResponse($fp) { $data = ''; while ($datum = fread($fp, 4096)) { $data .= $datum; } if ($this->debug === TRUE) { echo "<pre>---DATA---
" . htmlspecialchars($data) . "\xa---END DATA---
</pre>"; } if ($data === '') { error_log($this->xmlrpcstr["no_data"]); return new XML_RPC_Response(0, $this->xmlrpcerr["no_data"], $this->xmlrpcstr["no_data"]); } if (strpos($data, "HTTP") === 0 && !preg_match("/^HTTP\/[0-9\.]+ 200 /", $data)) { $errstr = substr($data, 0, strpos($data, "\xa") - 1); return new XML_RPC_Response(0, $this->xmlrpcerr["http_error"], $this->xmlrpcstr["http_error"] . " (" . $errstr . ")"); } $parser = xml_parser_create($this->xmlrpc_defencoding); $pname = (string) $parser; $this->xh[$pname] = array("isf" => 0, "ac" => '', "headers" => array(), "stack" => array(), "valuestack" => array(), "isf_reason" => 0); xml_set_object($parser, $this); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, TRUE); xml_set_element_handler($parser, "open_tag", "closing_tag"); xml_set_character_data_handler($parser, "character_data"); $lines = explode("\xd\xa", $data); while ($line = array_shift($lines)) { if (strlen($line) < 1) { break; } $this->xh[$pname]["headers"][] = $line; } $data = implode("
\xa", $lines); if (!xml_parse($parser, $data, TRUE)) { $errstr = sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($parser)), xml_get_current_line_number($parser)); $r = new XML_RPC_Response(0, $this->xmlrpcerr["invalid_return"], $this->xmlrpcstr["invalid_return"]); xml_parser_free($parser); return $r; } xml_parser_free($parser); if ($this->xh[$pname]["isf"] > 1) { if ($this->debug === TRUE) { echo "---Invalid Return---
" . $this->xh[$pname]["isf_reason"] . "---Invalid Return---\xa
"; } return new XML_RPC_Response(0, $this->xmlrpcerr["invalid_return"], $this->xmlrpcstr["invalid_return"] . " " . $this->xh[$pname]["isf_reason"]); } elseif (!is_object($this->xh[$pname]["value"])) { return new XML_RPC_Response(0, $this->xmlrpcerr["invalid_return"], $this->xmlrpcstr["invalid_return"] . " " . $this->xh[$pname]["isf_reason"]); } if ($this->debug === TRUE) { echo "<pre>"; if (count($this->xh[$pname]["headers"]) > 0) { echo "---HEADERS---
"; foreach ($this->xh[$pname]["headers"] as $header) { echo $header . "
"; } echo "---END HEADERS---
\xa"; } echo "---DATA---
" . htmlspecialchars($data) . "\xa---END DATA---
---PARSED---\xa"; var_dump($this->xh[$pname]["value"]); echo "
---END PARSED---</pre>"; } $v = $this->xh[$pname]["value"]; if ($this->xh[$pname]["isf"]) { $errno_v = $v->me["struct"]["faultCode"]; $errstr_v = $v->me["struct"]["faultString"]; $errno = $errno_v->scalarval(); if ($errno === 0) { $errno = -1; } $r = new XML_RPC_Response($v, $errno, $errstr_v->scalarval()); } else { $r = new XML_RPC_Response($v); } $r->headers = $this->xh[$pname]["headers"]; return $r; } public function open_tag($the_parser, $name) { $the_parser = (string) $the_parser; if ($this->xh[$the_parser]["isf"] > 1) { return; } if (count($this->xh[$the_parser]["stack"]) === 0) { if ($name !== "METHODRESPONSE" && $name !== "METHODCALL") { $this->xh[$the_parser]["isf"] = 2; $this->xh[$the_parser]["isf_reason"] = "Top level XML-RPC element is missing"; return; } } elseif (!in_array($this->xh[$the_parser]["stack"][0], $this->valid_parents[$name], TRUE)) { $this->xh[$the_parser]["isf"] = 2; $this->xh[$the_parser]["isf_reason"] = "XML-RPC element " . $name . " cannot be child of " . $this->xh[$the_parser]["stack"][0]; return; } switch ($name) { case "STRUCT": case "ARRAY": $cur_val = array("value" => array(), "type" => $name); array_unshift($this->xh[$the_parser]["valuestack"], $cur_val); break; case "METHODNAME": case "NAME": $this->xh[$the_parser]["ac"] = ''; break; case "FAULT": $this->xh[$the_parser]["isf"] = 1; break; case "PARAM": $this->xh[$the_parser]["value"] = NULL; break; case "VALUE": $this->xh[$the_parser]["vt"] = "value"; $this->xh[$the_parser]["ac"] = ''; $this->xh[$the_parser]["lv"] = 1; break; case "I4": case "INT": case "STRING": case "BOOLEAN": case "DOUBLE": case "DATETIME.ISO8601": case "BASE64": if ($this->xh[$the_parser]["vt"] !== "value") { $this->xh[$the_parser]["isf"] = 2; $this->xh[$the_parser]["isf_reason"] = "There is a " . $name . " element following a " . $this->xh[$the_parser]["vt"] . " element inside a single value"; return; } $this->xh[$the_parser]["ac"] = ''; break; case "MEMBER": $this->xh[$the_parser]["valuestack"][0]["name"] = ''; $this->xh[$the_parser]["value"] = NULL; break; case "DATA": case "METHODCALL": case "METHODRESPONSE": case "PARAMS": break; default: $this->xh[$the_parser]["isf"] = 2; $this->xh[$the_parser]["isf_reason"] = "Invalid XML-RPC element found: " . $name; break; } array_unshift($this->xh[$the_parser]["stack"], $name); $name === "VALUE" or $this->xh[$the_parser]["lv"] = 0; } public function closing_tag($the_parser, $name) { $the_parser = (string) $the_parser; if ($this->xh[$the_parser]["isf"] > 1) { return; } $curr_elem = array_shift($this->xh[$the_parser]["stack"]); switch ($name) { case "STRUCT": case "ARRAY": $cur_val = array_shift($this->xh[$the_parser]["valuestack"]); $this->xh[$the_parser]["value"] = isset($cur_val["values"]) ? $cur_val["values"] : array(); $this->xh[$the_parser]["vt"] = strtolower($name); break; case "NAME": $this->xh[$the_parser]["valuestack"][0]["name"] = $this->xh[$the_parser]["ac"]; break; case "BOOLEAN": case "I4": case "INT": case "STRING": case "DOUBLE": case "DATETIME.ISO8601": case "BASE64": $this->xh[$the_parser]["vt"] = strtolower($name); if ($name === "STRING") { $this->xh[$the_parser]["value"] = $this->xh[$the_parser]["ac"]; } elseif ($name === "DATETIME.ISO8601") { $this->xh[$the_parser]["vt"] = $this->xmlrpcDateTime; $this->xh[$the_parser]["value"] = $this->xh[$the_parser]["ac"]; } elseif ($name === "BASE64") { $this->xh[$the_parser]["value"] = base64_decode($this->xh[$the_parser]["ac"]); } elseif ($name === "BOOLEAN") { $this->xh[$the_parser]["value"] = (bool) $this->xh[$the_parser]["ac"]; } elseif ($name == "DOUBLE") { $this->xh[$the_parser]["value"] = preg_match("/^[+-]?[eE0-9\t \.]+$/", $this->xh[$the_parser]["ac"]) ? (double) $this->xh[$the_parser]["ac"] : "ERROR_NON_NUMERIC_FOUND"; } else { $this->xh[$the_parser]["value"] = preg_match("/^[+-]?[0-9\t ]+$/", $this->xh[$the_parser]["ac"]) ? (int) $this->xh[$the_parser]["ac"] : "ERROR_NON_NUMERIC_FOUND"; } $this->xh[$the_parser]["ac"] = ''; $this->xh[$the_parser]["lv"] = 3; break; case "VALUE": if ($this->xh[$the_parser]["vt"] == "value") { $this->xh[$the_parser]["value"] = $this->xh[$the_parser]["ac"]; $this->xh[$the_parser]["vt"] = $this->xmlrpcString; } $temp = new XML_RPC_Values($this->xh[$the_parser]["value"], $this->xh[$the_parser]["vt"]); if (count($this->xh[$the_parser]["valuestack"]) && $this->xh[$the_parser]["valuestack"][0]["type"] === "ARRAY") { $this->xh[$the_parser]["valuestack"][0]["values"][] = $temp; } else { $this->xh[$the_parser]["value"] = $temp; } break; case "MEMBER": $this->xh[$the_parser]["ac"] = ''; if ($this->xh[$the_parser]["value"]) { $this->xh[$the_parser]["valuestack"][0]["values"][$this->xh[$the_parser]["valuestack"][0]["name"]] = $this->xh[$the_parser]["value"]; } break; case "DATA": $this->xh[$the_parser]["ac"] = ''; break; case "PARAM": if ($this->xh[$the_parser]["value"]) { $this->xh[$the_parser]["params"][] = $this->xh[$the_parser]["value"]; } break; case "METHODNAME": $this->xh[$the_parser]["method"] = ltrim($this->xh[$the_parser]["ac"]); break; case "PARAMS": case "FAULT": case "METHODCALL": case "METHORESPONSE": break; default: break; } } public function character_data($the_parser, $data) { $the_parser = (string) $the_parser; if ($this->xh[$the_parser]["isf"] > 1) { return; } if ($this->xh[$the_parser]["lv"] !== 3) { if ($this->xh[$the_parser]["lv"] === 1) { $this->xh[$the_parser]["lv"] = 2; } if (!isset($this->xh[$the_parser]["ac"])) { $this->xh[$the_parser]["ac"] = ''; } $this->xh[$the_parser]["ac"] .= $data; } } public function addParam($par) { $this->params[] = $par; } public function output_parameters(array $array = array()) { $CI =& get_instance(); if (!empty($array)) { foreach ($array as $key => &$value) { if (is_array($value)) { $array[$key] = $this->output_parameters($value); } elseif ($key !== "bits" && $this->xss_clean) { $array[$key] = $CI->security->xss_clean($value); } } return $array; } $parameters = array(); for ($i = 0, $c = count($this->params); $i < $c; $i++) { $a_param = $this->decode_message($this->params[$i]); if (is_array($a_param)) { $parameters[] = $this->output_parameters($a_param); } else { $parameters[] = $this->xss_clean ? $CI->security->xss_clean($a_param) : $a_param; } } return $parameters; } public function decode_message($param) { $kind = $param->kindOf(); if ($kind === "scalar") { return $param->scalarval(); } elseif ($kind === "array") { reset($param->me); $b = current($param->me); $arr = array(); for ($i = 0, $c = count($b); $i < $c; $i++) { $arr[] = $this->decode_message($param->me["array"][$i]); } return $arr; } elseif ($kind === "struct") { reset($param->me["struct"]); $arr = array(); foreach ($param->me["struct"] as $key => &$value) { $arr[$key] = $this->decode_message($value); } return $arr; } } } goto B9avH; picmi: class CI_Xmlrpc { public $debug = FALSE; public $xmlrpcI4 = "i4"; public $xmlrpcInt = "int"; public $xmlrpcBoolean = "boolean"; public $xmlrpcDouble = "double"; public $xmlrpcString = "string"; public $xmlrpcDateTime = "dateTime.iso8601"; public $xmlrpcBase64 = "base64"; public $xmlrpcArray = "array"; public $xmlrpcStruct = "struct"; public $xmlrpcTypes = array(); public $valid_parents = array(); public $xmlrpcerr = array(); public $xmlrpcstr = array(); public $xmlrpc_defencoding = "UTF-8"; public $xmlrpcName = "XML-RPC for CodeIgniter"; public $xmlrpcVersion = "1.1"; public $xmlrpcerruser = 800; public $xmlrpcerrxml = 100; public $xmlrpc_backslash = ''; public $client; public $method; public $data; public $message = ''; public $error = ''; public $result; public $response = array(); public $xss_clean = TRUE; public function __construct($config = array()) { $this->xmlrpc_backslash = chr(92) . chr(92); $this->xmlrpcTypes = array($this->xmlrpcI4 => "1", $this->xmlrpcInt => "1", $this->xmlrpcBoolean => "1", $this->xmlrpcString => "1", $this->xmlrpcDouble => "1", $this->xmlrpcDateTime => "1", $this->xmlrpcBase64 => "1", $this->xmlrpcArray => "2", $this->xmlrpcStruct => "3"); $this->valid_parents = array("BOOLEAN" => array("VALUE"), "I4" => array("VALUE"), "INT" => array("VALUE"), "STRING" => array("VALUE"), "DOUBLE" => array("VALUE"), "DATETIME.ISO8601" => array("VALUE"), "BASE64" => array("VALUE"), "ARRAY" => array("VALUE"), "STRUCT" => array("VALUE"), "PARAM" => array("PARAMS"), "METHODNAME" => array("METHODCALL"), "PARAMS" => array("METHODCALL", "METHODRESPONSE"), "MEMBER" => array("STRUCT"), "NAME" => array("MEMBER"), "DATA" => array("ARRAY"), "FAULT" => array("METHODRESPONSE"), "VALUE" => array("MEMBER", "DATA", "PARAM", "FAULT")); $this->xmlrpcerr["unknown_method"] = "1"; $this->xmlrpcstr["unknown_method"] = "This is not a known method for this XML-RPC Server"; $this->xmlrpcerr["invalid_return"] = "2"; $this->xmlrpcstr["invalid_return"] = "The XML data received was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further."; $this->xmlrpcerr["incorrect_params"] = "3"; $this->xmlrpcstr["incorrect_params"] = "Incorrect parameters were passed to method"; $this->xmlrpcerr["introspect_unknown"] = "4"; $this->xmlrpcstr["introspect_unknown"] = "Cannot inspect signature for request: method unknown"; $this->xmlrpcerr["http_error"] = "5"; $this->xmlrpcstr["http_error"] = "Did not receive a '200 OK' response from remote server."; $this->xmlrpcerr["no_data"] = "6"; $this->xmlrpcstr["no_data"] = "No data received from server."; $this->initialize($config); log_message("info", "XML-RPC Class Initialized"); } public function initialize($config = array()) { if (count($config) > 0) { foreach ($config as $key => $val) { if (isset($this->{$key})) { $this->{$key} = $val; } } } } public function server($url, $port = 80, $proxy = FALSE, $proxy_port = 8080) { if (stripos($url, "http") !== 0) { $url = "http://" . $url; } $parts = parse_url($url); if (isset($parts["user"], $parts["pass"])) { $parts["host"] = $parts["user"] . ":" . $parts["pass"] . "@" . $parts["host"]; } $path = isset($parts["path"]) ? $parts["path"] : "/"; if (!empty($parts["query"])) { $path .= "?" . $parts["query"]; } $this->client = new XML_RPC_Client($path, $parts["host"], $port, $proxy, $proxy_port); } public function timeout($seconds = 5) { if ($this->client !== NULL && is_int($seconds)) { $this->client->timeout = $seconds; } } public function method($function) { $this->method = $function; } public function request($incoming) { if (!is_array($incoming)) { return; } $this->data = array(); foreach ($incoming as $key => $value) { $this->data[$key] = $this->values_parsing($value); } } public function set_debug($flag = TRUE) { $this->debug = $flag === TRUE; } public function values_parsing($value) { if (is_array($value) && array_key_exists(0, $value)) { if (!isset($value[1], $this->xmlrpcTypes[$value[1]])) { $temp = new XML_RPC_Values($value[0], is_array($value[0]) ? "array" : "string"); } else { if (is_array($value[0]) && ($value[1] === "struct" or $value[1] === "array")) { foreach (array_keys($value[0]) as $k) { $value[0][$k] = $this->values_parsing($value[0][$k]); } } $temp = new XML_RPC_Values($value[0], $value[1]); } } else { $temp = new XML_RPC_Values($value, "string"); } return $temp; } public function send_request() { $this->message = new XML_RPC_Message($this->method, $this->data); $this->message->debug = $this->debug; if (!($this->result = $this->client->send($this->message)) or !is_object($this->result->val)) { $this->error = $this->result->errstr; return FALSE; } $this->response = $this->result->decode(); return TRUE; } public function display_error() { return $this->error; } public function display_response() { return $this->response; } public function send_error_message($number, $message) { return new XML_RPC_Response(0, $number, $message); } public function send_response($response) { return new XML_RPC_Response($this->values_parsing($response)); } } goto txsa3; txsa3: class XML_RPC_Client extends CI_Xmlrpc { public $path = ''; public $server = ''; public $port = 80; public $username; public $password; public $proxy = FALSE; public $proxy_port = 8080; public $errno = ''; public $errstring = ''; public $timeout = 5; public $no_multicall = FALSE; public function __construct($path, $server, $port = 80, $proxy = FALSE, $proxy_port = 8080) { parent::__construct(); $url = parse_url("http://" . $server); if (isset($url["user"], $url["pass"])) { $this->username = $url["user"]; $this->password = $url["pass"]; } $this->port = $port; $this->server = $url["host"]; $this->path = $path; $this->proxy = $proxy; $this->proxy_port = $proxy_port; } public function send($msg) { if (is_array($msg)) { return new XML_RPC_Response(0, $this->xmlrpcerr["multicall_recursion"], $this->xmlrpcstr["multicall_recursion"]); } return $this->sendPayload($msg); } public function sendPayload($msg) { if ($this->proxy === FALSE) { $server = $this->server; $port = $this->port; } else { $server = $this->proxy; $port = $this->proxy_port; } $fp = @fsockopen($server, $port, $this->errno, $this->errstring, $this->timeout); if (!is_resource($fp)) { error_log($this->xmlrpcstr["http_error"]); return new XML_RPC_Response(0, $this->xmlrpcerr["http_error"], $this->xmlrpcstr["http_error"]); } if (empty($msg->payload)) { $msg->createPayload(); } $r = "
"; $op = "POST " . $this->path . " HTTP/1.0" . $r . "Host: " . $this->server . $r . "Content-Type: text/xml" . $r . (isset($this->username, $this->password) ? "Authorization: Basic " . base64_encode($this->username . ":" . $this->password) . $r : '') . "User-Agent: " . $this->xmlrpcName . $r . "Content-Length: " . strlen($msg->payload) . $r . $r . $msg->payload; stream_set_timeout($fp, $this->timeout); for ($written = $timestamp = 0, $length = strlen($op); $written < $length; $written += $result) { if (($result = fwrite($fp, substr($op, $written))) === FALSE) { break; } elseif ($result === 0) { if ($timestamp === 0) { $timestamp = time(); } elseif ($timestamp < time() - $this->timeout) { $result = FALSE; break; } } else { $timestamp = 0; } } if ($result === FALSE) { error_log($this->xmlrpcstr["http_error"]); return new XML_RPC_Response(0, $this->xmlrpcerr["http_error"], $this->xmlrpcstr["http_error"]); } $resp = $msg->parseResponse($fp); fclose($fp); return $resp; } } goto VqnJJ; B9avH: class XML_RPC_Values extends CI_Xmlrpc { public $me = array(); public $mytype = 0; public function __construct($val = -1, $type = '') { parent::__construct(); if ($val !== -1 or $type !== '') { $type = $type === '' ? "string" : $type; if ($this->xmlrpcTypes[$type] == 1) { $this->addScalar($val, $type); } elseif ($this->xmlrpcTypes[$type] == 2) { $this->addArray($val); } elseif ($this->xmlrpcTypes[$type] == 3) { $this->addStruct($val); } } } public function addScalar($val, $type = "string") { $typeof = $this->xmlrpcTypes[$type]; if ($this->mytype === 1) { echo "<strong>XML_RPC_Values</strong>: scalar can have only one value<br />"; return 0; } if ($typeof != 1) { echo "<strong>XML_RPC_Values</strong>: not a scalar type ({$typeof})<br />"; return 0; } if ($type === $this->xmlrpcBoolean) { $val = (int) (strcasecmp($val, "true") === 0 or $val === 1 or $val === TRUE && strcasecmp($val, "false")); } if ($this->mytype === 2) { $ar = $this->me["array"]; $ar[] = new XML_RPC_Values($val, $type); $this->me["array"] = $ar; } else { $this->me[$type] = $val; $this->mytype = $typeof; } return 1; } public function addArray($vals) { if ($this->mytype !== 0) { echo "<strong>XML_RPC_Values</strong>: already initialized as a [" . $this->kindOf() . "]<br />"; return 0; } $this->mytype = $this->xmlrpcTypes["array"]; $this->me["array"] = $vals; return 1; } public function addStruct($vals) { if ($this->mytype !== 0) { echo "<strong>XML_RPC_Values</strong>: already initialized as a [" . $this->kindOf() . "]<br />"; return 0; } $this->mytype = $this->xmlrpcTypes["struct"]; $this->me["struct"] = $vals; return 1; } public function kindOf() { switch ($this->mytype) { case 3: return "struct"; case 2: return "array"; case 1: return "scalar"; default: return "undef"; } } public function serializedata($typ, $val) { $rs = ''; switch ($this->xmlrpcTypes[$typ]) { case 3: $rs .= "<struct>\xa"; reset($val); foreach ($val as $key2 => &$val2) { $rs .= "<member>
<name>{$key2}</name>\xa" . $this->serializeval($val2) . "</member>
"; } $rs .= "</struct>"; break; case 2: $rs .= "<array>\xa<data>\xa"; for ($i = 0, $c = count($val); $i < $c; $i++) { $rs .= $this->serializeval($val[$i]); } $rs .= "</data>
</array>\xa"; break; case 1: switch ($typ) { case $this->xmlrpcBase64: $rs .= "<" . $typ . ">" . base64_encode((string) $val) . "</" . $typ . ">\xa"; break; case $this->xmlrpcBoolean: $rs .= "<" . $typ . ">" . ((bool) $val ? "1" : "0") . "</" . $typ . ">\xa"; break; case $this->xmlrpcString: $rs .= "<" . $typ . ">" . htmlspecialchars((string) $val) . "</" . $typ . ">\xa"; break; default: $rs .= "<" . $typ . ">" . $val . "</" . $typ . ">\xa"; break; } default: break; } return $rs; } public function serialize_class() { return $this->serializeval($this); } public function serializeval($o) { $array = $o->me; list($value, $type) = array(reset($array), key($array)); return "<value>
" . $this->serializedata($type, $value) . "</value>
"; } public function scalarval() { return reset($this->me); } public function iso8601_encode($time, $utc = FALSE) { return $utc ? date("Ymd\TH:i:s", $time) : gmdate("Ymd\TH:i:s", $time); } } ?>
Did this file decode correctly?
Original Code
<?php
goto imuzd; imuzd: defined("\102\x41\123\x45\120\x41\124\110") or die("\116\x6f\40\144\x69\x72\x65\x63\x74\40\163\x63\x72\x69\x70\x74\x20\x61\143\143\145\163\x73\40\141\x6c\154\x6f\167\x65\x64"); goto hvSIr; VqnJJ: class XML_RPC_Response { public $val = 0; public $errno = 0; public $errstr = ''; public $headers = array(); public $xss_clean = TRUE; public function __construct($val, $code = 0, $fstr = '') { if ($code !== 0) { $this->errno = $code; $this->errstr = htmlspecialchars($fstr, ENT_XML1 | ENT_NOQUOTES, "\125\124\106\55\x38"); } elseif (!is_object($val)) { error_log("\111\156\166\x61\154\x69\x64\40\x74\x79\x70\145\x20\47" . gettype($val) . "\x27\x20\x28\x76\141\x6c\165\145\72\40" . $val . "\x29\x20\160\x61\x73\x73\145\144\40\164\x6f\x20\130\115\x4c\x5f\122\x50\103\137\x52\145\163\x70\157\156\163\x65\56\40\x44\145\x66\141\x75\154\164\x69\156\x67\40\x74\157\40\x65\x6d\160\164\x79\x20\x76\141\x6c\165\145\56"); $this->val = new XML_RPC_Values(); } else { $this->val = $val; } } public function faultCode() { return $this->errno; } public function faultString() { return $this->errstr; } public function value() { return $this->val; } public function prepare_response() { return "\x3c\155\x65\164\x68\x6f\x64\x52\145\163\160\x6f\156\x73\145\76\xa" . ($this->errno ? "\x3c\146\141\165\x6c\164\x3e\12\11\x3c\166\x61\x6c\165\x65\x3e\12\11\11\x3c\x73\x74\162\165\x63\164\76\xa\11\11\x9\x3c\155\145\x6d\x62\x65\162\x3e\xa\11\11\x9\x9\74\x6e\141\x6d\145\x3e\146\141\x75\x6c\164\103\x6f\144\x65\74\x2f\156\141\x6d\x65\x3e\xa\11\x9\x9\11\x3c\166\x61\154\x75\x65\76\74\151\156\164\x3e" . $this->errno . "\x3c\57\x69\156\x74\x3e\74\57\x76\x61\154\x75\x65\x3e\12\x9\11\x9\74\x2f\x6d\x65\155\142\145\162\76\12\x9\x9\x9\x3c\155\145\155\x62\x65\x72\x3e\xa\11\x9\11\x9\74\x6e\x61\155\x65\76\146\x61\x75\154\x74\x53\164\x72\x69\156\147\x3c\x2f\x6e\x61\155\x65\x3e\xa\11\x9\x9\x9\x3c\x76\x61\154\165\145\76\74\x73\x74\x72\151\156\x67\76" . $this->errstr . "\74\x2f\163\x74\162\x69\x6e\x67\76\x3c\57\x76\x61\154\x75\x65\76\12\11\x9\x9\x3c\57\155\145\x6d\142\x65\162\76\xa\x9\x9\74\x2f\163\164\x72\x75\x63\x74\x3e\xa\11\x3c\x2f\166\x61\154\165\x65\76\xa\x3c\x2f\x66\x61\x75\x6c\164\x3e" : "\74\x70\141\x72\141\x6d\163\76\xa\x3c\x70\141\162\141\155\x3e\xa" . $this->val->serialize_class() . "\74\x2f\x70\141\162\141\x6d\x3e\12\x3c\57\160\x61\162\x61\155\x73\76") . "\12\x3c\x2f\155\x65\164\150\157\144\122\145\163\160\157\156\163\145\76"; } public function decode($array = NULL) { $CI =& get_instance(); if (is_array($array)) { foreach ($array as $key => &$value) { if (is_array($value)) { $array[$key] = $this->decode($value); } elseif ($this->xss_clean) { $array[$key] = $CI->security->xss_clean($value); } } return $array; } $result = $this->xmlrpc_decoder($this->val); if (is_array($result)) { $result = $this->decode($result); } elseif ($this->xss_clean) { $result = $CI->security->xss_clean($result); } return $result; } public function xmlrpc_decoder($xmlrpc_val) { $kind = $xmlrpc_val->kindOf(); if ($kind === "\x73\x63\x61\154\141\x72") { return $xmlrpc_val->scalarval(); } elseif ($kind === "\141\x72\x72\141\x79") { reset($xmlrpc_val->me); $b = current($xmlrpc_val->me); $arr = array(); for ($i = 0, $size = count($b); $i < $size; $i++) { $arr[] = $this->xmlrpc_decoder($xmlrpc_val->me["\x61\162\x72\x61\x79"][$i]); } return $arr; } elseif ($kind === "\x73\x74\162\165\143\164") { reset($xmlrpc_val->me["\163\x74\162\x75\143\x74"]); $arr = array(); foreach ($xmlrpc_val->me["\x73\164\x72\165\x63\164"] as $key => &$value) { $arr[$key] = $this->xmlrpc_decoder($value); } return $arr; } } public function iso8601_decode($time, $utc = FALSE) { $t = 0; if (preg_match("\x2f\50\x5b\60\55\x39\x5d\x7b\64\175\51\x28\133\60\55\71\x5d\x7b\x32\x7d\x29\x28\133\60\55\x39\135\173\x32\175\51\x54\x28\133\60\x2d\x39\135\x7b\x32\175\x29\72\50\x5b\x30\55\x39\135\173\62\175\x29\x3a\x28\133\60\55\71\135\x7b\x32\x7d\51\x2f", $time, $regs)) { $fnc = $utc === TRUE ? "\x67\x6d\155\153\164\x69\x6d\x65" : "\x6d\x6b\x74\x69\155\x65"; $t = $fnc($regs[4], $regs[5], $regs[6], $regs[2], $regs[3], $regs[1]); } return $t; } } goto aaIet; hvSIr: if (!function_exists("\x78\155\154\x5f\160\141\x72\x73\145\162\x5f\x63\x72\x65\x61\x74\145")) { show_error("\131\x6f\x75\x72\x20\x50\110\120\40\x69\x6e\163\x74\x61\154\x6c\x61\x74\151\157\x6e\x20\x64\x6f\145\163\x20\x6e\x6f\164\40\x73\165\x70\160\157\162\164\40\130\x4d\x4c"); } goto picmi; aaIet: class XML_RPC_Message extends CI_Xmlrpc { public $payload; public $method_name; public $params = array(); public $xh = array(); public function __construct($method, $pars = FALSE) { parent::__construct(); $this->method_name = $method; if (is_array($pars) && count($pars) > 0) { for ($i = 0, $c = count($pars); $i < $c; $i++) { $this->params[] = $pars[$i]; } } } public function createPayload() { $this->payload = "\x3c\77\170\x6d\154\x20\166\x65\162\163\151\x6f\x6e\x3d\42\x31\56\60\x22\77" . "\76\xd\xa\x3c\155\145\164\150\x6f\x64\103\x61\154\x6c\76\15\xa" . "\74\155\145\x74\x68\157\x64\x4e\x61\x6d\x65\76" . $this->method_name . "\x3c\x2f\x6d\x65\x74\150\157\x64\x4e\x61\x6d\145\76\15\xa" . "\74\x70\x61\162\141\x6d\x73\76\15\12"; for ($i = 0, $c = count($this->params); $i < $c; $i++) { $p = $this->params[$i]; $this->payload .= "\74\x70\x61\162\141\x6d\76\xd\xa" . $p->serialize_class() . "\x3c\57\160\x61\162\141\155\76\xd\12"; } $this->payload .= "\x3c\x2f\160\x61\162\141\x6d\163\76\15\xa\x3c\57\155\x65\x74\150\157\x64\x43\141\x6c\x6c\76\15\12"; } public function parseResponse($fp) { $data = ''; while ($datum = fread($fp, 4096)) { $data .= $datum; } if ($this->debug === TRUE) { echo "\74\160\162\145\76\55\55\x2d\x44\x41\124\x41\55\x2d\55\12" . htmlspecialchars($data) . "\xa\x2d\55\55\x45\116\104\40\x44\x41\x54\x41\55\x2d\55\12\12\74\x2f\x70\162\145\x3e"; } if ($data === '') { error_log($this->xmlrpcstr["\x6e\x6f\137\144\141\x74\x61"]); return new XML_RPC_Response(0, $this->xmlrpcerr["\x6e\x6f\137\x64\x61\164\x61"], $this->xmlrpcstr["\x6e\x6f\137\x64\x61\x74\141"]); } if (strpos($data, "\x48\x54\x54\x50") === 0 && !preg_match("\57\x5e\110\x54\x54\120\x5c\x2f\x5b\x30\x2d\71\134\x2e\x5d\x2b\40\x32\x30\60\40\57", $data)) { $errstr = substr($data, 0, strpos($data, "\xa") - 1); return new XML_RPC_Response(0, $this->xmlrpcerr["\x68\x74\164\160\137\145\162\162\157\x72"], $this->xmlrpcstr["\150\x74\x74\160\x5f\x65\x72\x72\157\162"] . "\x20\50" . $errstr . "\x29"); } $parser = xml_parser_create($this->xmlrpc_defencoding); $pname = (string) $parser; $this->xh[$pname] = array("\151\x73\x66" => 0, "\141\x63" => '', "\x68\145\x61\144\x65\162\163" => array(), "\163\164\x61\143\153" => array(), "\x76\141\154\165\x65\x73\164\x61\143\153" => array(), "\151\x73\146\x5f\x72\145\x61\163\x6f\x6e" => 0); xml_set_object($parser, $this); xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, TRUE); xml_set_element_handler($parser, "\157\x70\145\x6e\137\x74\141\147", "\x63\x6c\x6f\163\x69\156\147\137\x74\x61\x67"); xml_set_character_data_handler($parser, "\143\150\x61\162\x61\143\x74\145\162\137\144\141\164\141"); $lines = explode("\xd\xa", $data); while ($line = array_shift($lines)) { if (strlen($line) < 1) { break; } $this->xh[$pname]["\150\145\141\144\x65\162\x73"][] = $line; } $data = implode("\15\xa", $lines); if (!xml_parse($parser, $data, TRUE)) { $errstr = sprintf("\130\x4d\114\40\x65\162\162\157\x72\72\x20\45\163\x20\141\x74\x20\154\151\156\145\40\45\x64", xml_error_string(xml_get_error_code($parser)), xml_get_current_line_number($parser)); $r = new XML_RPC_Response(0, $this->xmlrpcerr["\x69\156\166\141\x6c\151\144\x5f\162\145\x74\165\x72\156"], $this->xmlrpcstr["\151\x6e\166\141\x6c\151\x64\x5f\162\145\x74\x75\162\156"]); xml_parser_free($parser); return $r; } xml_parser_free($parser); if ($this->xh[$pname]["\x69\163\146"] > 1) { if ($this->debug === TRUE) { echo "\55\x2d\x2d\111\x6e\x76\x61\154\x69\x64\40\x52\x65\x74\x75\x72\156\55\x2d\55\12" . $this->xh[$pname]["\x69\x73\x66\x5f\162\x65\141\x73\x6f\x6e"] . "\55\55\55\x49\x6e\x76\x61\154\x69\144\x20\x52\x65\x74\x75\162\156\x2d\55\x2d\xa\12"; } return new XML_RPC_Response(0, $this->xmlrpcerr["\x69\156\166\x61\154\x69\144\137\162\145\164\165\162\156"], $this->xmlrpcstr["\151\x6e\x76\141\x6c\151\144\137\x72\145\x74\x75\162\156"] . "\40" . $this->xh[$pname]["\x69\163\146\137\162\145\141\x73\x6f\x6e"]); } elseif (!is_object($this->xh[$pname]["\166\x61\x6c\x75\x65"])) { return new XML_RPC_Response(0, $this->xmlrpcerr["\151\x6e\166\141\154\151\144\x5f\162\x65\x74\x75\162\156"], $this->xmlrpcstr["\151\156\166\141\x6c\x69\144\137\x72\145\164\x75\x72\x6e"] . "\x20" . $this->xh[$pname]["\x69\163\146\137\x72\x65\141\163\157\156"]); } if ($this->debug === TRUE) { echo "\74\160\x72\x65\x3e"; if (count($this->xh[$pname]["\x68\145\x61\x64\x65\x72\163"]) > 0) { echo "\x2d\x2d\55\110\105\x41\104\105\x52\x53\x2d\x2d\55\12"; foreach ($this->xh[$pname]["\150\145\141\x64\145\x72\163"] as $header) { echo $header . "\12"; } echo "\x2d\x2d\55\105\x4e\x44\40\110\105\101\104\x45\x52\123\55\x2d\55\12\xa"; } echo "\55\x2d\x2d\x44\x41\x54\101\55\55\x2d\12" . htmlspecialchars($data) . "\xa\55\x2d\x2d\x45\116\x44\x20\104\x41\x54\x41\55\x2d\55\12\12\55\55\55\120\101\x52\123\x45\x44\55\x2d\55\xa"; var_dump($this->xh[$pname]["\166\x61\154\165\x65"]); echo "\12\x2d\x2d\55\x45\116\104\40\x50\101\122\123\x45\x44\55\55\x2d\x3c\57\x70\x72\145\76"; } $v = $this->xh[$pname]["\x76\x61\154\165\145"]; if ($this->xh[$pname]["\151\163\x66"]) { $errno_v = $v->me["\x73\164\162\165\x63\x74"]["\146\141\165\154\x74\x43\x6f\x64\x65"]; $errstr_v = $v->me["\x73\164\x72\165\143\164"]["\146\x61\x75\154\x74\123\x74\x72\x69\156\147"]; $errno = $errno_v->scalarval(); if ($errno === 0) { $errno = -1; } $r = new XML_RPC_Response($v, $errno, $errstr_v->scalarval()); } else { $r = new XML_RPC_Response($v); } $r->headers = $this->xh[$pname]["\150\x65\141\144\x65\162\x73"]; return $r; } public function open_tag($the_parser, $name) { $the_parser = (string) $the_parser; if ($this->xh[$the_parser]["\x69\x73\146"] > 1) { return; } if (count($this->xh[$the_parser]["\163\164\141\143\x6b"]) === 0) { if ($name !== "\x4d\105\124\x48\117\104\122\105\x53\120\117\116\123\105" && $name !== "\115\105\124\x48\117\104\103\x41\114\114") { $this->xh[$the_parser]["\151\163\x66"] = 2; $this->xh[$the_parser]["\x69\163\x66\x5f\x72\x65\x61\163\157\x6e"] = "\124\x6f\x70\40\154\x65\166\x65\154\x20\130\115\x4c\55\x52\x50\103\x20\145\154\145\x6d\x65\156\x74\x20\x69\163\40\155\151\163\163\151\156\x67"; return; } } elseif (!in_array($this->xh[$the_parser]["\163\164\141\x63\153"][0], $this->valid_parents[$name], TRUE)) { $this->xh[$the_parser]["\151\163\x66"] = 2; $this->xh[$the_parser]["\x69\x73\146\137\162\x65\141\x73\x6f\x6e"] = "\x58\115\x4c\x2d\x52\x50\103\40\x65\154\x65\155\x65\x6e\164\40" . $name . "\x20\143\141\156\x6e\157\164\x20\142\x65\40\x63\x68\151\x6c\x64\x20\x6f\x66\40" . $this->xh[$the_parser]["\x73\164\x61\143\x6b"][0]; return; } switch ($name) { case "\x53\x54\x52\x55\103\124": case "\x41\x52\x52\101\131": $cur_val = array("\166\x61\154\165\x65" => array(), "\164\x79\x70\x65" => $name); array_unshift($this->xh[$the_parser]["\x76\x61\154\165\x65\163\164\141\x63\x6b"], $cur_val); break; case "\115\x45\x54\110\x4f\x44\116\101\x4d\105": case "\x4e\101\115\x45": $this->xh[$the_parser]["\x61\x63"] = ''; break; case "\x46\101\x55\114\x54": $this->xh[$the_parser]["\151\163\x66"] = 1; break; case "\x50\x41\x52\101\x4d": $this->xh[$the_parser]["\166\x61\154\x75\x65"] = NULL; break; case "\x56\x41\114\125\105": $this->xh[$the_parser]["\x76\x74"] = "\x76\x61\154\x75\145"; $this->xh[$the_parser]["\141\143"] = ''; $this->xh[$the_parser]["\154\x76"] = 1; break; case "\x49\x34": case "\x49\116\124": case "\123\x54\x52\x49\x4e\107": case "\102\x4f\x4f\x4c\105\101\116": case "\104\x4f\125\102\114\105": case "\104\101\124\105\124\111\115\105\x2e\111\x53\117\x38\x36\60\61": case "\102\101\123\105\x36\64": if ($this->xh[$the_parser]["\166\x74"] !== "\x76\141\154\165\x65") { $this->xh[$the_parser]["\151\163\146"] = 2; $this->xh[$the_parser]["\151\163\x66\x5f\x72\145\141\163\x6f\156"] = "\x54\x68\145\162\145\40\x69\x73\x20\141\40" . $name . "\x20\145\x6c\145\155\x65\156\164\x20\x66\157\154\154\x6f\167\151\x6e\x67\x20\141\x20" . $this->xh[$the_parser]["\x76\x74"] . "\x20\145\154\145\155\x65\156\x74\40\x69\156\x73\151\x64\145\40\141\x20\x73\151\x6e\x67\154\x65\40\x76\x61\154\165\145"; return; } $this->xh[$the_parser]["\141\x63"] = ''; break; case "\115\x45\x4d\x42\105\x52": $this->xh[$the_parser]["\166\141\x6c\165\x65\x73\x74\141\x63\153"][0]["\156\x61\x6d\145"] = ''; $this->xh[$the_parser]["\x76\141\154\x75\x65"] = NULL; break; case "\x44\x41\x54\101": case "\x4d\x45\124\110\x4f\x44\x43\x41\x4c\114": case "\x4d\x45\124\x48\117\x44\x52\105\123\x50\x4f\x4e\123\x45": case "\x50\101\122\101\x4d\123": break; default: $this->xh[$the_parser]["\x69\163\x66"] = 2; $this->xh[$the_parser]["\151\163\146\137\162\145\x61\163\x6f\156"] = "\111\156\166\x61\x6c\x69\x64\x20\x58\x4d\114\x2d\122\120\103\40\145\x6c\145\155\x65\156\x74\40\x66\157\165\156\x64\x3a\40" . $name; break; } array_unshift($this->xh[$the_parser]["\x73\x74\141\143\x6b"], $name); $name === "\126\x41\x4c\125\105" or $this->xh[$the_parser]["\154\x76"] = 0; } public function closing_tag($the_parser, $name) { $the_parser = (string) $the_parser; if ($this->xh[$the_parser]["\x69\163\x66"] > 1) { return; } $curr_elem = array_shift($this->xh[$the_parser]["\x73\164\x61\x63\153"]); switch ($name) { case "\123\x54\122\x55\103\x54": case "\101\122\x52\101\x59": $cur_val = array_shift($this->xh[$the_parser]["\x76\x61\x6c\x75\x65\163\164\141\143\x6b"]); $this->xh[$the_parser]["\x76\x61\154\165\145"] = isset($cur_val["\x76\x61\x6c\165\145\163"]) ? $cur_val["\166\141\154\165\x65\x73"] : array(); $this->xh[$the_parser]["\x76\164"] = strtolower($name); break; case "\x4e\101\x4d\x45": $this->xh[$the_parser]["\x76\141\x6c\x75\145\163\x74\141\143\x6b"][0]["\x6e\141\155\145"] = $this->xh[$the_parser]["\141\x63"]; break; case "\102\117\x4f\x4c\105\101\116": case "\111\x34": case "\111\x4e\x54": case "\x53\x54\122\x49\116\x47": case "\104\x4f\x55\x42\114\x45": case "\x44\x41\x54\x45\x54\x49\x4d\x45\x2e\x49\x53\117\70\x36\x30\x31": case "\x42\101\123\105\x36\x34": $this->xh[$the_parser]["\x76\164"] = strtolower($name); if ($name === "\x53\x54\x52\x49\116\x47") { $this->xh[$the_parser]["\166\x61\x6c\x75\x65"] = $this->xh[$the_parser]["\x61\143"]; } elseif ($name === "\x44\101\x54\x45\x54\111\x4d\x45\56\111\123\117\70\x36\60\x31") { $this->xh[$the_parser]["\x76\164"] = $this->xmlrpcDateTime; $this->xh[$the_parser]["\166\141\154\x75\145"] = $this->xh[$the_parser]["\x61\143"]; } elseif ($name === "\x42\101\123\105\x36\64") { $this->xh[$the_parser]["\x76\x61\x6c\x75\x65"] = base64_decode($this->xh[$the_parser]["\141\x63"]); } elseif ($name === "\102\117\117\x4c\x45\101\116") { $this->xh[$the_parser]["\x76\x61\154\x75\x65"] = (bool) $this->xh[$the_parser]["\x61\143"]; } elseif ($name == "\104\117\125\102\x4c\105") { $this->xh[$the_parser]["\166\141\154\165\x65"] = preg_match("\57\x5e\133\53\55\x5d\x3f\133\145\105\60\x2d\71\x5c\164\40\x5c\56\x5d\x2b\44\x2f", $this->xh[$the_parser]["\x61\x63"]) ? (double) $this->xh[$the_parser]["\x61\x63"] : "\x45\x52\122\x4f\122\137\x4e\x4f\116\x5f\116\x55\115\105\x52\111\103\137\106\117\125\x4e\104"; } else { $this->xh[$the_parser]["\x76\141\154\x75\x65"] = preg_match("\x2f\x5e\x5b\x2b\55\x5d\77\133\x30\55\71\x5c\164\x20\x5d\53\44\x2f", $this->xh[$the_parser]["\141\x63"]) ? (int) $this->xh[$the_parser]["\141\x63"] : "\x45\122\x52\117\x52\x5f\x4e\117\x4e\137\116\125\115\x45\122\x49\x43\137\106\117\x55\x4e\x44"; } $this->xh[$the_parser]["\x61\143"] = ''; $this->xh[$the_parser]["\x6c\x76"] = 3; break; case "\126\101\x4c\x55\x45": if ($this->xh[$the_parser]["\x76\x74"] == "\x76\x61\x6c\165\145") { $this->xh[$the_parser]["\166\x61\x6c\165\x65"] = $this->xh[$the_parser]["\141\x63"]; $this->xh[$the_parser]["\166\164"] = $this->xmlrpcString; } $temp = new XML_RPC_Values($this->xh[$the_parser]["\x76\141\x6c\165\x65"], $this->xh[$the_parser]["\166\x74"]); if (count($this->xh[$the_parser]["\166\141\154\165\145\x73\164\141\x63\x6b"]) && $this->xh[$the_parser]["\166\x61\154\165\x65\x73\164\141\x63\x6b"][0]["\164\x79\160\x65"] === "\101\x52\122\101\x59") { $this->xh[$the_parser]["\x76\141\154\165\x65\x73\x74\x61\143\x6b"][0]["\x76\x61\x6c\165\x65\x73"][] = $temp; } else { $this->xh[$the_parser]["\166\x61\154\x75\x65"] = $temp; } break; case "\115\x45\x4d\x42\x45\x52": $this->xh[$the_parser]["\x61\x63"] = ''; if ($this->xh[$the_parser]["\166\x61\x6c\165\145"]) { $this->xh[$the_parser]["\x76\x61\x6c\x75\x65\x73\x74\x61\143\x6b"][0]["\x76\141\x6c\165\x65\163"][$this->xh[$the_parser]["\166\x61\x6c\x75\x65\163\164\x61\143\x6b"][0]["\156\x61\155\x65"]] = $this->xh[$the_parser]["\166\x61\154\x75\145"]; } break; case "\104\101\124\101": $this->xh[$the_parser]["\141\x63"] = ''; break; case "\x50\x41\122\101\115": if ($this->xh[$the_parser]["\166\x61\x6c\x75\x65"]) { $this->xh[$the_parser]["\x70\x61\162\141\155\163"][] = $this->xh[$the_parser]["\x76\x61\154\165\145"]; } break; case "\115\x45\124\110\x4f\104\116\101\115\x45": $this->xh[$the_parser]["\155\145\x74\x68\157\144"] = ltrim($this->xh[$the_parser]["\x61\143"]); break; case "\x50\101\122\101\115\123": case "\x46\x41\125\x4c\124": case "\x4d\105\124\x48\x4f\x44\103\101\x4c\114": case "\x4d\x45\x54\110\117\122\105\123\120\117\116\123\x45": break; default: break; } } public function character_data($the_parser, $data) { $the_parser = (string) $the_parser; if ($this->xh[$the_parser]["\x69\163\146"] > 1) { return; } if ($this->xh[$the_parser]["\x6c\166"] !== 3) { if ($this->xh[$the_parser]["\154\166"] === 1) { $this->xh[$the_parser]["\x6c\x76"] = 2; } if (!isset($this->xh[$the_parser]["\141\x63"])) { $this->xh[$the_parser]["\141\x63"] = ''; } $this->xh[$the_parser]["\x61\x63"] .= $data; } } public function addParam($par) { $this->params[] = $par; } public function output_parameters(array $array = array()) { $CI =& get_instance(); if (!empty($array)) { foreach ($array as $key => &$value) { if (is_array($value)) { $array[$key] = $this->output_parameters($value); } elseif ($key !== "\142\151\164\x73" && $this->xss_clean) { $array[$key] = $CI->security->xss_clean($value); } } return $array; } $parameters = array(); for ($i = 0, $c = count($this->params); $i < $c; $i++) { $a_param = $this->decode_message($this->params[$i]); if (is_array($a_param)) { $parameters[] = $this->output_parameters($a_param); } else { $parameters[] = $this->xss_clean ? $CI->security->xss_clean($a_param) : $a_param; } } return $parameters; } public function decode_message($param) { $kind = $param->kindOf(); if ($kind === "\163\143\141\154\x61\x72") { return $param->scalarval(); } elseif ($kind === "\x61\162\162\141\x79") { reset($param->me); $b = current($param->me); $arr = array(); for ($i = 0, $c = count($b); $i < $c; $i++) { $arr[] = $this->decode_message($param->me["\x61\x72\162\141\171"][$i]); } return $arr; } elseif ($kind === "\163\x74\x72\x75\x63\x74") { reset($param->me["\x73\x74\x72\165\143\164"]); $arr = array(); foreach ($param->me["\163\164\162\165\143\x74"] as $key => &$value) { $arr[$key] = $this->decode_message($value); } return $arr; } } } goto B9avH; picmi: class CI_Xmlrpc { public $debug = FALSE; public $xmlrpcI4 = "\151\x34"; public $xmlrpcInt = "\x69\156\164"; public $xmlrpcBoolean = "\x62\157\x6f\154\x65\141\156"; public $xmlrpcDouble = "\144\x6f\165\142\154\145"; public $xmlrpcString = "\163\164\x72\x69\156\x67"; public $xmlrpcDateTime = "\144\141\164\x65\124\x69\x6d\x65\56\x69\163\157\70\x36\60\61"; public $xmlrpcBase64 = "\142\141\x73\145\x36\x34"; public $xmlrpcArray = "\x61\162\x72\141\171"; public $xmlrpcStruct = "\163\164\x72\165\143\164"; public $xmlrpcTypes = array(); public $valid_parents = array(); public $xmlrpcerr = array(); public $xmlrpcstr = array(); public $xmlrpc_defencoding = "\125\124\x46\55\x38"; public $xmlrpcName = "\x58\115\x4c\55\122\120\103\40\x66\157\162\x20\x43\x6f\144\x65\x49\147\x6e\151\x74\x65\162"; public $xmlrpcVersion = "\x31\x2e\61"; public $xmlrpcerruser = 800; public $xmlrpcerrxml = 100; public $xmlrpc_backslash = ''; public $client; public $method; public $data; public $message = ''; public $error = ''; public $result; public $response = array(); public $xss_clean = TRUE; public function __construct($config = array()) { $this->xmlrpc_backslash = chr(92) . chr(92); $this->xmlrpcTypes = array($this->xmlrpcI4 => "\61", $this->xmlrpcInt => "\61", $this->xmlrpcBoolean => "\61", $this->xmlrpcString => "\x31", $this->xmlrpcDouble => "\61", $this->xmlrpcDateTime => "\61", $this->xmlrpcBase64 => "\x31", $this->xmlrpcArray => "\x32", $this->xmlrpcStruct => "\x33"); $this->valid_parents = array("\x42\117\117\114\x45\101\x4e" => array("\126\x41\x4c\125\x45"), "\111\64" => array("\126\101\114\x55\x45"), "\x49\x4e\x54" => array("\x56\101\x4c\125\x45"), "\123\x54\x52\111\116\x47" => array("\x56\x41\114\125\105"), "\104\117\125\102\114\105" => array("\x56\x41\114\x55\105"), "\x44\x41\124\105\124\111\115\105\x2e\x49\123\x4f\70\x36\60\x31" => array("\126\101\114\x55\105"), "\102\101\123\x45\66\x34" => array("\x56\101\x4c\125\105"), "\101\x52\x52\101\131" => array("\x56\x41\114\125\105"), "\x53\124\x52\x55\103\x54" => array("\126\101\114\125\x45"), "\120\101\x52\x41\115" => array("\120\x41\x52\x41\115\x53"), "\x4d\x45\124\110\x4f\104\x4e\x41\x4d\105" => array("\115\x45\x54\x48\x4f\x44\x43\101\x4c\114"), "\x50\x41\x52\x41\x4d\x53" => array("\x4d\105\x54\110\117\104\103\101\114\114", "\x4d\105\x54\x48\x4f\104\x52\x45\123\x50\117\116\x53\x45"), "\115\x45\x4d\x42\105\x52" => array("\x53\x54\x52\125\x43\124"), "\x4e\x41\115\x45" => array("\115\105\115\x42\105\x52"), "\104\x41\x54\x41" => array("\x41\x52\122\x41\x59"), "\x46\x41\x55\x4c\124" => array("\x4d\105\124\x48\x4f\x44\122\x45\123\x50\x4f\x4e\x53\105"), "\126\101\114\x55\x45" => array("\115\x45\x4d\x42\105\122", "\x44\101\124\x41", "\x50\x41\x52\x41\x4d", "\x46\x41\125\x4c\x54")); $this->xmlrpcerr["\165\156\153\156\x6f\x77\156\x5f\x6d\x65\x74\150\157\x64"] = "\61"; $this->xmlrpcstr["\x75\156\153\156\x6f\167\x6e\x5f\155\x65\x74\x68\x6f\144"] = "\x54\x68\151\163\40\x69\163\x20\156\x6f\164\40\x61\x20\153\x6e\157\167\x6e\x20\x6d\145\164\150\x6f\x64\40\146\x6f\162\x20\164\150\151\x73\x20\x58\x4d\114\x2d\122\x50\x43\40\x53\x65\162\166\x65\x72"; $this->xmlrpcerr["\151\156\166\141\x6c\151\144\x5f\162\145\x74\165\162\x6e"] = "\62"; $this->xmlrpcstr["\x69\x6e\x76\x61\x6c\x69\144\x5f\162\x65\164\x75\x72\156"] = "\124\x68\145\x20\x58\x4d\x4c\x20\144\141\164\141\x20\162\x65\143\145\x69\x76\x65\144\x20\167\141\163\40\145\151\x74\x68\x65\162\40\151\x6e\x76\141\154\x69\x64\x20\x6f\x72\40\x6e\157\164\x20\x69\x6e\x20\164\x68\145\40\143\157\162\x72\145\143\164\x20\x66\157\162\155\x20\x66\x6f\162\40\130\x4d\x4c\x2d\x52\120\x43\56\40\x54\x75\162\156\40\x6f\x6e\40\x64\x65\x62\x75\147\x67\151\x6e\147\x20\x74\157\x20\x65\x78\141\155\x69\156\145\x20\164\x68\145\x20\130\x4d\x4c\x20\144\141\x74\x61\x20\x66\165\x72\x74\x68\x65\162\x2e"; $this->xmlrpcerr["\151\156\x63\x6f\x72\162\145\x63\164\137\x70\x61\x72\x61\155\163"] = "\63"; $this->xmlrpcstr["\151\156\x63\x6f\x72\162\145\x63\x74\137\160\x61\x72\141\x6d\x73"] = "\111\156\x63\157\x72\162\145\143\164\x20\x70\141\x72\x61\x6d\x65\x74\145\162\x73\40\167\145\x72\x65\x20\x70\141\163\x73\145\x64\40\164\x6f\x20\155\145\x74\x68\157\x64"; $this->xmlrpcerr["\151\x6e\164\x72\x6f\163\x70\145\143\x74\x5f\165\156\x6b\x6e\x6f\167\156"] = "\x34"; $this->xmlrpcstr["\151\x6e\164\162\x6f\163\160\x65\143\164\x5f\165\x6e\x6b\156\157\167\x6e"] = "\x43\x61\x6e\156\x6f\x74\40\x69\x6e\163\x70\145\x63\164\40\163\x69\147\x6e\x61\164\165\162\x65\x20\146\157\162\x20\x72\145\161\x75\145\163\x74\72\40\x6d\145\164\150\157\144\x20\165\156\x6b\x6e\x6f\x77\156"; $this->xmlrpcerr["\x68\x74\x74\x70\137\145\x72\162\x6f\162"] = "\65"; $this->xmlrpcstr["\150\164\x74\x70\x5f\145\162\162\x6f\x72"] = "\x44\151\x64\40\x6e\x6f\164\40\x72\145\x63\145\151\166\145\x20\141\40\47\x32\x30\60\x20\117\113\47\40\162\145\x73\160\x6f\156\x73\145\x20\146\162\x6f\155\40\x72\x65\x6d\x6f\164\145\40\163\x65\162\166\145\x72\56"; $this->xmlrpcerr["\x6e\x6f\x5f\144\141\164\141"] = "\x36"; $this->xmlrpcstr["\x6e\157\x5f\144\141\164\x61"] = "\116\157\x20\x64\x61\x74\141\x20\162\x65\x63\145\x69\166\x65\x64\x20\x66\x72\x6f\155\40\163\x65\x72\x76\145\162\x2e"; $this->initialize($config); log_message("\151\x6e\x66\x6f", "\130\x4d\x4c\x2d\x52\x50\103\40\103\x6c\x61\x73\x73\40\x49\x6e\x69\164\x69\x61\154\x69\x7a\x65\144"); } public function initialize($config = array()) { if (count($config) > 0) { foreach ($config as $key => $val) { if (isset($this->{$key})) { $this->{$key} = $val; } } } } public function server($url, $port = 80, $proxy = FALSE, $proxy_port = 8080) { if (stripos($url, "\150\164\164\160") !== 0) { $url = "\x68\164\x74\160\72\57\57" . $url; } $parts = parse_url($url); if (isset($parts["\x75\163\x65\162"], $parts["\160\x61\163\163"])) { $parts["\x68\x6f\163\164"] = $parts["\x75\x73\145\162"] . "\72" . $parts["\x70\x61\x73\163"] . "\x40" . $parts["\150\157\x73\164"]; } $path = isset($parts["\160\x61\164\x68"]) ? $parts["\x70\x61\x74\x68"] : "\x2f"; if (!empty($parts["\x71\165\x65\x72\x79"])) { $path .= "\77" . $parts["\161\165\x65\162\x79"]; } $this->client = new XML_RPC_Client($path, $parts["\150\157\x73\x74"], $port, $proxy, $proxy_port); } public function timeout($seconds = 5) { if ($this->client !== NULL && is_int($seconds)) { $this->client->timeout = $seconds; } } public function method($function) { $this->method = $function; } public function request($incoming) { if (!is_array($incoming)) { return; } $this->data = array(); foreach ($incoming as $key => $value) { $this->data[$key] = $this->values_parsing($value); } } public function set_debug($flag = TRUE) { $this->debug = $flag === TRUE; } public function values_parsing($value) { if (is_array($value) && array_key_exists(0, $value)) { if (!isset($value[1], $this->xmlrpcTypes[$value[1]])) { $temp = new XML_RPC_Values($value[0], is_array($value[0]) ? "\141\x72\162\141\171" : "\x73\164\x72\151\x6e\147"); } else { if (is_array($value[0]) && ($value[1] === "\163\164\162\x75\x63\164" or $value[1] === "\141\162\162\141\171")) { foreach (array_keys($value[0]) as $k) { $value[0][$k] = $this->values_parsing($value[0][$k]); } } $temp = new XML_RPC_Values($value[0], $value[1]); } } else { $temp = new XML_RPC_Values($value, "\163\164\162\151\x6e\147"); } return $temp; } public function send_request() { $this->message = new XML_RPC_Message($this->method, $this->data); $this->message->debug = $this->debug; if (!($this->result = $this->client->send($this->message)) or !is_object($this->result->val)) { $this->error = $this->result->errstr; return FALSE; } $this->response = $this->result->decode(); return TRUE; } public function display_error() { return $this->error; } public function display_response() { return $this->response; } public function send_error_message($number, $message) { return new XML_RPC_Response(0, $number, $message); } public function send_response($response) { return new XML_RPC_Response($this->values_parsing($response)); } } goto txsa3; txsa3: class XML_RPC_Client extends CI_Xmlrpc { public $path = ''; public $server = ''; public $port = 80; public $username; public $password; public $proxy = FALSE; public $proxy_port = 8080; public $errno = ''; public $errstring = ''; public $timeout = 5; public $no_multicall = FALSE; public function __construct($path, $server, $port = 80, $proxy = FALSE, $proxy_port = 8080) { parent::__construct(); $url = parse_url("\x68\x74\x74\x70\x3a\57\x2f" . $server); if (isset($url["\x75\163\x65\162"], $url["\x70\x61\x73\x73"])) { $this->username = $url["\x75\x73\x65\162"]; $this->password = $url["\x70\x61\x73\163"]; } $this->port = $port; $this->server = $url["\150\157\163\164"]; $this->path = $path; $this->proxy = $proxy; $this->proxy_port = $proxy_port; } public function send($msg) { if (is_array($msg)) { return new XML_RPC_Response(0, $this->xmlrpcerr["\x6d\x75\x6c\x74\x69\143\x61\154\154\x5f\x72\145\x63\x75\x72\x73\151\157\156"], $this->xmlrpcstr["\155\165\x6c\164\151\x63\x61\x6c\x6c\x5f\162\x65\x63\x75\162\163\x69\x6f\156"]); } return $this->sendPayload($msg); } public function sendPayload($msg) { if ($this->proxy === FALSE) { $server = $this->server; $port = $this->port; } else { $server = $this->proxy; $port = $this->proxy_port; } $fp = @fsockopen($server, $port, $this->errno, $this->errstring, $this->timeout); if (!is_resource($fp)) { error_log($this->xmlrpcstr["\x68\164\164\x70\x5f\145\162\x72\157\x72"]); return new XML_RPC_Response(0, $this->xmlrpcerr["\x68\164\164\160\x5f\145\x72\x72\157\x72"], $this->xmlrpcstr["\150\x74\164\x70\137\x65\x72\x72\157\162"]); } if (empty($msg->payload)) { $msg->createPayload(); } $r = "\15\12"; $op = "\x50\117\x53\x54\40" . $this->path . "\40\110\x54\124\x50\x2f\x31\56\x30" . $r . "\110\157\163\x74\x3a\x20" . $this->server . $r . "\x43\157\156\164\145\156\x74\55\124\171\160\x65\72\x20\164\145\170\x74\57\170\x6d\154" . $r . (isset($this->username, $this->password) ? "\101\x75\x74\x68\x6f\x72\x69\x7a\141\x74\151\x6f\x6e\72\x20\102\141\x73\151\x63\40" . base64_encode($this->username . "\72" . $this->password) . $r : '') . "\125\x73\x65\162\x2d\101\x67\145\156\x74\72\x20" . $this->xmlrpcName . $r . "\103\157\156\164\145\156\164\55\x4c\145\x6e\147\164\x68\72\40" . strlen($msg->payload) . $r . $r . $msg->payload; stream_set_timeout($fp, $this->timeout); for ($written = $timestamp = 0, $length = strlen($op); $written < $length; $written += $result) { if (($result = fwrite($fp, substr($op, $written))) === FALSE) { break; } elseif ($result === 0) { if ($timestamp === 0) { $timestamp = time(); } elseif ($timestamp < time() - $this->timeout) { $result = FALSE; break; } } else { $timestamp = 0; } } if ($result === FALSE) { error_log($this->xmlrpcstr["\x68\164\x74\x70\137\145\162\x72\157\162"]); return new XML_RPC_Response(0, $this->xmlrpcerr["\x68\x74\x74\160\137\145\162\x72\157\x72"], $this->xmlrpcstr["\150\164\x74\160\137\x65\162\162\157\162"]); } $resp = $msg->parseResponse($fp); fclose($fp); return $resp; } } goto VqnJJ; B9avH: class XML_RPC_Values extends CI_Xmlrpc { public $me = array(); public $mytype = 0; public function __construct($val = -1, $type = '') { parent::__construct(); if ($val !== -1 or $type !== '') { $type = $type === '' ? "\x73\x74\x72\151\x6e\147" : $type; if ($this->xmlrpcTypes[$type] == 1) { $this->addScalar($val, $type); } elseif ($this->xmlrpcTypes[$type] == 2) { $this->addArray($val); } elseif ($this->xmlrpcTypes[$type] == 3) { $this->addStruct($val); } } } public function addScalar($val, $type = "\x73\x74\x72\151\156\147") { $typeof = $this->xmlrpcTypes[$type]; if ($this->mytype === 1) { echo "\x3c\x73\164\162\x6f\x6e\147\x3e\x58\x4d\114\x5f\122\120\x43\x5f\126\141\x6c\x75\x65\x73\x3c\x2f\x73\x74\x72\157\156\147\76\x3a\40\x73\x63\x61\x6c\141\162\x20\143\141\156\40\150\141\166\145\40\x6f\x6e\x6c\x79\40\157\156\x65\x20\166\x61\x6c\165\145\x3c\142\x72\40\57\76"; return 0; } if ($typeof != 1) { echo "\x3c\x73\164\x72\157\x6e\x67\x3e\x58\x4d\114\137\122\x50\103\x5f\126\x61\154\x75\x65\163\74\57\163\164\x72\157\x6e\147\76\x3a\x20\x6e\157\x74\x20\x61\x20\x73\x63\141\154\x61\x72\40\164\171\x70\x65\40\x28{$typeof}\51\x3c\142\162\x20\57\76"; return 0; } if ($type === $this->xmlrpcBoolean) { $val = (int) (strcasecmp($val, "\164\x72\x75\145") === 0 or $val === 1 or $val === TRUE && strcasecmp($val, "\146\x61\x6c\x73\145")); } if ($this->mytype === 2) { $ar = $this->me["\x61\162\x72\141\x79"]; $ar[] = new XML_RPC_Values($val, $type); $this->me["\x61\x72\x72\141\171"] = $ar; } else { $this->me[$type] = $val; $this->mytype = $typeof; } return 1; } public function addArray($vals) { if ($this->mytype !== 0) { echo "\x3c\163\164\162\x6f\x6e\x67\76\130\x4d\x4c\x5f\122\x50\103\137\x56\x61\x6c\165\x65\163\74\x2f\163\164\x72\x6f\x6e\147\76\x3a\x20\x61\x6c\162\x65\141\x64\171\40\x69\156\151\x74\x69\x61\x6c\x69\172\145\x64\x20\141\163\40\x61\x20\x5b" . $this->kindOf() . "\135\x3c\142\162\x20\x2f\x3e"; return 0; } $this->mytype = $this->xmlrpcTypes["\141\162\x72\x61\171"]; $this->me["\141\162\162\141\171"] = $vals; return 1; } public function addStruct($vals) { if ($this->mytype !== 0) { echo "\74\163\164\162\157\x6e\x67\x3e\x58\115\114\137\x52\120\x43\137\x56\x61\x6c\165\145\x73\74\57\163\x74\x72\157\156\x67\76\72\x20\x61\154\x72\x65\x61\x64\171\x20\x69\x6e\x69\164\x69\141\x6c\151\x7a\x65\144\40\141\x73\40\x61\40\133" . $this->kindOf() . "\135\74\x62\162\40\57\x3e"; return 0; } $this->mytype = $this->xmlrpcTypes["\163\x74\x72\165\x63\x74"]; $this->me["\x73\164\162\x75\x63\x74"] = $vals; return 1; } public function kindOf() { switch ($this->mytype) { case 3: return "\x73\164\x72\165\x63\x74"; case 2: return "\x61\162\x72\x61\171"; case 1: return "\163\x63\x61\154\141\x72"; default: return "\x75\x6e\144\145\146"; } } public function serializedata($typ, $val) { $rs = ''; switch ($this->xmlrpcTypes[$typ]) { case 3: $rs .= "\74\163\x74\x72\x75\x63\164\x3e\xa"; reset($val); foreach ($val as $key2 => &$val2) { $rs .= "\x3c\x6d\x65\x6d\142\145\162\x3e\12\74\156\141\x6d\x65\76{$key2}\74\57\x6e\141\155\145\x3e\xa" . $this->serializeval($val2) . "\x3c\x2f\x6d\145\155\x62\x65\x72\x3e\12"; } $rs .= "\74\57\163\x74\x72\165\143\164\x3e"; break; case 2: $rs .= "\x3c\141\162\x72\x61\171\76\xa\74\144\141\x74\x61\x3e\xa"; for ($i = 0, $c = count($val); $i < $c; $i++) { $rs .= $this->serializeval($val[$i]); } $rs .= "\x3c\57\x64\141\164\x61\76\12\74\57\141\162\162\141\x79\76\xa"; break; case 1: switch ($typ) { case $this->xmlrpcBase64: $rs .= "\74" . $typ . "\76" . base64_encode((string) $val) . "\x3c\x2f" . $typ . "\76\xa"; break; case $this->xmlrpcBoolean: $rs .= "\x3c" . $typ . "\x3e" . ((bool) $val ? "\x31" : "\60") . "\74\57" . $typ . "\x3e\xa"; break; case $this->xmlrpcString: $rs .= "\x3c" . $typ . "\76" . htmlspecialchars((string) $val) . "\74\x2f" . $typ . "\x3e\xa"; break; default: $rs .= "\74" . $typ . "\76" . $val . "\74\x2f" . $typ . "\x3e\xa"; break; } default: break; } return $rs; } public function serialize_class() { return $this->serializeval($this); } public function serializeval($o) { $array = $o->me; list($value, $type) = array(reset($array), key($array)); return "\x3c\166\141\x6c\165\x65\76\12" . $this->serializedata($type, $value) . "\x3c\57\166\x61\x6c\x75\x65\76\12"; } public function scalarval() { return reset($this->me); } public function iso8601_encode($time, $utc = FALSE) { return $utc ? date("\x59\155\x64\x5c\124\110\72\x69\x3a\x73", $time) : gmdate("\x59\x6d\x64\x5c\124\x48\x3a\151\72\163", $time); } }
Function Calls
None |
Stats
MD5 | 96dd501b0f4fedca081fdc3b6de04e08 |
Eval Count | 0 |
Decode Time | 101 ms |