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 use WHMCS\Database\Capsule; goto DbN4d; V2WQn: header("\114\157\x63\x61\164\x69\15..

Decoded Output download

<?php 
 use WHMCS\Database\Capsule; goto DbN4d; V2WQn: header("Location: " . $Link); goto epU15; QNEV7: $tokenKey = Capsule::table("tbladdonmodules")->where("module", "imperioapp")->where("setting", "tokenKey")->value("value") ?? null; goto FxO_I; csSZF: $gateway_admin = $GATEWAY["admin"]; goto kmV7Z; DbN4d: $actual_link = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] === "on" ? "https" : "http") . "://{$_SERVER["HTTP_HOST"]}{$_SERVER["REQUEST_URI"]}"; goto EpdkZ; f2Q8w: $systemurl = rtrim(\App::getSystemUrl(), "/"); goto csSZF; An2LP: require_once $_SERVER["DOCUMENT_ROOT"] . "/init.php"; goto e4GlL; Frkkl: parse_str($parts["query"], $query); goto An2LP; FxO_I: $autologin_key = Capsule::table("tbladdonmodules")->where("module", "imperioapp")->where("setting", "autologin_key")->value("value") ?? null; goto aRHA6; SuRsp: $whmcsAdmin = empty(trim($gateway_admin)) ? $backup_admin : empty(array_shift(mysql_fetch_array(mysql_query("SELECT username FROM tbladmins WHERE username = '{$gateway_admin}' LIMIT 1")))) ? $backup_admin : trim($GATEWAY["admin"]); goto QNEV7; ow3NQ: if ($mode == "option1") { if ($query["token"] == $tokenKey) { $invoiceid = $query["invoiceid"]; if (isset($invoiceid)) { $postData = array("invoiceid" => $invoiceid); $results = localAPI("getinvoice", $postData, $whmcsAdmin); $userid = preg_replace("/[^0-9_]/", '', $results["userid"]); if (isset($userid)) { if ($paymentmethod == "cobrancaasaasmpay" && $toasaas == "option1") { foreach (Capsule::table("mod_cobrancaasaasmpay")->where("fatura_id", $vars["invoiceid"])->get() as $asaasmpay) { $boletoURL = $asaasmpay->url_boleto; } $Link = str_replace("/b/pdf/", "/i/", $boletoURL); } else { $postData = array("client_id" => $userid, "destination" => "sso:custom_redirect", "sso_redirect_path" => "viewinvoice.php?id=" . $invoiceid, "responsetype" => "json"); $param = localAPI("CreateSsoToken", $postData, $whmcsAdmin); if ($param["result"] == "success") { $Link = $param["redirect_url"]; } else { $Link = $systemurl . "/fatura/error.html"; } } } } } else { $Link = $systemurl . "/fatura/token_fail.html"; } } else { $Link = $systemurl . "/fatura/error.html"; } goto z5Ucj; aRHA6: $mode = Capsule::table("tbladdonmodules")->where("module", "imperioapp")->where("setting", "mode")->value("value") ?? null; goto AladH; AladH: $toasaas = Capsule::table("tbladdonmodules")->where("module", "imperioapp")->where("setting", "toasaas")->value("value") ?? null; goto ow3NQ; z5Ucj: header("Status: 301 Moved Permanently", false, 301); goto V2WQn; EpdkZ: $parts = parse_url($actual_link); goto Frkkl; kmV7Z: $backup_admin = array_shift(mysql_fetch_array(mysql_query("SELECT username FROM tbladmins LIMIT 1"))); goto SuRsp; epU15: die; goto cyprU; Yh78p: $whmcs->load_function("invoice"); goto f2Q8w; e4GlL: $whmcs->load_function("gateway"); goto Yh78p; cyprU: 
?>

Did this file decode correctly?

Original Code

