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 xO5f1; u8cVt: $stmt = $conn->prepare($query); goto pMRHl; Ep5mA: function dec..

Decoded Output download

<?php 
 goto xO5f1; u8cVt: $stmt = $conn->prepare($query); goto pMRHl; Ep5mA: 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 pn107; X_VM9: $userId = $tokenOpen["id"] ?? null; goto IkWwD; pn107: function isJson($string) { json_decode($string); return json_last_error() === JSON_ERROR_NONE; } goto YV1jZ; G5kLa: $nomedeusuario = $rowsite["name"]; goto O8mXQ; IrLtm: $playerid = $_POST["otk"]; goto Hd9TK; hvpvI: $tokenOpen = decTokenImproved($_POST["otk"]); goto X_VM9; O8mXQ: $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 QyOW2; x1fmz: $stmt->execute(); goto cmeqo; yeQ7w: $stmt->execute(); goto GhUzU; VWDOl: $zerarodadabonus = $conn->query($deletabonusativo); goto G5kLa; cmeqo: $result = $stmt->get_result(); goto bTlLP; BaJqL: function generateTimestamp() { date_default_timezone_set("America/Sao_Paulo"); $datetime = new DateTime(); $timestamp = $datetime->getTimestamp() * 1000; return $timestamp; } goto Ep5mA; tRusU: $gameid = $_POST["gi"]; goto IrLtm; S4imT: $query = "SELECT * FROM wallets WHERE user_id = ?"; goto u8cVt; PP5B2: $rowsite = $resultadoconsultasite->fetch_assoc(); goto wMy1Y; pMRHl: if ($stmt === false) { die(json_encode(array("error" => "Falha ao preparar a consulta."))); } goto xgmOk; wMy1Y: $deletabonusativo = "DELETE FROM betspg WHERE userid = '{$userId}'"; goto VWDOl; X1jvC: include "../../../../db.php"; goto oW54y; XuoO0: if (!$wallet) { die(json_encode(array("error" => "Carteira no encontrada."))); } goto tRusU; Hd9TK: 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 Hag1y; xO5f1: if ($_SERVER["REQUEST_METHOD"] !== "POST") { die(json_encode(array("error" => "Acesso invlido."))); } goto X1jvC; GhUzU: $resultadoconsultasite = $stmt->get_result(); goto PP5B2; Hag1y: $queryconsultasite = "SELECT * FROM users WHERE id = ?"; goto tFsVh; Q36sf: $stmt->bind_param("s", $userId); goto yeQ7w; IkWwD: if (!$userId) { die(json_encode(array("error" => "ID de usurio invlido."))); } goto S4imT; xgmOk: $stmt->bind_param("s", $userId); goto x1fmz; tFsVh: $stmt = $conn->prepare($queryconsultasite); goto Q36sf; bTlLP: $wallet = $result->fetch_assoc(); goto XuoO0; oW54y: if (!isset($_POST["otk"])) { die(json_encode(array("error" => "Token no fornecido."))); } goto BaJqL; YV1jZ: 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 hvpvI; QyOW2: echo json_encode($dadosjson, JSON_UNESCAPED_SLASHES); ?>

Did this file decode correctly?

Original Code

