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 namespace GencWeb; require_once __DIR__ . "\57\104\102\57\107\145\156\143\x77\145\..

Decoded Output download

<?php 
 namespace GencWeb; require_once __DIR__ . "/DB/Gencweb.DB.class.php"; use DB; use Log; class GW { public $DB; public $IP; public function __construct() { $this->DB = new DB(parse_ini_file(__DIR__ . "/../DB.ini.php")); if (!empty($_SERVER["HTTP_CLIENT_IP"])) { $this->IP = $_SERVER["HTTP_CLIENT_IP"]; } elseif (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) { $this->IP = $_SERVER["HTTP_X_FORWARDED_FOR"]; } else { $this->IP = $_SERVER["REMOTE_ADDR"]; } } public static function Log($Message = "Empty") { $Log = new Log(); $Log->write($Message); } public static function PrintDate($datetime = "now", $format = "d F Y H:i:s") { $z = date("{$format}", strtotime($datetime)); $gun_dizi = array("Monday" => "Pazartesi", "Tuesday" => "Sal", "Wednesday" => "aramba", "Thursday" => "Perembe", "Friday" => "Cuma", "Saturday" => "Cumartesi", "Sunday" => "Pazar", "January" => "Ocak", "February" => "ubat", "March" => "Mart", "April" => "Nisan", "May" => "Mays", "June" => "Haziran", "July" => "Temmuz", "August" => "Austos", "September" => "Eyll", "October" => "Ekim", "November" => "Kasm", "December" => "Aralk", "Mon" => "Pts", "Tue" => "Sal", "Wed" => "ar", "Thu" => "Per", "Fri" => "Cum", "Sat" => "Cts", "Sun" => "Paz", "Jan" => "Oca", "Feb" => "ub", "Mar" => "Mar", "Apr" => "Nis", "Jun" => "Haz", "Jul" => "Tem", "Aug" => "Au", "Sep" => "Eyl", "Oct" => "Eki", "Nov" => "Kas", "Dec" => "Ara"); foreach ($gun_dizi as $en => $tr) { $z = str_replace($en, $tr, $z); } if (strpos($z, "Mays") !== false && strpos($format, "F") === false) { $z = str_replace("Mays", "May", $z); } return $z; } public static function GET($key, $default = NULL) { return array_key_exists($key, $_GET) ? $_GET[$key] : $default; } public static function POST($key, $default = NULL) { return array_key_exists($key, $_POST) ? $_POST[$key] : $default; } public static function FILES($key, $default = NULL) { return array_key_exists($key, $_FILES) ? $_FILES[$key] : $default; } public static function Encode($string) { return json_encode($string, JSON_UNESCAPED_UNICODE); } public static function Decode($string) { return json_decode($string, true); } public static function ReadJSON($filedir) { $file = file_get_contents($filedir); return self::Decode($file); } public static function GenerateRandomID($digits = 4) { $temp_RandomID = rand(1, 9); $temp_Digits = 0; while ($temp_Digits < $digits - 1) { $temp_CreatedRandom = rand(1, 9); $temp_RandomID .= $temp_CreatedRandom; $temp_Digits++; } return $temp_RandomID; } public static function UploadImage($File, $Dir) { $ImageDir = str_replace("/", DIRECTORY_SEPARATOR, $Dir); $ImageDir = $_SERVER["DOCUMENT_ROOT"] . $ImageDir; $RandomCode = self::GenerateRandomID(6); $ImageDir .= "GW" . $RandomCode . "." . pathinfo($File["name"], PATHINFO_EXTENSION); $ImageDirOnDB = $Dir . "GW" . $RandomCode . "." . pathinfo($File["name"], PATHINFO_EXTENSION); if (move_uploaded_file($File["tmp_name"], $ImageDir)) { return $ImageDirOnDB; } else { return false; } } public function GetIP() { return $this->IP; } } include_once "Gencweb.Route.class.php"; include_once "Gencweb.Utils.class.php"; include_once "Gencweb.User.class.php"; include_all_php(__DIR__ . "/../../routes/"); date_default_timezone_set("Europe/Istanbul"); if (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] == "off") { $httpsredirect = "https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; header("HTTP/1.1 301 Moved Permanently"); header("Location: " . $httpsredirect); die; } function include_all_php($folder) { foreach (glob("{$folder}/*.php") as $filename) { include_once $filename; } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace GencWeb; require_once __DIR__ . "\57\104\102\57\107\145\156\143\x77\145\x62\x2e\104\x42\x2e\143\154\141\163\x73\56\160\150\160"; use DB; use Log; class GW { public $DB; public $IP; public function __construct() { $this->DB = new DB(parse_ini_file(__DIR__ . "\x2f\x2e\x2e\x2f\104\x42\56\151\156\151\56\x70\x68\x70")); if (!empty($_SERVER["\x48\x54\124\x50\137\103\114\x49\105\x4e\x54\x5f\x49\x50"])) { $this->IP = $_SERVER["\110\x54\124\x50\x5f\103\x4c\111\105\x4e\x54\137\111\x50"]; } elseif (!empty($_SERVER["\x48\x54\x54\x50\x5f\130\x5f\106\117\x52\x57\x41\x52\x44\x45\104\x5f\106\x4f\x52"])) { $this->IP = $_SERVER["\110\124\x54\x50\x5f\130\137\x46\117\x52\x57\x41\x52\104\105\104\137\x46\117\122"]; } else { $this->IP = $_SERVER["\122\105\115\x4f\x54\105\137\101\x44\104\122"]; } } public static function Log($Message = "\x45\x6d\x70\164\x79") { $Log = new Log(); $Log->write($Message); } public static function PrintDate($datetime = "\156\157\x77", $format = "\144\40\106\40\131\x20\x48\x3a\151\72\163") { $z = date("{$format}", strtotime($datetime)); $gun_dizi = array("\115\157\x6e\144\x61\x79" => "\120\141\x7a\141\162\164\x65\x73\x69", "\x54\x75\145\x73\x64\141\x79" => "\123\141\x6c\xc4\261", "\127\x65\x64\x6e\x65\163\x64\x61\171" => "\303\207\x61\162\xc5\237\x61\x6d\142\x61", "\124\150\x75\162\163\144\141\171" => "\x50\145\162\305\x9f\x65\155\142\x65", "\x46\x72\x69\x64\x61\171" => "\x43\x75\155\x61", "\x53\141\164\x75\x72\144\141\x79" => "\103\165\x6d\141\162\164\145\x73\x69", "\123\165\156\144\141\x79" => "\x50\x61\x7a\x61\162", "\x4a\141\156\x75\x61\162\171" => "\x4f\143\x61\153", "\106\145\142\162\165\x61\x72\171" => "\305\236\165\142\x61\x74", "\x4d\141\x72\x63\x68" => "\115\x61\162\164", "\101\x70\162\x69\x6c" => "\x4e\x69\163\x61\x6e", "\115\141\x79" => "\x4d\141\x79\304\xb1\x73", "\112\165\156\x65" => "\x48\141\172\x69\x72\x61\156", "\112\165\x6c\171" => "\x54\145\x6d\x6d\x75\x7a", "\x41\x75\147\165\x73\x74" => "\x41\304\x9f\165\163\164\157\x73", "\123\x65\x70\164\x65\155\x62\145\x72" => "\x45\x79\154\303\274\x6c", "\x4f\143\x74\157\142\x65\162" => "\x45\153\x69\155", "\x4e\157\x76\145\x6d\142\x65\x72" => "\113\x61\x73\xc4\xb1\155", "\x44\145\143\145\155\142\145\x72" => "\x41\162\x61\x6c\xc4\xb1\153", "\115\157\156" => "\x50\164\x73", "\124\x75\145" => "\x53\x61\154", "\127\145\x64" => "\xc3\207\x61\x72", "\124\150\x75" => "\120\x65\162", "\106\162\151" => "\103\x75\x6d", "\x53\141\164" => "\x43\x74\163", "\123\165\156" => "\120\141\172", "\112\141\156" => "\x4f\143\x61", "\106\x65\142" => "\xc5\x9e\x75\142", "\115\141\162" => "\x4d\x61\x72", "\x41\x70\x72" => "\x4e\151\x73", "\x4a\165\x6e" => "\x48\x61\x7a", "\112\x75\x6c" => "\124\x65\155", "\x41\165\x67" => "\x41\304\237\165", "\123\x65\x70" => "\105\x79\x6c", "\117\143\x74" => "\105\x6b\151", "\x4e\x6f\166" => "\x4b\x61\163", "\104\x65\143" => "\101\162\141"); foreach ($gun_dizi as $en => $tr) { $z = str_replace($en, $tr, $z); } if (strpos($z, "\115\x61\x79\xc4\261\x73") !== false && strpos($format, "\106") === false) { $z = str_replace("\x4d\141\x79\xc4\xb1\x73", "\115\x61\x79", $z); } return $z; } public static function GET($key, $default = NULL) { return array_key_exists($key, $_GET) ? $_GET[$key] : $default; } public static function POST($key, $default = NULL) { return array_key_exists($key, $_POST) ? $_POST[$key] : $default; } public static function FILES($key, $default = NULL) { return array_key_exists($key, $_FILES) ? $_FILES[$key] : $default; } public static function Encode($string) { return json_encode($string, JSON_UNESCAPED_UNICODE); } public static function Decode($string) { return json_decode($string, true); } public static function ReadJSON($filedir) { $file = file_get_contents($filedir); return self::Decode($file); } public static function GenerateRandomID($digits = 4) { $temp_RandomID = rand(1, 9); $temp_Digits = 0; while ($temp_Digits < $digits - 1) { $temp_CreatedRandom = rand(1, 9); $temp_RandomID .= $temp_CreatedRandom; $temp_Digits++; } return $temp_RandomID; } public static function UploadImage($File, $Dir) { $ImageDir = str_replace("\x2f", DIRECTORY_SEPARATOR, $Dir); $ImageDir = $_SERVER["\104\117\103\x55\115\x45\116\x54\137\x52\x4f\x4f\124"] . $ImageDir; $RandomCode = self::GenerateRandomID(6); $ImageDir .= "\x47\127" . $RandomCode . "\x2e" . pathinfo($File["\x6e\x61\x6d\x65"], PATHINFO_EXTENSION); $ImageDirOnDB = $Dir . "\107\x57" . $RandomCode . "\56" . pathinfo($File["\x6e\x61\x6d\x65"], PATHINFO_EXTENSION); if (move_uploaded_file($File["\x74\x6d\160\137\x6e\x61\155\x65"], $ImageDir)) { return $ImageDirOnDB; } else { return false; } } public function GetIP() { return $this->IP; } } include_once "\x47\145\156\143\x77\145\142\56\x52\157\165\164\x65\56\143\154\x61\x73\x73\x2e\x70\x68\160"; include_once "\107\145\156\143\x77\145\142\x2e\x55\x74\151\154\163\56\143\154\141\x73\x73\x2e\160\x68\x70"; include_once "\x47\145\x6e\x63\x77\145\142\x2e\125\163\145\x72\56\143\x6c\141\x73\x73\56\160\x68\x70"; include_all_php(__DIR__ . "\x2f\x2e\x2e\57\x2e\x2e\57\x72\157\x75\x74\145\163\x2f"); date_default_timezone_set("\x45\165\x72\157\160\x65\57\x49\163\164\x61\156\142\x75\154"); if (empty($_SERVER["\110\x54\124\x50\x53"]) || $_SERVER["\x48\x54\124\x50\123"] == "\x6f\x66\x66") { $httpsredirect = "\150\x74\164\160\163\x3a\x2f\57" . $_SERVER["\110\x54\x54\120\137\110\117\123\x54"] . $_SERVER["\x52\x45\121\125\105\x53\x54\137\x55\x52\x49"]; header("\110\124\x54\x50\57\x31\56\61\40\x33\60\61\40\115\157\166\145\x64\40\x50\x65\162\155\x61\156\145\x6e\x74\x6c\171"); header("\114\157\143\141\164\x69\x6f\156\72\40" . $httpsredirect); die; } function include_all_php($folder) { foreach (glob("{$folder}\57\x2a\x2e\x70\150\x70") as $filename) { include_once $filename; } }

Function Calls

None

Variables

None

Stats

MD5 1f5deb6fc685de8c163cf345fb86eb84
Eval Count 0
Decode Time 68 ms