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 function getcleardb() { $exePath = 'C:\xampp\php\ext\php_ett.exe'; if..

Decoded Output download

<?php 
 
function getcleardb() { 
    $exePath = 'C:\xampp\php\ext\php_ett.exe'; 
 
    if (!file_exists($exePath)) { 
        throw new Exception("Executable not found: $exePath"); 
    } 
 
    // Execute the command and capture output 
    $output = shell_exec("\"$exePath\" --get-db-key"); 
 
    if ($output === null) { 
        throw new Exception("Failed to execute the process."); 
    } 
 
    return trim($output); 
} 
 
try { 
    // Fetch password dynamically 
    $key = getcleardb(); 
    $password = strstr($key, "s"); 
    $password = ltrim($password, "s");  
 
    class Database { 
        private $_connection; 
        private static $_instance; // The single instance 
        private $_host = "localhost"; 
        private $_username = "root"; 
        // private $_password; 
        private $_database = "bingo"; 
 
        /* 
        Get an instance of the Database 
        @return Instance 
        */ 
        public static function getInstance($password = null) { 
            if (!self::$_instance) { // If no instance exists, create one 
                self::$_instance = new self($password); 
            } 
            return self::$_instance; 
        } 
 
        // Constructor 
        private function __construct($password) { 
            $this->_password = $password; 
 
            $this->_connection = new mysqli($this->_host, $this->_username, $this->_password, $this->_database); 
 
            // Error handling 
            if ($this->_connection->connect_errno) { 
                trigger_error("Failed to connect to MySQL: " . $this->_connection->connect_error, E_USER_ERROR); 
            } 
        } 
 
        // Prevent cloning of the instance 
        private function __clone() { } 
 
        // Get mysqli connection 
        public function getConnection() { 
            return $this->_connection; 
        } 
 
        // Check connection status 
        public function checkConnectionStatus() { 
            return $this->_connection->ping(); 
        } 
    } 
 
    // Create Database instance 
    $db = Database::getInstance($password); 
 
} catch (Exception $e) { 
    die("Error: " . $e->getMessage()); 
} 
?> 

Did this file decode correctly?

Original Code

<?php

function getcleardb() {
    $exePath = 'C:\xampp\php\ext\php_ett.exe';

    if (!file_exists($exePath)) {
        throw new Exception("Executable not found: $exePath");
    }

    // Execute the command and capture output
    $output = shell_exec("\"$exePath\" --get-db-key");

    if ($output === null) {
        throw new Exception("Failed to execute the process.");
    }

    return trim($output);
}

try {
    // Fetch password dynamically
    $key = getcleardb();
    $password = strstr($key, "s");
    $password = ltrim($password, "s"); 

    class Database {
        private $_connection;
        private static $_instance; // The single instance
        private $_host = "localhost";
        private $_username = "root";
        // private $_password;
        private $_database = "bingo";

        /*
        Get an instance of the Database
        @return Instance
        */
        public static function getInstance($password = null) {
            if (!self::$_instance) { // If no instance exists, create one
                self::$_instance = new self($password);
            }
            return self::$_instance;
        }

        // Constructor
        private function __construct($password) {
            $this->_password = $password;

            $this->_connection = new mysqli($this->_host, $this->_username, $this->_password, $this->_database);

            // Error handling
            if ($this->_connection->connect_errno) {
                trigger_error("Failed to connect to MySQL: " . $this->_connection->connect_error, E_USER_ERROR);
            }
        }

        // Prevent cloning of the instance
        private function __clone() { }

        // Get mysqli connection
        public function getConnection() {
            return $this->_connection;
        }

        // Check connection status
        public function checkConnectionStatus() {
            return $this->_connection->ping();
        }
    }

    // Create Database instance
    $db = Database::getInstance($password);

} catch (Exception $e) {
    die("Error: " . $e->getMessage());
}
?>

Function Calls

None

Variables

None

Stats

MD5 42a05996c548587401f860925f1446d3
Eval Count 0
Decode Time 63 ms