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 goto UHFD7; u10aZ: $queryconsultasite = "\123\105\x4c\x45\x43\124\x20\x2a\40\x46\..

Decoded Output download

<?php 
goto UHFD7; 
u10aZ: 
$queryconsultasite = "SELECT * FROM users WHERE id = ?"; 
goto gCBam; 
gKX1t: 
$stmt->bind_param("s", $playerid); 
goto N3Mhy; 
yS2CA: 
$resultadoconsultasite = $stmt->get_result(); 
goto rWzc1; 
sQArY: 
$nomedeusuario = $rowsite["name"]; 
goto TYiNY; 
gCBam: 
$stmt = $conn->prepare($queryconsultasite); 
goto gKX1t; 
wZAUT: 
$playerid = $tokenOpen["id"] ?? null; 
goto RxZ4L; 
wUCXq: 
$zerarodadabonus = $conn->query($deletabonusativo); 
goto sQArY; 
RxZ4L: 
switch ($gameid) { 
    case "126": 
        $rotajogo = "fortune-tiger"; 
        break; 
    case "68": 
        $rotajogo = "fortune-mouse"; 
        break; 
    case "82": 
        $rotajogo = "phoenix-rises"; 
        break; 
    case "69": 
        $rotajogo = "bikini-paradise"; 
        break; 
    case "98": 
        $rotajogo = "fortune-ox"; 
        break; 
    case "39": 
        $rotajogo = "piggy-gold"; 
        break; 
    case "42": 
        $rotajogo = "ganesha-gold"; 
        break; 
    case "1543462": 
        $rotajogo = "fortune-rabbit"; 
        break; 
    case "48": 
        $rotajogo = "double-fortune"; 
        break; 
    case "40": 
        $rotajogo = "jungle-delight"; 
        break; 
    default: 
        $rotajogo = ''; 
} 
goto u10aZ; 
UjDiM: 
$gameid = $_POST["gi"]; 
goto ye6o_; 
ye6o_: 
$tokenOpen = decTokenImproved($_POST["otk"]); 
goto wZAUT; 
ORRNI: 
include "../../../../db.php"; 
goto UjDiM; 
TYiNY: 
$dadosjson = array("dt" => array("oj" => array("jid" => 1), "pid" => $_POST["otk"], "pcd" => $nomedeusuario, "tk" => $_POST["otk"], "st" => 1, "geu" => "game-api/" . $rotajogo . "/", "lau" => "/game-api/lobby/", "bau" => "web-api/game-proxy/", "cc" => "BRL", "cs" => "R$", "nkn" => $nomedeusuario, "gm" => array(array("gid" => $gameid, "msdt" => generateTimestamp(), "medt" => generateTimestamp(), "st" => 1, "amsg" => '', "rtp" => array("df" => array("min" => 96.75, "max" => 96.75)), "mxe" => 1356, "mxehr" => 39393939)), "uiogc" => array("bb" => 0, "grtp" => 1, "gec" => 0, "cbu" => 0, "cl" => 0, "bf" => 0, "mr" => 0, "phtr" => 0, "vc" => 0, "bfbsi" => 1, "bfbli" => 1, "il" => 0, "rp" => 0, "gc" => 1, "ign" => 1, "tsn" => 0, "we" => 0, "gsc" => 0, "bu" => 0, "pwr" => 0, "hd" => 0, "et" => 0, "np" => 0, "igv" => 0, "as" => 0, "asc" => 0, "std" => 0, "hnp" => 0, "ts" => 0, "smpo" => 0, "ivs" => 1, "ir" => 0, "hn" => 1), "ec" => array(array("n" => "132bb011e7", "v" => "10", "il" => 0, "om" => 0, "uie" => array("ct" => "1")), array("n" => "5e3d8c75c3", "v" => "6", "il" => 0, "om" => 0, "uie" => array("ct" => "1"))), "occ" => array("rurl" => '', "tcm" => '', "tsc" => 0, "ttp" => 0, "tlb" => '', "trb" => ''), "gcv" => "1.2.0.11", "ioph" => "e2c30e9b4e6e"), "err" => null); 
goto GPv0J; 
UHFD7: 
if ($_SERVER["REQUEST_METHOD"] !== "POST") { 
    die(json_encode(array("error" => "Acesso invlido."))); 
} 
goto HSGdG; 
X_Xwu: 
function isJson($string) 
{ 
    json_decode($string); 
    return json_last_error() === JSON_ERROR_NONE; 
} 
goto UG8du; 
N3Mhy: 
$stmt->execute(); 
goto yS2CA; 
HSGdG: 
function generateTimestamp() 
{ 
    date_default_timezone_set("America/Sao_Paulo"); 
    $datetime = new DateTime(); 
    $timestamp = $datetime->getTimestamp() * 1000; 
    return $timestamp; 
} 
goto XfkZ_; 
XfkZ_: 
function decodeToken($texto) 
{ 
    $retorno = ''; 
    $saidaSubs = ''; 
    $busca0 = array("8", "e", "9", "f", "b", "d", "h", "g", "j", "i", "m", "o", "k", "z", "l", "w", "4", "s", "r", "u", "t", "x", "v", "p", "6", "n", "7", "2", "1", "5", "q", "3", "y", "0", "c", "a"); 
    $subti0 = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "w", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"); 
    for ($i = 0; $i < strlen($texto); $i++) { 
        $ti = array_search($texto[$i], $busca0); 
        if ($busca0[$ti] == $texto[$i]) { 
            $saidaSubs .= $subti0[$ti]; 
        } else { 
            $saidaSubs .= $texto[$i]; 
        } 
    } 
    $retorno = base64_decode($saidaSubs); 
    return $retorno; 
} 
goto X_Xwu; 
rWzc1: 
$rowsite = $resultadoconsultasite->fetch_assoc(); 
goto Q270z; 
UG8du: 
function decTokenImproved($token) 
{ 
    $decoded = decodeToken($token); 
    if (!isJson($decoded)) { 
        return array("status" => false, "message" => "Invalid token"); 
    } 
    $data = json_decode($decoded, true); 
    $data["status"] = true; 
    return $data; 
} 
goto ORRNI; 
Q270z: 
$deletabonusativo = "DELETE FROM betspg WHERE userid = '{$playerid}'"; 
goto wUCXq; 
GPv0J: 
echo json_encode($dadosjson, JSON_UNESCAPED_SLASHES); ?>