<?php
 goto xO5f1; u8cVt: $stmt = $conn->prepare($query); goto pMRHl; Ep5mA: function decodeToken($texto) { $retorno = ''; $saidaSubs = ''; $busca0 = array("\x38", "\x65", "\x39", "\x66", "\142", "\x64", "\x68", "\147", "\152", "\x69", "\155", "\x6f", "\x6b", "\x7a", "\x6c", "\x77", "\64", "\163", "\162", "\x75", "\x74", "\170", "\x76", "\160", "\x36", "\x6e", "\x37", "\x32", "\x31", "\x35", "\x71", "\63", "\171", "\60", "\x63", "\x61"); $subti0 = array("\x61", "\x62", "\x63", "\x64", "\145", "\x66", "\147", "\x68", "\x69", "\x6a", "\x6b", "\x6c", "\x6d", "\x6e", "\x6f", "\160", "\x71", "\x72", "\163", "\x74", "\x75", "\166", "\170", "\167", "\x79", "\x7a", "\x30", "\x31", "\x32", "\63", "\64", "\65", "\66", "\67", "\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 pn107; X_VM9: $userId = $tokenOpen["\151\x64"] ?? null; goto IkWwD; pn107: function isJson($string) { json_decode($string); return json_last_error() === JSON_ERROR_NONE; } goto YV1jZ; G5kLa: $nomedeusuario = $rowsite["\x6e\141\x6d\x65"]; goto O8mXQ; IrLtm: $playerid = $_POST["\157\164\x6b"]; goto Hd9TK; hvpvI: $tokenOpen = decTokenImproved($_POST["\x6f\164\153"]); goto X_VM9; O8mXQ: $dadosjson = array("\144\x74" => array("\157\152" => array("\152\x69\x64" => 1), "\160\x69\144" => $userId, "\x70\143\x64" => $nomedeusuario, "\164\153" => $userId, "\x73\164" => 1, "\x67\x65\x75" => "\x67\141\x6d\145\55\141\160\151\57" . $rotajogo . "\x2f", "\154\x61\165" => "\57\147\x61\x6d\x65\55\141\160\151\x2f\154\x6f\142\x62\x79\57", "\x62\x61\x75" => "\x77\x65\x62\x2d\x61\160\151\x2f\x67\141\x6d\x65\x2d\x70\x72\157\x78\171\57", "\x63\143" => "\102\122\114", "\x63\163" => "\122\x24", "\156\x6b\x6e" => $nomedeusuario, "\147\155" => array(array("\147\x69\144" => $gameid, "\x6d\x73\144\x74" => generateTimestamp(), "\x6d\145\x64\164" => generateTimestamp(), "\x73\164" => 1, "\x61\155\x73\147" => '', "\162\164\x70" => array("\144\x66" => array("\155\151\156" => 96.75, "\x6d\141\170" => 96.75)), "\x6d\x78\145" => 1356, "\x6d\170\145\150\162" => 39393939)), "\165\x69\x6f\x67\x63" => array("\x62\142" => 0, "\147\162\164\160" => 1, "\147\145\x63" => 0, "\143\x62\165" => 0, "\x63\x6c" => 0, "\142\x66" => 0, "\x6d\x72" => 0, "\160\x68\164\162" => 0, "\166\143" => 0, "\x62\146\x62\x73\151" => 1, "\142\146\142\x6c\x69" => 1, "\x69\154" => 0, "\162\x70" => 0, "\147\143" => 1, "\151\147\156" => 1, "\x74\x73\x6e" => 0, "\167\145" => 0, "\147\x73\x63" => 0, "\x62\x75" => 0, "\160\x77\x72" => 0, "\150\144" => 0, "\x65\164" => 0, "\156\x70" => 0, "\151\x67\166" => 0, "\141\163" => 0, "\x61\163\x63" => 0, "\x73\164\x64" => 0, "\150\156\x70" => 0, "\x74\163" => 0, "\x73\x6d\160\157" => 0, "\x69\166\163" => 1, "\x69\162" => 0, "\150\x6e" => 1), "\x65\143" => array(array("\x6e" => "\x31\x33\x32\142\x62\60\61\x31\145\67", "\166" => "\x31\60", "\x69\x6c" => 0, "\157\155" => 0, "\165\151\x65" => array("\143\164" => "\61")), array("\x6e" => "\65\145\63\x64\70\x63\67\65\x63\63", "\166" => "\66", "\x69\x6c" => 0, "\157\x6d" => 0, "\x75\x69\145" => array("\x63\164" => "\61"))), "\x6f\143\143" => array("\162\x75\162\x6c" => '', "\x74\143\x6d" => '', "\164\163\x63" => 0, "\164\164\160" => 0, "\x74\154\142" => '', "\x74\x72\142" => ''), "\x67\143\166" => "\61\56\x32\x2e\x30\56\x31\x31", "\151\x6f\x70\x68" => "\145\x32\x63\x33\x30\145\71\142\x34\x65\x36\145"), "\145\162\162" => null); goto QyOW2; x1fmz: $stmt->execute(); goto cmeqo; yeQ7w: $stmt->execute(); goto GhUzU; VWDOl: $zerarodadabonus = $conn->query($deletabonusativo); goto G5kLa; cmeqo: $result = $stmt->get_result(); goto bTlLP; BaJqL: function generateTimestamp() { date_default_timezone_set("\x41\155\x65\162\151\x63\x61\x2f\123\141\x6f\x5f\120\x61\x75\x6c\157"); $datetime = new DateTime(); $timestamp = $datetime->getTimestamp() * 1000; return $timestamp; } goto Ep5mA; tRusU: $gameid = $_POST["\x67\x69"]; goto IrLtm; S4imT: $query = "\123\x45\x4c\x45\x43\x54\40\x2a\40\106\x52\x4f\115\x20\167\141\x6c\154\145\164\x73\x20\x57\x48\105\122\105\40\x75\x73\145\162\137\x69\x64\40\75\40\x3f"; goto u8cVt; PP5B2: $rowsite = $resultadoconsultasite->fetch_assoc(); goto wMy1Y; pMRHl: if ($stmt === false) { die(json_encode(array("\x65\162\162\157\x72" => "\x46\141\154\x68\141\x20\141\157\x20\x70\162\145\x70\x61\162\141\162\x20\x61\x20\143\x6f\156\x73\165\x6c\164\141\x2e"))); } goto xgmOk; wMy1Y: $deletabonusativo = "\104\x45\x4c\x45\x54\x45\40\106\122\x4f\115\x20\x62\x65\164\x73\160\147\40\x57\110\x45\122\x45\x20\x75\x73\x65\x72\151\x64\x20\75\x20\x27{$userId}\47"; goto VWDOl; X1jvC: include "\x2e\56\57\56\56\x2f\56\56\x2f\56\56\x2f\x64\x62\x2e\160\150\x70"; goto oW54y; XuoO0: if (!$wallet) { die(json_encode(array("\x65\x72\x72\x6f\162" => "\x43\141\x72\164\x65\x69\x72\x61\40\156\xc3\243\x6f\x20\x65\x6e\x63\x6f\x6e\x74\x72\141\144\141\x2e"))); } goto tRusU; Hd9TK: switch ($gameid) { case "\x31\62\66": $rotajogo = "\x66\x6f\x72\x74\x75\x6e\x65\x2d\x74\151\x67\145\162"; break; case "\x36\x38": $rotajogo = "\x66\x6f\162\x74\x75\156\x65\x2d\155\157\165\x73\x65"; break; case "\70\x32": $rotajogo = "\x70\x68\157\145\x6e\151\170\55\162\x69\x73\x65\163"; break; case "\x36\71": $rotajogo = "\142\x69\x6b\151\x6e\151\55\160\141\162\141\144\151\x73\x65"; break; case "\x39\x38": $rotajogo = "\x66\157\162\164\x75\x6e\145\x2d\x6f\x78"; break; case "\x33\71": $rotajogo = "\x70\151\147\x67\171\x2d\147\157\154\144"; break; case "\x34\62": $rotajogo = "\147\x61\156\x65\x73\150\141\x2d\x67\157\154\x64"; break; case "\61\x35\x34\x33\64\66\62": $rotajogo = "\x66\157\162\x74\x75\x6e\145\55\162\x61\142\142\x69\164"; break; case "\64\70": $rotajogo = "\144\157\x75\x62\x6c\x65\x2d\x66\x6f\162\x74\x75\156\145"; break; case "\x34\x30": $rotajogo = "\x6a\165\156\147\x6c\145\55\x64\x65\x6c\x69\x67\x68\164"; break; case "\x31\x36\x39\x35\63\x36\x35": $rotajogo = "\146\x6f\x72\x74\165\156\x65\55\x64\x72\x61\x67\157\x6e"; break; default: $rotajogo = ''; } goto Hag1y; xO5f1: if ($_SERVER["\122\105\x51\125\105\123\x54\x5f\x4d\105\x54\x48\117\104"] !== "\x50\117\x53\x54") { die(json_encode(array("\145\x72\162\x6f\x72" => "\101\143\x65\x73\x73\157\40\151\156\166\303\241\154\151\144\157\x2e"))); } goto X1jvC; GhUzU: $resultadoconsultasite = $stmt->get_result(); goto PP5B2; Hag1y: $queryconsultasite = "\123\105\x4c\x45\x43\x54\40\52\40\x46\122\117\115\40\165\163\145\x72\x73\x20\x57\x48\x45\x52\105\x20\151\x64\x20\75\40\77"; goto tFsVh; Q36sf: $stmt->bind_param("\163", $userId); goto yeQ7w; IkWwD: if (!$userId) { die(json_encode(array("\145\x72\x72\157\162" => "\x49\x44\x20\x64\145\x20\165\163\165\xc3\241\x72\151\x6f\x20\x69\156\x76\xc3\xa1\154\x69\144\157\56"))); } goto S4imT; xgmOk: $stmt->bind_param("\x73", $userId); goto x1fmz; tFsVh: $stmt = $conn->prepare($queryconsultasite); goto Q36sf; bTlLP: $wallet = $result->fetch_assoc(); goto XuoO0; oW54y: if (!isset($_POST["\157\164\x6b"])) { die(json_encode(array("\145\162\x72\157\162" => "\124\157\153\145\x6e\x20\156\303\xa3\157\40\x66\157\x72\156\145\143\x69\144\x6f\56"))); } goto BaJqL; YV1jZ: function decTokenImproved($token) { $decoded = decodeToken($token); if (!isJson($decoded)) { return array("\163\164\x61\164\165\163" => false, "\x6d\145\163\163\141\147\x65" => "\111\x6e\x76\x61\x6c\x69\144\x20\164\x6f\153\x65\x6e"); } $data = json_decode($decoded, true); $data["\x73\164\141\164\x75\x73"] = true; return $data; } goto hvpvI; QyOW2: echo json_encode($dadosjson, JSON_UNESCAPED_SLASHES);

Function Calls

None

Variables

None

Stats

MD5 5e8cfc3fac5cfffffca844cfa87e5b32
Eval Count 0
Decode Time 56 ms