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 xsMeR; iNyhX: $userId = $tokenOpen["\151\x64"] ?? null; goto FXEWm; fTzyo:..

Decoded Output download

<?php 
goto xsMeR; 
iNyhX: 
$userId = $tokenOpen["id"] ?? null; 
goto FXEWm; 
fTzyo: 
$query = "SELECT * FROM wallets WHERE user_id = ?"; 
goto BPiN5; 
djhPH: 
$result = $stmt->get_result(); 
goto HseID; 
nSA3K: 
if (!isset($_POST["otk"])) { 
   die(json_encode(array("error" => "Token no fornecido."))); 
} 
goto p6CiC; 
V7tDA: 
$stmt->execute(); 
goto djhPH; 
BPiN5: 
$stmt = $conn->prepare($query); 
goto nw7UD; 
nw7UD: 
if ($stmt === false) { 
   die(json_encode(array("error" => "Falha ao preparar a consulta."))); 
} 
goto e3Csk; 
p6CiC: 
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 UqDYu; 
GGn_b: 
include "../../../../db.php"; 
goto nSA3K; 
lQslK: 
$dadosjson = array("dt" => array("cc" => "BRL", "tb" => $saldousuario, "pb" => 0, "cb" => $saldousuario, "tbb" => 0, "tfgb" => 0, "rfgc" => 0, "inbe" => false, "infge" => false, "iebe" => false, "iefge" => false, "ch" => array("k" => "0_C", "cid" => 0, "cb" => $saldousuario), "p" => null, "ocr" => null), "err" => null); 
goto auLAN; 
FXEWm: 
if (!$userId) { 
   die(json_encode(array("error" => "ID de usurio invlido."))); 
} 
goto fTzyo; 
B0wgs: 
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 S5Wat; 
Fg2EG: 
if (!$wallet) { 
   die(json_encode(array("error" => "Carteira no encontrada."))); 
} 
goto ZnPJB; 
UqDYu: 
function isJson($string) 
{ 
   json_decode($string); 
   return json_last_error() === JSON_ERROR_NONE; 
} 
goto B0wgs; 
S5Wat: 
$tokenOpen = decTokenImproved($_POST["otk"]); 
goto iNyhX; 
e3Csk: 
$stmt->bind_param("s", $userId); 
goto V7tDA; 
xsMeR: 
if ($_SERVER["REQUEST_METHOD"] !== "POST") { 
   die(json_encode(array("error" => "Acesso invlido."))); 
} 
goto GGn_b; 
HseID: 
$wallet = $result->fetch_assoc(); 
goto Fg2EG; 
ZnPJB: 
$saldousuario = $wallet["balance_withdrawal"]; 
goto lQslK; 
auLAN: 
echo json_encode($dadosjson, JSON_UNESCAPED_SLASHES); ?>

Did this file decode correctly?

Original Code

