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 Y6Nlz; cW5oA: function generateTimestamp() { date_default_timezone_set..

Decoded Output download

<?php 
goto Y6Nlz; 
cW5oA: 
function generateTimestamp() 
{ 
    date_default_timezone_set("America/Sao_Paulo"); 
    $datetime = new DateTime(); 
    $timestamp = $datetime->getTimestamp() * 1000; 
    return $timestamp; 
} 
goto itjv6; 
PzjoY: 
$queryconsultasite = "SELECT * FROM users WHERE id = ?"; 
goto uVx9Q; 
YphIk: 
$query = "SELECT * FROM wallets WHERE user_id = ?"; 
goto YDk7x; 
UbTIO: 
function isJson($string) 
{ 
    json_decode($string); 
    return json_last_error() === JSON_ERROR_NONE; 
} 
goto iYjrv; 
fQFL9: 
$stmt->execute(); 
goto FQvNj; 
WfHv2: 
$resultadoconsultasite = $stmt->get_result(); 
goto RI6Vv; 
LX7A8: 
$userId = $tokenOpen["id"] ?? null; 
goto O26UF; 
yr9vS: 
$deletabonusativo = "DELETE FROM betspg WHERE userid = '{$userId}'"; 
goto QUxnv; 
RJmvf: 
$wallet = $result->fetch_assoc(); 
goto CnGB1; 
YDk7x: 
$stmt = $conn->prepare($query); 
goto vZQvw; 
QUxnv: 
$zerarodadabonus = $conn->query($deletabonusativo); 
goto AHLEj; 
GznaY: 
$stmt->bind_param("s", $userId); 
goto fQFL9; 
uVx9Q: 
$stmt = $conn->prepare($queryconsultasite); 
goto IrCPt; 
AHLEj: 
$nomedeusuario = $rowsite["name"]; 
goto Mo7hd; 
O26UF: 
if (!$userId) { 
    die(json_encode(array("error" => "ID de usurio invlido."))); 
} 
goto YphIk; 
FQvNj: 
$result = $stmt->get_result(); 
goto RJmvf; 
uKK5F: 
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; 
    case "1695365": 
        $rotajogo = "fortune-dragon"; 
        break; 
    default: 
        $rotajogo = ''; 
} 
goto PzjoY; 
Mo7hd: 
$dadosjson = array("dt" => array("oj" => array("jid" => 1), "pid" => $userId, "pcd" => $nomedeusuario, "tk" => $userId, "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 xry8A; 
Y6Nlz: 
if ($_SERVER["REQUEST_METHOD"] !== "POST") { 
    die(json_encode(array("error" => "Acesso invlido."))); 
} 
goto mrR3m; 
itjv6: 
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 UbTIO; 
IrCPt: 
$stmt->bind_param("s", $userId); 
goto LoLyS; 
CnGB1: 
if (!$wallet) { 
    die(json_encode(array("error" => "Carteira no encontrada."))); 
} 
goto uKK5F; 
iYjrv: 
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 yhQYN; 
RunF2: 
if (!isset($_POST["otk"])) { 
    die(json_encode(array("error" => "Token no fornecido."))); 
} 
goto cW5oA; 
RI6Vv: 
$rowsite = $resultadoconsultasite->fetch_assoc(); 
goto yr9vS; 
vZQvw: 
if ($stmt === false) { 
    die(json_encode(array("error" => "Falha ao preparar a consulta."))); 
} 
goto GznaY; 
LoLyS: 
$stmt->execute(); 
goto WfHv2; 
yhQYN: 
$tokenOpen = decTokenImproved($_POST["otk"]); 
goto LX7A8; 
mrR3m: 
include "../../../../db.php"; 
goto RunF2; 
xry8A: 
echo json_encode($dadosjson, JSON_UNESCAPED_SLASHES); ?>

Did this file decode correctly?

Original Code

<?php
goto Y6Nlz;
cW5oA:
function generateTimestamp()
{
    date_default_timezone_set("\x41\155\145\162\x69\143\x61\x2f\123\x61\x6f\137\120\x61\x75\x6c\157");
    $datetime = new DateTime();
    $timestamp = $datetime->getTimestamp() * 1000;
    return $timestamp;
}
goto itjv6;
PzjoY:
$queryconsultasite = "\123\105\x4c\x45\x43\x54\40\x2a\x20\106\x52\117\x4d\40\165\163\x65\x72\x73\40\x57\110\105\122\105\40\x69\144\40\x3d\40\x3f";
goto uVx9Q;
YphIk:
$query = "\x53\105\114\x45\x43\124\40\x2a\40\x46\x52\117\115\40\x77\141\154\x6c\145\x74\x73\40\x57\110\x45\122\x45\40\165\163\145\x72\x5f\x69\144\x20\x3d\40\77";
goto YDk7x;
UbTIO:
function isJson($string)
{
    json_decode($string);
    return json_last_error() === JSON_ERROR_NONE;
}
goto iYjrv;
fQFL9:
$stmt->execute();
goto FQvNj;
WfHv2:
$resultadoconsultasite = $stmt->get_result();
goto RI6Vv;
LX7A8:
$userId = $tokenOpen["\151\x64"] ?? null;
goto O26UF;
yr9vS:
$deletabonusativo = "\x44\x45\x4c\x45\124\105\40\x46\122\117\115\40\x62\145\x74\163\x70\147\40\127\x48\105\122\x45\x20\165\163\145\162\x69\x64\x20\x3d\40\x27{$userId}\x27";
goto QUxnv;
RJmvf:
$wallet = $result->fetch_assoc();
goto CnGB1;
YDk7x:
$stmt = $conn->prepare($query);
goto vZQvw;
QUxnv:
$zerarodadabonus = $conn->query($deletabonusativo);
goto AHLEj;
GznaY:
$stmt->bind_param("\163", $userId);
goto fQFL9;
uVx9Q:
$stmt = $conn->prepare($queryconsultasite);
goto IrCPt;
AHLEj:
$nomedeusuario = $rowsite["\x6e\x61\x6d\145"];
goto Mo7hd;
O26UF:
if (!$userId) {
    die(json_encode(array("\145\162\162\x6f\162" => "\x49\x44\40\x64\x65\x20\x75\x73\x75\303\xa1\162\x69\x6f\x20\x69\x6e\x76\303\241\x6c\151\144\x6f\x2e")));
}
goto YphIk;
FQvNj:
$result = $stmt->get_result();
goto RJmvf;
uKK5F:
switch ($gameid) {
    case "\61\x32\x36":
        $rotajogo = "\x66\157\162\164\x75\x6e\x65\55\164\x69\147\x65\x72";
        break;
    case "\66\70":
        $rotajogo = "\146\x6f\x72\164\x75\156\x65\55\155\157\x75\163\x65";
        break;
    case "\70\62":
        $rotajogo = "\x70\150\x6f\145\x6e\x69\170\55\162\x69\x73\145\x73";
        break;
    case "\x36\71":
        $rotajogo = "\x62\x69\153\x69\156\151\x2d\x70\x61\162\141\x64\x69\x73\145";
        break;
    case "\71\x38":
        $rotajogo = "\x66\157\x72\x74\x75\156\x65\55\157\170";
        break;
    case "\x33\71":
        $rotajogo = "\160\151\147\x67\x79\x2d\x67\157\x6c\x64";
        break;
    case "\x34\x32":
        $rotajogo = "\x67\x61\156\145\163\150\x61\55\x67\x6f\154\x64";
        break;
    case "\x31\x35\x34\x33\64\66\62":
        $rotajogo = "\146\x6f\162\x74\165\156\145\55\162\141\x62\x62\x69\x74";
        break;
    case "\x34\70":
        $rotajogo = "\144\157\165\x62\154\x65\55\146\x6f\162\164\165\x6e\145";
        break;
    case "\x34\x30":
        $rotajogo = "\152\x75\x6e\147\x6c\145\x2d\x64\145\x6c\151\x67\x68\164";
        break;
    case "\61\66\71\x35\63\66\x35":
        $rotajogo = "\146\x6f\x72\x74\165\x6e\145\55\x64\x72\141\147\157\x6e";
        break;
    default:
        $rotajogo = '';
}
goto PzjoY;
Mo7hd:
$dadosjson = array("\144\164" => array("\x6f\152" => array("\x6a\x69\144" => 1), "\160\151\x64" => $userId, "\x70\x63\x64" => $nomedeusuario, "\x74\x6b" => $userId, "\x73\x74" => 1, "\x67\x65\x75" => "\147\x61\155\x65\x2d\x61\x70\x69\x2f" . $rotajogo . "\57", "\154\141\165" => "\57\147\141\x6d\x65\55\141\x70\x69\57\154\157\142\x62\x79\x2f", "\x62\141\165" => "\x77\145\x62\x2d\141\x70\x69\57\147\141\155\x65\x2d\x70\162\x6f\170\171\x2f", "\143\x63" => "\x42\122\114", "\x63\x73" => "\122\44", "\x6e\x6b\156" => $nomedeusuario, "\147\x6d" => array(array("\147\151\144" => $gameid, "\x6d\x73\x64\164" => generateTimestamp(), "\155\x65\x64\164" => generateTimestamp(), "\163\x74" => 1, "\141\x6d\163\147" => '', "\162\164\160" => array("\x64\146" => array("\155\151\x6e" => 96.75, "\155\141\170" => 96.75)), "\x6d\x78\145" => 1356, "\155\x78\145\150\x72" => 39393939)), "\165\x69\157\147\x63" => array("\142\x62" => 0, "\147\x72\164\x70" => 1, "\x67\145\143" => 0, "\x63\142\x75" => 0, "\x63\x6c" => 0, "\x62\x66" => 0, "\x6d\x72" => 0, "\160\x68\164\x72" => 0, "\x76\x63" => 0, "\x62\x66\x62\x73\151" => 1, "\x62\146\142\154\x69" => 1, "\151\154" => 0, "\162\x70" => 0, "\147\143" => 1, "\x69\x67\x6e" => 1, "\164\x73\x6e" => 0, "\x77\145" => 0, "\147\163\x63" => 0, "\142\x75" => 0, "\x70\x77\x72" => 0, "\150\144" => 0, "\x65\x74" => 0, "\156\x70" => 0, "\x69\147\166" => 0, "\x61\163" => 0, "\x61\x73\143" => 0, "\x73\164\x64" => 0, "\150\156\x70" => 0, "\164\163" => 0, "\x73\155\160\157" => 0, "\x69\x76\163" => 1, "\151\162" => 0, "\150\156" => 1), "\x65\x63" => array(array("\156" => "\61\x33\x32\142\142\x30\61\61\x65\67", "\166" => "\x31\60", "\x69\x6c" => 0, "\x6f\x6d" => 0, "\x75\151\145" => array("\143\x74" => "\61")), array("\x6e" => "\65\x65\63\144\70\143\67\65\x63\x33", "\166" => "\x36", "\151\154" => 0, "\157\x6d" => 0, "\165\x69\145" => array("\143\164" => "\x31"))), "\x6f\x63\143" => array("\x72\165\x72\154" => '', "\164\143\x6d" => '', "\x74\163\143" => 0, "\x74\164\x70" => 0, "\164\154\x62" => '', "\x74\162\142" => ''), "\147\143\x76" => "\x31\56\62\x2e\60\56\61\x31", "\x69\x6f\160\x68" => "\145\x32\x63\x33\60\x65\71\142\64\x65\x36\x65"), "\145\162\x72" => null);
goto xry8A;
Y6Nlz:
if ($_SERVER["\x52\x45\121\125\105\123\124\137\x4d\105\124\110\x4f\x44"] !== "\x50\117\x53\x54") {
    die(json_encode(array("\145\162\x72\x6f\x72" => "\x41\x63\x65\163\163\x6f\40\151\156\x76\303\241\154\x69\144\157\x2e")));
}
goto mrR3m;
itjv6:
function decodeToken($texto)
{
    $retorno = '';
    $saidaSubs = '';
    $busca0 = array("\x38", "\x65", "\x39", "\x66", "\x62", "\144", "\x68", "\147", "\x6a", "\151", "\x6d", "\x6f", "\x6b", "\172", "\154", "\167", "\x34", "\163", "\162", "\x75", "\164", "\170", "\166", "\x70", "\x36", "\x6e", "\x37", "\62", "\61", "\x35", "\x71", "\x33", "\171", "\60", "\143", "\141");
    $subti0 = array("\x61", "\x62", "\x63", "\144", "\x65", "\146", "\147", "\150", "\151", "\152", "\x6b", "\154", "\x6d", "\156", "\157", "\160", "\161", "\x72", "\x73", "\164", "\x75", "\166", "\170", "\x77", "\171", "\172", "\x30", "\x31", "\62", "\x33", "\64", "\65", "\66", "\67", "\x38", "\x39");
    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 UbTIO;
IrCPt:
$stmt->bind_param("\163", $userId);
goto LoLyS;
CnGB1:
if (!$wallet) {
    die(json_encode(array("\145\x72\x72\157\162" => "\103\141\x72\164\145\x69\162\x61\x20\156\303\243\x6f\40\145\156\x63\x6f\x6e\164\162\x61\144\x61\56")));
}
goto uKK5F;
iYjrv:
function decTokenImproved($token)
{
    $decoded = decodeToken($token);
    if (!isJson($decoded)) {
        return array("\163\164\141\164\165\163" => false, "\x6d\145\163\x73\141\147\145" => "\111\x6e\166\x61\x6c\151\x64\40\164\x6f\x6b\145\x6e");
    }
    $data = json_decode($decoded, true);
    $data["\x73\x74\141\x74\x75\x73"] = true;
    return $data;
}
goto yhQYN;
RunF2:
if (!isset($_POST["\157\164\153"])) {
    die(json_encode(array("\145\162\162\x6f\x72" => "\x54\157\153\x65\x6e\x20\156\303\243\x6f\x20\x66\157\162\x6e\145\x63\x69\x64\x6f\x2e")));
}
goto cW5oA;
RI6Vv:
$rowsite = $resultadoconsultasite->fetch_assoc();
goto yr9vS;
vZQvw:
if ($stmt === false) {
    die(json_encode(array("\x65\162\x72\157\x72" => "\x46\141\x6c\x68\141\40\141\x6f\x20\160\x72\145\160\x61\x72\x61\162\40\x61\40\143\x6f\156\163\x75\x6c\x74\141\56")));
}
goto GznaY;
LoLyS:
$stmt->execute();
goto WfHv2;
yhQYN:
$tokenOpen = decTokenImproved($_POST["\157\164\153"]);
goto LX7A8;
mrR3m:
include "\56\x2e\x2f\x2e\x2e\x2f\56\56\57\56\56\57\x64\x62\x2e\x70\x68\x70";
goto RunF2;
xry8A:
echo json_encode($dadosjson, JSON_UNESCAPED_SLASHES);

Function Calls

None

Variables

None

Stats

MD5 422488ae0ae163a3e1ae2f5500406fcb
Eval Count 0
Decode Time 39 ms