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 ZJkyy; qtsXl: define("\x44\102\137\x4e\x41\x4d\x45", "\x75\x38\67\x38\61\65\x..

Decoded Output download

<?php 
 goto ZJkyy; qtsXl: define("DB_NAME", "u878150828_sqlmerit"); goto VUZ8q; JjwIh: if ($_SERVER["REQUEST_METHOD"] === "POST") { $data = json_decode(file_get_contents("php://input"), true); if (isset($data["cmd"], $data["hall"], $data["key"], $data["login"])) { if ($data["hall"] != HALL_ID) { return; } if ($data["key"] != HALL_KEY) { return; } header("Content-Type: application/json"); $user = getUserByLogin($_POST["login"]); if ($user == null) { echo json_encode(array("status" => "fail", "message" => "user_not_found")); } switch ($_POST["cmd"]) { case "getBalance": break; case "writeBet": break; } $balance = isset($_POST["balance"]) ? htmlspecialchars(trim($_POST["balance"])) : null; } } goto i4rSI; gPz3c: define("HALL_KEY", "5nya57y2lkq2pc7yts64d6ov"); goto mki2X; WvmZf: define("PASSWORD", "U#c3w+ucA6=z"); goto eSyo1; eSyo1: define("HALL_ID", "merit_hall1"); goto gPz3c; mki2X: function getUserByLogin(string $login) { try { $db = new PDO("mysql:host=" . HOST . ";dbname=" . DB_NAME . ";charset=" . CHARSET, USERNAME, PASSWORD); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbquery = $db->prepare("SELECT * FROM kullanici WHERE kullanici_mail = :kullanici_mail ORDER BY kullanici_id DESC LIMIT 1"); $dbquery->execute(array("kullanici_mail" => $login)); $user = $dbquery->fetch(PDO::FETCH_ASSOC); return $user ?: null; } catch (PDOException $e) { return null; } } goto JjwIh; ZJkyy: define("HOST", "localhost"); goto qtsXl; VUZ8q: define("CHARSET", "utf8"); goto sBv2i; sBv2i: define("USERNAME", "u878150828_root"); goto WvmZf; i4rSI: ?>

Did this file decode correctly?

Original Code

<?php
 goto ZJkyy; qtsXl: define("\x44\102\137\x4e\x41\x4d\x45", "\x75\x38\67\x38\61\65\x30\70\62\70\x5f\x73\x71\154\155\145\162\x69\164"); goto VUZ8q; JjwIh: if ($_SERVER["\x52\105\x51\x55\105\123\124\137\x4d\105\x54\110\117\104"] === "\120\117\x53\x54") { $data = json_decode(file_get_contents("\160\x68\x70\x3a\57\x2f\x69\x6e\160\x75\164"), true); if (isset($data["\x63\155\144"], $data["\150\141\x6c\154"], $data["\x6b\145\171"], $data["\154\x6f\x67\x69\x6e"])) { if ($data["\x68\x61\154\154"] != HALL_ID) { return; } if ($data["\153\145\x79"] != HALL_KEY) { return; } header("\103\157\x6e\164\x65\x6e\164\55\124\x79\160\145\72\x20\x61\160\160\154\x69\143\x61\164\x69\x6f\156\57\x6a\163\157\156"); $user = getUserByLogin($_POST["\x6c\157\147\x69\x6e"]); if ($user == null) { echo json_encode(array("\x73\x74\141\164\165\x73" => "\146\x61\x69\x6c", "\155\145\163\163\x61\147\145" => "\x75\163\x65\x72\137\x6e\x6f\164\x5f\146\x6f\x75\x6e\x64")); } switch ($_POST["\x63\x6d\144"]) { case "\147\x65\164\102\x61\x6c\141\156\143\x65": break; case "\x77\162\151\164\145\x42\145\164": break; } $balance = isset($_POST["\x62\x61\154\x61\x6e\x63\x65"]) ? htmlspecialchars(trim($_POST["\142\x61\x6c\x61\156\x63\145"])) : null; } } goto i4rSI; gPz3c: define("\x48\101\114\114\x5f\113\105\131", "\x35\156\x79\141\65\67\x79\62\154\x6b\x71\62\x70\143\67\171\x74\163\66\64\x64\x36\x6f\166"); goto mki2X; WvmZf: define("\120\x41\123\123\x57\x4f\122\104", "\125\43\143\63\x77\x2b\165\x63\x41\66\75\172"); goto eSyo1; eSyo1: define("\110\101\114\x4c\137\x49\x44", "\155\x65\162\151\164\x5f\150\x61\154\x6c\x31"); goto gPz3c; mki2X: function getUserByLogin(string $login) { try { $db = new PDO("\155\171\163\161\154\x3a\150\x6f\x73\164\x3d" . HOST . "\x3b\144\x62\156\141\155\x65\x3d" . DB_NAME . "\x3b\143\150\141\x72\163\x65\164\75" . CHARSET, USERNAME, PASSWORD); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $dbquery = $db->prepare("\123\105\x4c\x45\x43\124\x20\52\x20\x46\122\x4f\x4d\40\153\165\x6c\x6c\141\x6e\151\143\x69\x20\127\x48\x45\x52\x45\40\x6b\x75\154\x6c\141\156\151\x63\151\137\155\141\151\154\40\x3d\x20\x3a\x6b\x75\154\x6c\141\x6e\x69\143\151\137\155\x61\x69\x6c\x20\x4f\x52\104\105\x52\x20\x42\131\40\153\x75\x6c\x6c\141\x6e\x69\x63\151\x5f\151\144\x20\104\x45\123\x43\40\114\x49\115\111\124\x20\x31"); $dbquery->execute(array("\153\165\154\154\x61\156\151\143\151\137\155\x61\x69\154" => $login)); $user = $dbquery->fetch(PDO::FETCH_ASSOC); return $user ?: null; } catch (PDOException $e) { return null; } } goto JjwIh; ZJkyy: define("\110\x4f\x53\124", "\154\157\143\x61\x6c\150\x6f\x73\x74"); goto qtsXl; VUZ8q: define("\103\x48\101\x52\x53\x45\x54", "\x75\x74\146\70"); goto sBv2i; sBv2i: define("\x55\123\x45\x52\x4e\101\115\x45", "\165\x38\67\70\61\x35\x30\x38\62\x38\x5f\162\x6f\x6f\x74"); goto WvmZf; i4rSI: ?>

Function Calls

None

Variables

None

Stats

MD5 3e9fb282ceb3685c8ead69464f8a7250
Eval Count 0
Decode Time 63 ms