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 namespace Drupal\rest_api_authentication; use Drupal\rest_api_authentication..

Decoded Output download

<?php 
 
 
namespace Drupal\rest_api_authentication; 
 
use Drupal\rest_api_authentication\MiniorangeApiAuthConstants; 
use GuzzleHttp\Exception\GuzzleException; 
use function Symfony\Component\String\u; 
class Utilities 
{ 
    public static function generateRandom($Jv = 30) 
    { 
        $aM = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 
        $MW = strlen($aM); 
        $ZA = ''; 
        $De = 0; 
        Fj: 
        if (!($De < $Jv)) { 
            goto o3; 
        } 
        $ZA .= $aM[rand(0, $MW - 1)]; 
        Ge: 
        $De++; 
        goto Fj; 
        o3: 
        return $ZA; 
    } 
    public static function getResourceOwner($cc, $VQ) 
    { 
        $UK = curl_init($cc); 
        curl_setopt($UK, CURLOPT_FOLLOWLOCATION, true); 
        curl_setopt($UK, CURLOPT_ENCODING, ''); 
        curl_setopt($UK, CURLOPT_RETURNTRANSFER, true); 
        curl_setopt($UK, CURLOPT_AUTOREFERER, true); 
        curl_setopt($UK, CURLOPT_SSL_VERIFYPEER, false); 
        curl_setopt($UK, CURLOPT_SSL_VERIFYHOST, false); 
        curl_setopt($UK, CURLOPT_MAXREDIRS, 10); 
        curl_setopt($UK, CURLOPT_POST, false); 
        curl_setopt($UK, CURLOPT_HTTPHEADER, array("Authorization: Bearer " . $VQ)); 
        $Yl = curl_version(); 
        curl_setopt($UK, CURLOPT_USERAGENT, "curl/" . $Yl["version"]); 
        $w5 = curl_exec($UK); 
        if (!curl_error($UK)) { 
            goto wA; 
        } 
        json_encode(curl_error($UK)); 
        exit; 
        wA: 
        if (!(!is_array(json_decode($w5, true)) || empty(json_decode($w5, true)))) { 
            goto sg; 
        } 
        echo json_encode("Invalid response received."); 
        exit; 
        sg: 
        $w5 = json_decode($w5, true); 
        if (isset($w5["error_description"])) { 
            goto aT; 
        } 
        if (!isset($w5["error"])) { 
            goto Pn; 
        } 
        if (is_array($w5["error"])) { 
            goto Ky; 
        } 
        echo json_encode($w5["error"]); 
        goto cI; 
        Ky: 
        print_r(json_encode($w5["error"])); 
        cI: 
        exit; 
        Pn: 
        goto S7; 
        aT: 
        if (is_array($w5["error_description"])) { 
            goto FO; 
        } 
        echo json_encode($w5["error_description"]); 
        goto Y3; 
        FO: 
        print_r(json_encode($w5["error_description"])); 
        Y3: 
        exit; 
        S7: 
        return $w5; 
    } 
    public static function isCurlInstalled() 
    { 
        return in_array("curl", get_loaded_extensions()); 
    } 
    public static function getnestedattribute($fC, $YZ, $d0 = '') 
    { 
        if (!empty($YZ)) { 
            goto Qu; 
        } 
        return ''; 
        Qu: 
        $eE = explode(".", $YZ); 
        $Pu = ''; 
        if (sizeof($eE) > 1) { 
            goto q9; 
        } 
        if ($d0 == '') { 
            goto Wh; 
        } 
        if (!($d0 == "role_map")) { 
            goto K1; 
        } 
        $Pu = $eE[0]; 
        if (!isset($fC[$Pu])) { 
            goto IU; 
        } 
        return $fC[$Pu]; 
        IU: 
        K1: 
        goto ZJ; 
        Wh: 
        $Pu = $eE[0]; 
        if (!isset($fC[$Pu])) { 
            goto PL; 
        } 
        if (is_array($fC[$Pu])) { 
            goto FL; 
        } 
        return $fC[$Pu]; 
        goto i6; 
        FL: 
        $fC = $fC[$Pu]; 
        return $fC[0]; 
        i6: 
        PL: 
        ZJ: 
        goto OJ; 
        q9: 
        $Pu = $eE[0]; 
        if (!isset($fC[$Pu])) { 
            goto Wk; 
        } 
        return self::getnestedattribute($fC[$Pu], str_replace($Pu . ".", '', $YZ)); 
        Wk: 
        OJ: 
    } 
    public static function video_guide_links() 
    { 
        $xi = MiniorangeApiAuthConstants::guide_link; 
        if ($xi < time()) { 
            goto LB; 
        } 
        return FALSE; 
        goto ku; 
        LB: 
        return TRUE; 
        ku: 
    } 
    public static function send_support_query($EO, $YS, $V9, $NY) 
    { 
        if (empty($EO) || empty($V9)) { 
            goto JF; 
        } 
        if (!filter_var($EO, FILTER_VALIDATE_EMAIL)) { 
            goto RD; 
        } 
        goto z5; 
        JF: 
        \Drupal::messenger()->addMessage(t("The <b><u>Email</u></b> and <b><u>Query</u></b> fields are mandatory."), "error"); 
        return; 
        goto z5; 
        RD: 
        \Drupal::messenger()->addMessage(t("The email address <b><i>" . $EO . "</i></b> is not valid."), "error"); 
        return; 
        z5: 
        $rB = new MiniorangeApiAuthSupport($EO, $YS, $V9, $NY); 
        $yO = $rB->sendSupportQuery(); 
        if ($yO) { 
            goto u3; 
        } 
        \Drupal::messenger()->addMessage(t("Error sending support query"), "error"); 
        goto Ij; 
        u3: 
        \Drupal::messenger()->addMessage(t("Support query successfully sent. We will get back to you shortly.")); 
        Ij: 
    } 
    public static function get_timestamp() 
    { 
        $h5 = "https://login.xecurify.com/moas/rest/mobile/get-timestamp"; 
        $UK = curl_init($h5); 
        curl_setopt($UK, CURLOPT_FOLLOWLOCATION, true); 
        curl_setopt($UK, CURLOPT_ENCODING, ''); 
        curl_setopt($UK, CURLOPT_RETURNTRANSFER, true); 
        curl_setopt($UK, CURLOPT_AUTOREFERER, true); 
        curl_setopt($UK, CURLOPT_SSL_VERIFYPEER, false); 
        curl_setopt($UK, CURLOPT_SSL_VERIFYHOST, false); 
        curl_setopt($UK, CURLOPT_MAXREDIRS, 10); 
        curl_setopt($UK, CURLOPT_POST, true); 
        $w5 = curl_exec($UK); 
        if (!curl_errno($UK)) { 
            goto Sy; 
        } 
        echo "Error in sending curl Request"; 
        exit; 
        Sy: 
        curl_close($UK); 
        if (!empty($w5)) { 
            goto gZ; 
        } 
        $yL = round(microtime(true) * 1000); 
        $yL = number_format($yL, 0, '', ''); 
        gZ: 
        return empty($w5) ? $yL : $w5; 
    } 
    public static function getResponse(bool $t1) 
    { 
        global $base_url; 
        $EO = \Drupal::currentUser()->getEmail(); 
        $KX = "Drupal API Authentication module trial request status | " . $EO; 
        $IQ = $t1 ? "<b>Installed</b>" : "<b style="color: red">Uninstalled</b>"; 
        $nc = date_default_timezone_get(); 
        $w5 = "
      <table>
      <td>Hello,
      <br><br>Module status : " . $IQ . "
      <br><br>Base URL      : " . $base_url . "
      <br><br>Email         : " . $EO . "
      <br><br>Date          : " . date("y/m/d") . "\xa      <br><br>Time          : " . date("H:i:s") . " (" . $nc . ")\xa      <br><br>Thanks,<br><b>mini<font color="#ff9900">O</font>range</b><br>
      </td>
      </table>"; 
        $Fm = "16555"; 
        $WV = "fFd2XcvTGDemZvbw1bcUesNJWEqKbbUq"; 
        $h5 = MiniorangeApiAuthConstants::BASE_URL . "/moas/api/notify/send"; 
        $yL = self::get_timestamp(); 
        $Xs = $Fm . $yL . $WV; 
        $A3 = hash("sha512", $Xs); 
        $qB = ["customerKey" => $Fm, "sendEmail" => TRUE, "email" => ["customerKey" => $Fm, "fromEmail" => $EO, "fromName" => "miniOrange", "toEmail" => "[email protected]", "toName" => "[email protected]", "subject" => $KX, "content" => $w5]]; 
        $xB = ["Content-Type" => "application/json", "Customer-Key" => $Fm, "Timestamp" => $yL, "Authorization" => $A3]; 
        $iq = ["headers" => $xB, "body" => json_encode($qB), "verify" => FALSE]; 
        if (!self::isCurlInstalled()) { 
            goto bI; 
        } 
        try { 
            $zD = \Drupal::httpClient()->post($h5, $iq); 
            $IH = $zD->getBody()->getContents(); 
        } catch (GuzzleException $VG) { 
            $IH = $VG->getMessage(); 
        } 
        bI: 
    } 
} 
 ?>

