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(gzinflate(substr(base64_decode('H4sIAAAAAAAAC61WTW/bOBC9+1dwVaeWEq2TAoseHD..

Decoded Output download


/**
 * HTTP Stream version of the TinyHttp Client used to connect to Twilio
 * services.
 */

class Services_Twilio_HttpStreamException extends ErrorException {}

class Services_Twilio_HttpStream {

    private $auth_header = null;
    private $uri = null;
    private $debug = false;
    private static $default_options = array(
        "http" => array(
            "headers" => "",
            "timeout" => 60,
            "follow_location" => true,
            "ignore_errors" => true,
        ),
        "ssl" => array(),
    );
    private $options = array();

    public function __construct($uri = '', $kwargs = array()) {
        $this->uri = $uri;
        if (isset($kwargs['debug'])) {
            $this->debug = true;
        }
        if (isset($kwargs['http_options'])) {
            $this->options = $kwargs['http_options'] + self::$default_options;
        } else {
            $this->options = self::$default_options;
        }
    }

    public function __call($name, $args) {
        list($res, $req_headers, $req_body) = $args + array(0, array(), '');

        $request_options = $this->options;
        $url = $this->uri . $res;

        if (isset($req_body) && strlen($req_body) > 0) {
            $request_options['http']['content'] = $req_body;
        }

        foreach($req_headers as $key => $value) {
            $request_options['http']['header'] .= sprintf("%s: %s
", $key, $value);
        }

        if (isset($this->auth_header)) {
            $request_options['http']['header'] .= $this->auth_header;
        }

        $request_options['http']['method'] = strtoupper($name);
        $request_options['http']['ignore_errors'] = true;

        if ($this->debug) {
            error_log(var_export($request_options, true));
        }
        $ctx = stream_context_create($request_options);
        $result = file_get_contents($url, false, $ctx);

        if (false === $result) {
            throw new Services_Twilio_HttpStreamException(
                "Unable to connect to service");
        }

        $status_header = array_shift($http_response_header);
        if (1 !== preg_match('#HTTP/\d+\.\d+ (\d+)#', $status_header, $matches)) {
            throw new Services_Twilio_HttpStreamException(
                "Unable to detect the status code in the HTTP result.");
        }

        $status_code = intval($matches[1]);
        $response_headers = array();

        foreach($http_response_header as $header) {
            list($key, $val) = explode(":", $header);
            $response_headers[trim($key)] = trim($val);
        }

        return array($status_code, $response_headers, $result);
    }

    public function authenticate($user, $pass) {
        if (isset($user) && isset($pass)) {
            $this->auth_header = sprintf("Authorization: Basic %s",
                base64_encode(sprintf("%s:%s", $user, $pass)));
        } else {
            $this->auth_header = null;
        }
    }
}

Did this file decode correctly?

Original Code

<?php 

 eval(gzinflate(substr(base64_decode('H4sIAAAAAAAAC61WTW/bOBC9+1dwVaeWEq2TAoseHDjA7qJAjws0e0oCgZZGFlGa9JKU7WyR/94hKVmULCc5VAdB1AwfZ958cXJ9eTkhl+Tr/f0/5JtRQDdkB0ozKYgsiamA3DPx/NWYLfmbMxCG1BoKYiTJpRCQG/t5v2ecSYujQe1YDnqOi+vJJOdUa/Kt+Zl5vcyi+bO+HHLYGnsYHAyIQpMvSknV/f7x8jYI+TGZEHy2iu2oATKltamyCmgBiiyJqDm/7SvUio0LCljVaxSVlGvoy7ShhuVWpaQ1N5l0BmpUpkrR59gp2yeq0LKILO+GAi90Zmknj6K0LzRsA7I2Tvj5ZiAsJedyn3GZU3uyUzKqhoEaWwupIAPLox5RSrrPSGseGNpIkgEnQ0dR7hXqFUdCylrkLlRZhhmh8bDcxA3Ds1lKpt/3VK2D7QnGq7Vgaiqmf7/z2nbT7VHEShIzrQHBPMLDzEVn9tRDCFDa4Fl/O5yX1xBtqNpIngfuGDizkVxh4vNysRhmR2AGAUypt/DfRJn497kAUM7jqaAbQN6toaFDnGn0XIFGmYL/mgJpVytZPCfWQxesqyZYN+kxNzCYbeSd6bipBh3WQd+bzmiMK+/ENtZzu10HaEFoOmM+fsSiUxxE+POO3JxEaWCKj87s6WGGCYldxWCAlp2XIZvHzxJrhuZVHDJDqMaAw7OtkOmO8href7KHwIPnGFQsJWHKOLrQC3KhH9WjiFKHnLa4ozYFpHjqgr52mqrvMuUUaPTk82AbMJUsHKEYGyPr7RaUT7nAifP7e93Jwfhq7Tkd1vPQT7cTm+A63lGVwWErlU+a8LzUoSbJWBeY5ubgrcfRkbkMOZgsx5WBE6C+Txpr0g4HxiFbg8ma9NK23fHUD43UHZAMPHIislwuW5ihW6ZSck8E7N8zLPsjxT7Rv4KuOAzGcjOMo/H0mtqJVutuULpKz3TFSmTUNTi0dYssQJt0/e78ifyGDm0VrLMNNVg8sw/2GnH9WFw9zvFFYnwlH+wM6B2Fa6cP+iSLfx0NBRjHQuUnd62RmAIIE+6Xu+74SMzfoMdtW+JGg6Uat5Y/fHoa5EZI1OmwtM+xx4xx65pNQ/OAFN+4j+3CdmnMe452xdHCdpKT6Iza9GAU2zicxNedXVm8UfcVmFqJxouQi/QUOT1m9e1r88l2HSwXlrtKw2ukzYQt3u1Ch4OmZzXcFGjWTvXMiO5f+Y4d90/8LRX7392YFuQvqtGgCz24d9lnRTV8/iMDYX2Mw5Zt1UnP3F5jeWWun7uHeo78+2XyE84IAbiDCwAA'),10,-8))); ?>

Function Calls

substr 1
gzinflate 1
base64_decode 1

Variables

None

Stats

MD5 6b4a0494f223c820ccd15e2bd05e9d0d
Eval Count 1
Decode Time 104 ms