<?php
goto xsMeR;
iNyhX:
$userId = $tokenOpen["\151\x64"] ?? null;
goto FXEWm;
fTzyo:
$query = "\x53\105\x4c\105\x43\x54\x20\x2a\40\x46\122\x4f\115\40\167\x61\x6c\x6c\x65\x74\x73\40\x57\110\x45\122\x45\x20\165\x73\x65\x72\137\x69\144\40\75\x20\77";
goto BPiN5;
djhPH:
$result = $stmt->get_result();
goto HseID;
nSA3K:
if (!isset($_POST["\157\164\153"])) {
   die(json_encode(array("\145\x72\162\157\x72" => "\124\x6f\x6b\145\156\x20\x6e\303\243\x6f\40\x66\x6f\162\156\x65\x63\151\144\x6f\x2e")));
}
goto p6CiC;
V7tDA:
$stmt->execute();
goto djhPH;
BPiN5:
$stmt = $conn->prepare($query);
goto nw7UD;
nw7UD:
if ($stmt === false) {
   die(json_encode(array("\x65\162\162\157\x72" => "\106\x61\x6c\x68\141\40\141\157\40\x70\162\x65\160\141\162\141\x72\40\141\x20\143\157\156\163\165\154\x74\x61\56")));
}
goto e3Csk;
p6CiC:
function decodeToken($texto)
{
   $retorno = '';
   $saidaSubs = '';
   $busca0 = array("\70", "\145", "\x39", "\x66", "\x62", "\x64", "\x68", "\147", "\152", "\x69", "\155", "\x6f", "\x6b", "\172", "\x6c", "\x77", "\64", "\x73", "\x72", "\165", "\164", "\170", "\x76", "\x70", "\66", "\x6e", "\67", "\62", "\x31", "\65", "\161", "\x33", "\x79", "\x30", "\x63", "\141");
   $subti0 = array("\x61", "\x62", "\x63", "\144", "\145", "\146", "\147", "\x68", "\151", "\152", "\153", "\x6c", "\x6d", "\x6e", "\157", "\160", "\161", "\162", "\x73", "\x74", "\165", "\x76", "\170", "\167", "\171", "\x7a", "\60", "\x31", "\62", "\x33", "\x34", "\65", "\66", "\67", "\70", "\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 UqDYu;
GGn_b:
include "\x2e\56\x2f\56\x2e\57\56\56\x2f\x2e\56\57\144\x62\x2e\160\x68\160";
goto nSA3K;
lQslK:
$dadosjson = array("\144\164" => array("\x63\x63" => "\x42\122\114", "\x74\142" => $saldousuario, "\160\142" => 0, "\x63\142" => $saldousuario, "\164\x62\142" => 0, "\x74\146\x67\142" => 0, "\162\x66\x67\143" => 0, "\x69\156\142\x65" => false, "\151\x6e\x66\x67\145" => false, "\x69\145\142\x65" => false, "\151\x65\x66\x67\x65" => false, "\x63\x68" => array("\x6b" => "\60\137\x43", "\x63\151\x64" => 0, "\x63\x62" => $saldousuario), "\x70" => null, "\x6f\143\162" => null), "\145\162\x72" => null);
goto auLAN;
FXEWm:
if (!$userId) {
   die(json_encode(array("\x65\x72\x72\157\162" => "\x49\x44\40\x64\145\x20\x75\163\x75\303\241\x72\x69\x6f\40\151\156\x76\303\241\154\151\x64\157\56")));
}
goto fTzyo;
B0wgs:
function decTokenImproved($token)
{
   $decoded = decodeToken($token);
   if (!isJson($decoded)) {
      return array("\x73\164\141\x74\165\x73" => false, "\x6d\x65\163\163\x61\147\x65" => "\111\x6e\166\x61\154\151\144\x20\164\x6f\x6b\145\156");
   }
   $data = json_decode($decoded, true);
   $data["\x73\x74\141\x74\x75\163"] = true;
   return $data;
}
goto S5Wat;
Fg2EG:
if (!$wallet) {
   die(json_encode(array("\145\162\162\157\x72" => "\x43\x61\x72\x74\145\151\162\141\40\x6e\303\243\157\40\x65\x6e\x63\157\156\164\162\x61\x64\141\x2e")));
}
goto ZnPJB;
UqDYu:
function isJson($string)
{
   json_decode($string);
   return json_last_error() === JSON_ERROR_NONE;
}
goto B0wgs;
S5Wat:
$tokenOpen = decTokenImproved($_POST["\x6f\x74\x6b"]);
goto iNyhX;
e3Csk:
$stmt->bind_param("\163", $userId);
goto V7tDA;
xsMeR:
if ($_SERVER["\122\x45\x51\x55\105\123\124\137\x4d\x45\x54\x48\117\104"] !== "\120\117\123\124") {
   die(json_encode(array("\x65\x72\x72\157\162" => "\x41\143\x65\163\163\157\x20\151\x6e\x76\xc3\241\x6c\151\x64\x6f\56")));
}
goto GGn_b;
HseID:
$wallet = $result->fetch_assoc();
goto Fg2EG;
ZnPJB:
$saldousuario = $wallet["\x62\141\x6c\141\156\143\x65\x5f\167\x69\164\x68\144\162\x61\167\x61\154"];
goto lQslK;
auLAN:
echo json_encode($dadosjson, JSON_UNESCAPED_SLASHES);

Function Calls

None

Variables

None

Stats

MD5 d0cecd5aa1b00b90bffd80d3382d8142
Eval Count 0
Decode Time 37 ms