Did this file decode correctly?

Original Code

<?php


namespace Drupal\rest_api_authentication;

use Drupal\rest_api_authentication\MiniorangeApiAuthConstants;
use GuzzleHttp\Exception\GuzzleException;
use function Symfony\Component\String\u;
class Utilities
{
    public static function generateRandom($Jv = 30)
    {
        $aM = "\141\x62\x63\144\x65\146\x67\150\x69\x6a\x6b\x6c\x6d\156\x6f\160\161\x72\x73\164\x75\166\x77\170\171\172\x41\102\103\104\105\x46\107\x48\111\x4a\113\x4c\115\x4e\x4f\x50\121\x52\123\x54\125\x56\x57\130\131\x5a\60\61\x32\x33\64\x35\x36\67\x38\x39";
        $MW = strlen($aM);
        $ZA = '';
        $De = 0;
        Fj:
        if (!($De < $Jv)) {
            goto o3;
        }
        $ZA .= $aM[rand(0, $MW - 1)];
        Ge:
        $De++;
        goto Fj;
        o3:
        return $ZA;
    }
    public static function getResourceOwner($cc, $VQ)
    {
        $UK = curl_init($cc);
        curl_setopt($UK, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt($UK, CURLOPT_ENCODING, '');
        curl_setopt($UK, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($UK, CURLOPT_AUTOREFERER, true);
        curl_setopt($UK, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($UK, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($UK, CURLOPT_MAXREDIRS, 10);
        curl_setopt($UK, CURLOPT_POST, false);
        curl_setopt($UK, CURLOPT_HTTPHEADER, array("\101\x75\x74\150\x6f\x72\x69\x7a\141\164\151\157\156\x3a\40\102\145\141\162\145\x72\x20" . $VQ));
        $Yl = curl_version();
        curl_setopt($UK, CURLOPT_USERAGENT, "\x63\165\162\x6c\57" . $Yl["\166\x65\x72\x73\151\157\156"]);
        $w5 = curl_exec($UK);
        if (!curl_error($UK)) {
            goto wA;
        }
        json_encode(curl_error($UK));
        exit;
        wA:
        if (!(!is_array(json_decode($w5, true)) || empty(json_decode($w5, true)))) {
            goto sg;
        }
        echo json_encode("\111\x6e\x76\x61\x6c\x69\144\x20\162\x65\x73\x70\x6f\x6e\163\x65\x20\162\x65\x63\x65\x69\x76\x65\x64\x2e");
        exit;
        sg:
        $w5 = json_decode($w5, true);
        if (isset($w5["\x65\x72\x72\157\x72\137\x64\145\163\x63\x72\x69\160\164\151\157\x6e"])) {
            goto aT;
        }
        if (!isset($w5["\x65\x72\162\157\162"])) {
            goto Pn;
        }
        if (is_array($w5["\x65\162\162\157\x72"])) {
            goto Ky;
        }
        echo json_encode($w5["\145\x72\x72\157\162"]);
        goto cI;
        Ky:
        print_r(json_encode($w5["\x65\x72\162\157\162"]));
        cI:
        exit;
        Pn:
        goto S7;
        aT:
        if (is_array($w5["\x65\162\162\x6f\x72\x5f\x64\x65\163\143\162\x69\x70\x74\x69\157\x6e"])) {
            goto FO;
        }
        echo json_encode($w5["\145\x72\162\x6f\x72\137\144\145\x73\x63\x72\151\160\164\151\157\x6e"]);
        goto Y3;
        FO:
        print_r(json_encode($w5["\145\x72\162\157\162\137\144\145\x73\x63\x72\x69\x70\x74\151\x6f\x6e"]));
        Y3:
        exit;
        S7:
        return $w5;
    }
    public static function isCurlInstalled()
    {
        return in_array("\143\165\x72\154", get_loaded_extensions());
    }
    public static function getnestedattribute($fC, $YZ, $d0 = '')
    {
        if (!empty($YZ)) {
            goto Qu;
        }
        return '';
        Qu:
        $eE = explode("\56", $YZ);
        $Pu = '';
        if (sizeof($eE) > 1) {
            goto q9;
        }
        if ($d0 == '') {
            goto Wh;
        }
        if (!($d0 == "\162\157\x6c\145\x5f\155\141\160")) {
            goto K1;
        }
        $Pu = $eE[0];
        if (!isset($fC[$Pu])) {
            goto IU;
        }
        return $fC[$Pu];
        IU:
        K1:
        goto ZJ;
        Wh:
        $Pu = $eE[0];
        if (!isset($fC[$Pu])) {
            goto PL;
        }
        if (is_array($fC[$Pu])) {
            goto FL;
        }
        return $fC[$Pu];
        goto i6;
        FL:
        $fC = $fC[$Pu];
        return $fC[0];
        i6:
        PL:
        ZJ:
        goto OJ;
        q9:
        $Pu = $eE[0];
        if (!isset($fC[$Pu])) {
            goto Wk;
        }
        return self::getnestedattribute($fC[$Pu], str_replace($Pu . "\56", '', $YZ));
        Wk:
        OJ:
    }
    public static function video_guide_links()
    {
        $xi = MiniorangeApiAuthConstants::guide_link;
        if ($xi < time()) {
            goto LB;
        }
        return FALSE;
        goto ku;
        LB:
        return TRUE;
        ku:
    }
    public static function send_support_query($EO, $YS, $V9, $NY)
    {
        if (empty($EO) || empty($V9)) {
            goto JF;
        }
        if (!filter_var($EO, FILTER_VALIDATE_EMAIL)) {
            goto RD;
        }
        goto z5;
        JF:
        \Drupal::messenger()->addMessage(t("\124\150\145\x20\x3c\142\76\74\x75\x3e\x45\x6d\x61\x69\154\x3c\x2f\165\x3e\74\57\142\76\x20\x61\156\x64\40\74\142\76\x3c\165\x3e\x51\x75\x65\162\x79\x3c\57\x75\76\x3c\x2f\142\76\40\x66\151\x65\154\144\163\40\141\x72\145\40\x6d\141\156\x64\141\164\x6f\x72\171\56"), "\x65\x72\x72\157\x72");
        return;
        goto z5;
        RD:
        \Drupal::messenger()->addMessage(t("\x54\150\x65\x20\145\x6d\141\151\x6c\40\x61\144\144\162\145\x73\163\40\74\142\x3e\x3c\151\76" . $EO . "\x3c\57\x69\76\x3c\x2f\142\76\x20\x69\x73\40\156\157\164\x20\166\141\154\151\144\56"), "\x65\162\x72\157\x72");
        return;
        z5:
        $rB = new MiniorangeApiAuthSupport($EO, $YS, $V9, $NY);
        $yO = $rB->sendSupportQuery();
        if ($yO) {
            goto u3;
        }
        \Drupal::messenger()->addMessage(t("\x45\x72\x72\157\162\40\163\145\x6e\x64\151\x6e\147\40\163\165\160\x70\x6f\162\x74\x20\x71\165\x65\x72\x79"), "\145\x72\x72\157\162");
        goto Ij;
        u3:
        \Drupal::messenger()->addMessage(t("\123\x75\160\160\x6f\x72\x74\x20\x71\x75\x65\x72\171\40\x73\165\x63\x63\x65\163\x73\146\x75\x6c\154\x79\x20\163\145\x6e\x74\56\40\127\x65\40\167\151\x6c\x6c\40\x67\145\x74\40\x62\141\x63\x6b\x20\x74\157\x20\x79\x6f\165\40\163\x68\x6f\162\x74\154\x79\56"));
        Ij:
    }
    public static function get_timestamp()
    {
        $h5 = "\150\164\164\x70\163\72\57\x2f\154\157\147\151\x6e\x2e\170\x65\x63\165\x72\x69\146\171\x2e\x63\x6f\x6d\57\x6d\x6f\x61\163\57\162\x65\x73\164\x2f\155\157\142\151\x6c\x65\x2f\147\145\x74\55\x74\151\155\x65\x73\x74\x61\x6d\160";
        $UK = curl_init($h5);
        curl_setopt($UK, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt($UK, CURLOPT_ENCODING, '');
        curl_setopt($UK, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($UK, CURLOPT_AUTOREFERER, true);
        curl_setopt($UK, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($UK, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($UK, CURLOPT_MAXREDIRS, 10);
        curl_setopt($UK, CURLOPT_POST, true);
        $w5 = curl_exec($UK);
        if (!curl_errno($UK)) {
            goto Sy;
        }
        echo "\105\x72\x72\x6f\x72\x20\x69\x6e\x20\x73\x65\x6e\x64\x69\156\147\40\143\x75\x72\154\x20\x52\x65\161\165\x65\x73\164";
        exit;
        Sy:
        curl_close($UK);
        if (!empty($w5)) {
            goto gZ;
        }
        $yL = round(microtime(true) * 1000);
        $yL = number_format($yL, 0, '', '');
        gZ:
        return empty($w5) ? $yL : $w5;
    }
    public static function getResponse(bool $t1)
    {
        global $base_url;
        $EO = \Drupal::currentUser()->getEmail();
        $KX = "\104\x72\165\x70\x61\154\x20\x41\x50\111\x20\x41\165\x74\x68\x65\156\x74\151\x63\x61\x74\151\x6f\156\40\155\x6f\144\165\x6c\145\40\164\162\151\141\x6c\x20\x72\x65\x71\165\x65\163\x74\40\x73\164\141\164\165\163\40\174\x20" . $EO;
        $IQ = $t1 ? "\74\142\x3e\x49\156\163\x74\141\154\154\x65\144\x3c\57\x62\76" : "\x3c\142\40\x73\x74\171\154\x65\75\x22\x63\157\x6c\157\x72\72\40\x72\x65\144\42\76\125\156\x69\x6e\x73\x74\x61\x6c\154\x65\144\x3c\x2f\x62\76";
        $nc = date_default_timezone_get();
        $w5 = "\12\x20\40\x20\40\x20\x20\x3c\x74\x61\x62\x6c\x65\x3e\12\x20\40\40\x20\40\x20\x3c\164\144\76\x48\145\154\x6c\157\54\12\x20\40\40\40\x20\x20\74\x62\x72\76\74\142\x72\76\115\157\x64\x75\154\x65\x20\163\x74\141\164\x75\163\40\72\x20" . $IQ . "\12\x20\x20\40\x20\40\x20\x3c\x62\x72\76\74\x62\x72\76\x42\x61\x73\145\40\x55\122\114\40\40\x20\x20\x20\x20\72\x20" . $base_url . "\12\x20\40\40\x20\40\x20\74\x62\162\76\74\x62\162\76\105\x6d\x61\151\x6c\40\40\x20\40\40\40\40\40\40\72\40" . $EO . "\12\x20\40\x20\x20\40\40\74\142\x72\76\74\142\x72\x3e\104\x61\x74\145\40\40\x20\40\40\40\x20\40\40\x20\x3a\40" . date("\x79\57\x6d\57\x64") . "\xa\x20\40\40\x20\x20\x20\x3c\142\x72\76\74\142\162\x3e\124\151\x6d\x65\40\40\x20\40\40\40\x20\40\x20\40\72\x20" . date("\x48\72\x69\72\163") . "\40\x28" . $nc . "\x29\xa\40\x20\40\40\x20\x20\x3c\x62\162\76\74\142\162\x3e\124\150\x61\156\x6b\163\54\x3c\x62\x72\76\74\x62\x3e\x6d\x69\x6e\x69\74\146\157\156\x74\x20\143\x6f\154\157\162\75\x22\x23\146\146\x39\x39\60\x30\42\x3e\x4f\74\x2f\146\x6f\x6e\164\76\x72\x61\156\x67\x65\74\57\142\x3e\74\x62\x72\76\12\x20\x20\x20\40\x20\x20\x3c\x2f\164\x64\76\12\x20\x20\x20\40\x20\x20\74\x2f\164\x61\x62\x6c\x65\76";
        $Fm = "\61\x36\x35\65\x35";
        $WV = "\x66\106\144\62\x58\143\166\x54\107\104\145\155\132\x76\x62\x77\x31\x62\x63\125\145\163\x4e\112\127\105\x71\113\x62\142\125\161";
        $h5 = MiniorangeApiAuthConstants::BASE_URL . "\x2f\x6d\x6f\141\x73\x2f\x61\x70\x69\x2f\156\157\x74\x69\x66\171\x2f\x73\x65\156\144";
        $yL = self::get_timestamp();
        $Xs = $Fm . $yL . $WV;
        $A3 = hash("\x73\150\141\65\x31\62", $Xs);
        $qB = ["\143\165\163\x74\157\155\x65\162\113\145\x79" => $Fm, "\x73\145\x6e\x64\105\x6d\141\151\154" => TRUE, "\x65\155\141\151\x6c" => ["\x63\165\x73\164\157\155\145\162\113\x65\171" => $Fm, "\146\x72\x6f\x6d\105\155\141\151\154" => $EO, "\x66\x72\157\x6d\116\x61\x6d\x65" => "\x6d\151\156\x69\x4f\x72\141\156\x67\x65", "\164\157\x45\x6d\141\151\x6c" => "\144\x72\165\x70\x61\154\163\x75\160\x70\157\162\x74\x40\170\145\143\165\x72\x69\146\x79\56\143\157\155", "\164\x6f\116\x61\x6d\x65" => "\144\x72\x75\160\x61\154\x73\165\160\x70\x6f\162\164\100\x78\x65\143\x75\x72\151\x66\x79\56\143\157\155", "\163\x75\142\152\145\x63\x74" => $KX, "\x63\157\156\x74\145\156\x74" => $w5]];
        $xB = ["\x43\157\156\164\x65\156\x74\55\x54\171\x70\145" => "\x61\160\x70\154\x69\x63\x61\164\151\157\x6e\x2f\152\163\157\x6e", "\x43\x75\x73\164\x6f\x6d\145\x72\x2d\x4b\x65\171" => $Fm, "\x54\151\155\x65\163\x74\141\x6d\160" => $yL, "\101\x75\x74\x68\157\x72\x69\x7a\x61\x74\x69\157\156" => $A3];
        $iq = ["\150\x65\x61\x64\145\x72\x73" => $xB, "\142\157\x64\x79" => json_encode($qB), "\166\145\x72\151\x66\171" => FALSE];
        if (!self::isCurlInstalled()) {
            goto bI;
        }
        try {
            $zD = \Drupal::httpClient()->post($h5, $iq);
            $IH = $zD->getBody()->getContents();
        } catch (GuzzleException $VG) {
            $IH = $VG->getMessage();
        }
        bI:
    }
}

Function Calls

None

Variables

None

Stats

MD5 54bd215301daec12445b8de3a8f137cf
Eval Count 0
Decode Time 41 ms