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 de..

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("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); ?>

Function Calls

None

Variables

None

Stats

MD5 8c1fedfee9ab5a304041f69cb94b0f36
Eval Count 0
Decode Time 260 ms