<?php
 use WHMCS\Database\Capsule; goto DbN4d; V2WQn: header("\114\157\x63\x61\164\x69\157\x6e\72\x20" . $Link); goto epU15; QNEV7: $tokenKey = Capsule::table("\164\142\154\x61\x64\144\x6f\x6e\x6d\x6f\x64\x75\154\145\163")->where("\x6d\x6f\x64\x75\154\x65", "\x69\155\x70\x65\x72\151\157\141\160\160")->where("\x73\145\x74\x74\x69\156\147", "\x74\157\x6b\x65\x6e\x4b\x65\x79")->value("\166\x61\154\165\145") ?? null; goto FxO_I; csSZF: $gateway_admin = $GATEWAY["\141\144\155\x69\156"]; goto kmV7Z; DbN4d: $actual_link = (isset($_SERVER["\110\124\124\120\x53"]) && $_SERVER["\110\124\124\120\x53"] === "\157\156" ? "\150\164\164\160\163" : "\x68\164\x74\160") . "\72\57\x2f{$_SERVER["\110\x54\x54\120\x5f\110\117\123\x54"]}{$_SERVER["\122\x45\121\x55\105\x53\x54\137\x55\x52\111"]}"; goto EpdkZ; f2Q8w: $systemurl = rtrim(\App::getSystemUrl(), "\57"); goto csSZF; An2LP: require_once $_SERVER["\x44\x4f\x43\125\115\105\x4e\124\137\122\117\x4f\124"] . "\57\151\156\x69\164\x2e\x70\x68\x70"; goto e4GlL; Frkkl: parse_str($parts["\x71\x75\145\x72\x79"], $query); goto An2LP; FxO_I: $autologin_key = Capsule::table("\x74\142\x6c\x61\144\144\157\x6e\155\157\144\165\154\145\x73")->where("\x6d\x6f\144\x75\x6c\145", "\151\155\x70\x65\x72\x69\157\141\x70\x70")->where("\x73\145\x74\164\151\x6e\x67", "\141\165\x74\157\x6c\x6f\147\x69\156\x5f\153\145\x79")->value("\x76\141\x6c\165\145") ?? null; goto aRHA6; SuRsp: $whmcsAdmin = empty(trim($gateway_admin)) ? $backup_admin : empty(array_shift(mysql_fetch_array(mysql_query("\123\105\114\105\103\x54\40\165\x73\x65\162\156\x61\x6d\145\40\x46\x52\117\x4d\40\x74\142\x6c\x61\144\x6d\151\156\x73\40\x57\x48\x45\x52\105\x20\x75\x73\145\x72\x6e\x61\155\x65\40\75\x20\47{$gateway_admin}\x27\40\114\x49\x4d\x49\124\x20\x31")))) ? $backup_admin : trim($GATEWAY["\x61\x64\x6d\151\x6e"]); goto QNEV7; ow3NQ: if ($mode == "\157\160\164\x69\157\x6e\x31") { if ($query["\x74\157\153\145\156"] == $tokenKey) { $invoiceid = $query["\151\x6e\166\157\x69\x63\x65\151\144"]; if (isset($invoiceid)) { $postData = array("\x69\x6e\x76\x6f\x69\x63\145\151\144" => $invoiceid); $results = localAPI("\x67\x65\x74\x69\x6e\166\x6f\x69\143\x65", $postData, $whmcsAdmin); $userid = preg_replace("\x2f\133\136\x30\x2d\x39\137\135\x2f", '', $results["\165\x73\145\162\151\x64"]); if (isset($userid)) { if ($paymentmethod == "\x63\157\142\x72\x61\x6e\143\x61\x61\163\141\x61\163\x6d\160\x61\x79" && $toasaas == "\x6f\160\x74\x69\x6f\156\61") { foreach (Capsule::table("\x6d\157\144\x5f\143\157\142\x72\141\x6e\143\141\141\x73\x61\x61\163\155\160\141\x79")->where("\146\141\x74\x75\162\141\137\151\144", $vars["\x69\156\166\157\x69\x63\x65\x69\x64"])->get() as $asaasmpay) { $boletoURL = $asaasmpay->url_boleto; } $Link = str_replace("\57\142\57\160\x64\146\x2f", "\x2f\x69\x2f", $boletoURL); } else { $postData = array("\143\154\x69\145\x6e\x74\x5f\151\144" => $userid, "\x64\x65\163\164\x69\x6e\x61\164\x69\x6f\x6e" => "\163\x73\157\x3a\143\x75\163\164\157\x6d\137\162\x65\x64\151\x72\145\x63\x74", "\163\x73\157\x5f\x72\x65\x64\151\x72\x65\143\164\x5f\160\141\x74\x68" => "\x76\x69\145\x77\x69\x6e\166\157\151\143\145\x2e\160\150\x70\x3f\x69\144\x3d" . $invoiceid, "\162\145\163\160\x6f\x6e\x73\145\164\x79\x70\145" => "\152\163\157\156"); $param = localAPI("\103\x72\x65\141\164\x65\x53\163\x6f\x54\x6f\x6b\145\156", $postData, $whmcsAdmin); if ($param["\x72\x65\163\165\154\164"] == "\x73\165\143\x63\x65\163\x73") { $Link = $param["\162\145\144\151\162\145\143\x74\x5f\165\x72\x6c"]; } else { $Link = $systemurl . "\57\x66\x61\164\x75\162\x61\x2f\145\162\162\x6f\x72\x2e\150\x74\155\x6c"; } } } } } else { $Link = $systemurl . "\57\146\x61\164\165\x72\141\x2f\x74\x6f\x6b\x65\x6e\137\146\x61\x69\154\56\x68\x74\155\154"; } } else { $Link = $systemurl . "\57\146\x61\x74\x75\x72\x61\x2f\x65\x72\x72\x6f\162\x2e\150\164\155\x6c"; } goto z5Ucj; aRHA6: $mode = Capsule::table("\x74\x62\154\141\x64\x64\x6f\x6e\x6d\x6f\144\x75\154\145\x73")->where("\155\x6f\x64\x75\154\x65", "\151\x6d\x70\x65\162\151\157\x61\160\x70")->where("\163\x65\x74\164\151\156\x67", "\155\x6f\144\x65")->value("\x76\x61\x6c\x75\145") ?? null; goto AladH; AladH: $toasaas = Capsule::table("\x74\142\154\x61\144\x64\x6f\x6e\155\157\144\165\x6c\x65\163")->where("\155\157\x64\165\154\145", "\151\155\x70\x65\x72\x69\157\x61\160\x70")->where("\163\x65\164\164\151\x6e\x67", "\x74\157\141\163\141\141\163")->value("\x76\x61\x6c\165\x65") ?? null; goto ow3NQ; z5Ucj: header("\123\164\x61\164\x75\163\72\x20\63\60\61\x20\x4d\157\166\145\144\40\120\145\x72\155\141\156\145\156\x74\x6c\x79", false, 301); goto V2WQn; EpdkZ: $parts = parse_url($actual_link); goto Frkkl; kmV7Z: $backup_admin = array_shift(mysql_fetch_array(mysql_query("\x53\105\x4c\x45\x43\124\x20\x75\163\x65\162\156\141\x6d\145\40\106\x52\x4f\x4d\40\164\x62\x6c\x61\144\x6d\151\156\163\40\114\x49\x4d\x49\124\x20\x31"))); goto SuRsp; epU15: die; goto cyprU; Yh78p: $whmcs->load_function("\x69\156\x76\157\x69\x63\145"); goto f2Q8w; e4GlL: $whmcs->load_function("\x67\141\x74\x65\167\x61\171"); goto Yh78p; cyprU:
?>

Function Calls

None

Variables

None

Stats

MD5 a5b9268dbbe9e5c2f0ea98b0a46e98c9
Eval Count 0
Decode Time 62 ms