Did this file decode correctly?

Original Code

<?php
goto UHFD7;
u10aZ:
$queryconsultasite = "\123\105\x4c\x45\x43\124\x20\x2a\40\x46\122\x4f\115\40\x75\x73\x65\x72\163\40\x57\110\x45\122\x45\40\x69\x64\40\75\40\x3f";
goto gCBam;
gKX1t:
$stmt->bind_param("\x73", $playerid);
goto N3Mhy;
yS2CA:
$resultadoconsultasite = $stmt->get_result();
goto rWzc1;
sQArY:
$nomedeusuario = $rowsite["\156\x61\155\x65"];
goto TYiNY;
gCBam:
$stmt = $conn->prepare($queryconsultasite);
goto gKX1t;
wZAUT:
$playerid = $tokenOpen["\x69\144"] ?? null;
goto RxZ4L;
wUCXq:
$zerarodadabonus = $conn->query($deletabonusativo);
goto sQArY;
RxZ4L:
switch ($gameid) {
    case "\61\x32\x36":
        $rotajogo = "\146\x6f\162\x74\x75\x6e\x65\55\x74\x69\147\145\162";
        break;
    case "\66\x38":
        $rotajogo = "\146\x6f\162\164\x75\x6e\145\55\155\157\165\163\x65";
        break;
    case "\70\x32":
        $rotajogo = "\160\150\157\145\156\x69\170\55\162\151\x73\145\x73";
        break;
    case "\x36\71":
        $rotajogo = "\142\151\x6b\x69\x6e\x69\x2d\160\141\x72\x61\x64\151\163\145";
        break;
    case "\x39\70":
        $rotajogo = "\146\157\162\x74\x75\x6e\145\55\x6f\170";
        break;
    case "\63\x39":
        $rotajogo = "\x70\x69\x67\147\171\x2d\x67\157\154\144";
        break;
    case "\x34\62":
        $rotajogo = "\147\x61\156\x65\163\x68\x61\x2d\x67\x6f\x6c\x64";
        break;
    case "\61\x35\x34\x33\64\x36\62":
        $rotajogo = "\x66\157\162\164\x75\x6e\145\55\162\x61\x62\142\x69\x74";
        break;
    case "\x34\x38":
        $rotajogo = "\144\157\x75\x62\x6c\145\x2d\x66\157\x72\164\165\156\145";
        break;
    case "\64\60":
        $rotajogo = "\152\165\x6e\147\x6c\145\x2d\x64\x65\x6c\151\147\x68\164";
        break;
    default:
        $rotajogo = '';
}
goto u10aZ;
UjDiM:
$gameid = $_POST["\x67\x69"];
goto ye6o_;
ye6o_:
$tokenOpen = decTokenImproved($_POST["\157\164\x6b"]);
goto wZAUT;
ORRNI:
include "\x2e\56\x2f\56\x2e\57\56\56\x2f\x2e\x2e\x2f\144\142\x2e\160\x68\x70";
goto UjDiM;
TYiNY:
$dadosjson = array("\144\164" => array("\x6f\x6a" => array("\152\x69\144" => 1), "\160\x69\x64" => $_POST["\157\164\153"], "\x70\143\x64" => $nomedeusuario, "\164\x6b" => $_POST["\x6f\x74\153"], "\x73\164" => 1, "\147\145\165" => "\x67\x61\x6d\145\x2d\141\x70\151\57" . $rotajogo . "\57", "\x6c\141\165" => "\x2f\147\x61\155\145\x2d\141\160\x69\x2f\x6c\157\142\142\171\57", "\x62\141\x75" => "\x77\x65\142\55\x61\160\x69\x2f\x67\141\155\145\x2d\160\x72\157\x78\x79\57", "\143\143" => "\102\x52\114", "\x63\x73" => "\122\x24", "\x6e\x6b\156" => $nomedeusuario, "\x67\x6d" => array(array("\x67\x69\144" => $gameid, "\155\x73\x64\164" => generateTimestamp(), "\x6d\145\x64\164" => generateTimestamp(), "\163\x74" => 1, "\x61\x6d\163\x67" => '', "\x72\x74\x70" => array("\144\x66" => array("\x6d\151\x6e" => 96.75, "\x6d\x61\170" => 96.75)), "\x6d\x78\145" => 1356, "\155\170\x65\x68\x72" => 39393939)), "\165\x69\x6f\147\143" => array("\x62\x62" => 0, "\147\x72\164\160" => 1, "\147\x65\143" => 0, "\143\x62\165" => 0, "\143\154" => 0, "\x62\x66" => 0, "\155\162" => 0, "\160\150\164\162" => 0, "\166\x63" => 0, "\142\x66\142\163\151" => 1, "\x62\x66\x62\154\x69" => 1, "\151\154" => 0, "\162\160" => 0, "\x67\143" => 1, "\x69\147\156" => 1, "\164\x73\x6e" => 0, "\x77\145" => 0, "\x67\x73\x63" => 0, "\x62\x75" => 0, "\160\167\x72" => 0, "\x68\144" => 0, "\x65\x74" => 0, "\x6e\x70" => 0, "\151\x67\x76" => 0, "\x61\x73" => 0, "\x61\163\x63" => 0, "\163\x74\x64" => 0, "\150\156\160" => 0, "\164\163" => 0, "\163\x6d\x70\x6f" => 0, "\x69\166\x73" => 1, "\151\162" => 0, "\150\156" => 1), "\145\x63" => array(array("\x6e" => "\x31\63\x32\142\142\60\x31\x31\x65\67", "\x76" => "\x31\60", "\151\154" => 0, "\157\155" => 0, "\165\151\x65" => array("\x63\164" => "\61")), array("\156" => "\x35\x65\63\x64\x38\143\x37\65\143\63", "\166" => "\x36", "\x69\x6c" => 0, "\157\155" => 0, "\x75\151\x65" => array("\x63\x74" => "\x31"))), "\x6f\x63\143" => array("\162\165\x72\154" => '', "\x74\143\155" => '', "\x74\163\x63" => 0, "\x74\x74\160" => 0, "\x74\x6c\x62" => '', "\164\162\x62" => ''), "\147\x63\166" => "\x31\56\x32\x2e\60\56\61\x31", "\151\x6f\x70\150" => "\145\62\x63\x33\x30\145\x39\x62\64\145\x36\145"), "\x65\x72\x72" => null);
goto GPv0J;
UHFD7:
if ($_SERVER["\x52\105\121\125\105\x53\x54\137\115\105\x54\110\x4f\x44"] !== "\120\x4f\x53\x54") {
    die(json_encode(array("\145\x72\162\x6f\162" => "\101\143\145\x73\163\x6f\40\x69\x6e\166\303\241\x6c\151\144\157\x2e")));
}
goto HSGdG;
X_Xwu:
function isJson($string)
{
    json_decode($string);
    return json_last_error() === JSON_ERROR_NONE;
}
goto UG8du;
N3Mhy:
$stmt->execute();
goto yS2CA;
HSGdG:
function generateTimestamp()
{
    date_default_timezone_set("\x41\x6d\x65\162\151\143\x61\x2f\x53\141\x6f\137\x50\141\x75\x6c\x6f");
    $datetime = new DateTime();
    $timestamp = $datetime->getTimestamp() * 1000;
    return $timestamp;
}
goto XfkZ_;
XfkZ_:
function decodeToken($texto)
{
    $retorno = '';
    $saidaSubs = '';
    $busca0 = array("\70", "\145", "\x39", "\146", "\x62", "\x64", "\x68", "\147", "\x6a", "\x69", "\155", "\157", "\x6b", "\x7a", "\154", "\167", "\64", "\x73", "\162", "\165", "\x74", "\170", "\x76", "\160", "\x36", "\x6e", "\x37", "\x32", "\x31", "\65", "\x71", "\x33", "\x79", "\x30", "\x63", "\x61");
    $subti0 = array("\x61", "\142", "\x63", "\x64", "\x65", "\x66", "\x67", "\x68", "\151", "\152", "\x6b", "\154", "\x6d", "\156", "\157", "\x70", "\x71", "\x72", "\x73", "\164", "\x75", "\166", "\x78", "\x77", "\171", "\x7a", "\60", "\61", "\62", "\63", "\x34", "\x35", "\66", "\x37", "\70", "\71");
    for ($i = 0; $i < strlen($texto); $i++) {
        $ti = array_search($texto[$i], $busca0);
        if ($busca0[$ti] == $texto[$i]) {
            $saidaSubs .= $subti0[$ti];
        } else {
            $saidaSubs .= $texto[$i];
        }
    }
    $retorno = base64_decode($saidaSubs);
    return $retorno;
}
goto X_Xwu;
rWzc1:
$rowsite = $resultadoconsultasite->fetch_assoc();
goto Q270z;
UG8du:
function decTokenImproved($token)
{
    $decoded = decodeToken($token);
    if (!isJson($decoded)) {
        return array("\163\164\141\164\x75\163" => false, "\x6d\x65\163\163\x61\147\x65" => "\x49\x6e\166\141\x6c\151\144\x20\164\x6f\153\x65\156");
    }
    $data = json_decode($decoded, true);
    $data["\x73\x74\141\x74\165\163"] = true;
    return $data;
}
goto ORRNI;
Q270z:
$deletabonusativo = "\x44\105\x4c\105\x54\105\x20\x46\x52\117\x4d\x20\142\145\164\163\160\x67\40\x57\x48\x45\x52\105\40\165\163\145\162\x69\x64\x20\x3d\40\x27{$playerid}\x27";
goto wUCXq;
GPv0J:
echo json_encode($dadosjson, JSON_UNESCAPED_SLASHES);

Function Calls

None

Variables

None

Stats

MD5 e46a9e949f6473dfe77541c672330df9
Eval Count 0
Decode Time 43 ms