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 if(!DEFINED('BSP')) exit(header('Refresh: 0; URL=http://'.$_SERVER['SERVER_NA..

Decoded Output download

<?php 
 
	if(!DEFINED('BSP')) 
		exit(header('Refresh: 0; URL=http://'.$_SERVER['SERVER_NAME'].'/404')); 
 
	//   
	$url = is_array(sys::url()) ? sys::url() : array(); 
	$route = sys::url(false); 
	$section = isset($url['section']) ? $url['section'] : false; 
 
	$id = array_key_exists('id', $url) ? sys::int($url['id']) : false; 
	$go = array_key_exists('go', $url); 
	$page = array_key_exists('page', $url) ? sys::int($url['page']) : 1; 
	$route = $route == '' ? 'index' : $route; 
 
	//  
	if(isset($_GET['account'])) 
		sys::cookie('part', sys::int($_GET['account']), 10); 
 
	$auth = false; 
 
	//  cookie   
	$aAuth = array(); 
 
	$aAuth['login'] = isset($_COOKIE['bsp_login']) ? $_COOKIE['bsp_login'] : ''; 
	$aAuth['passwd'] = isset($_COOKIE['bsp_passwd']) ? $_COOKIE['bsp_passwd'] : ''; 
	$aAuth['authkeycheck'] = isset($_COOKIE['bsp_authkeycheck']) ? $_COOKIE['bsp_authkeycheck'] : ''; 
 
	$authkey = md5('bspv1.01'.$aAuth['login'].$uip.$aAuth['passwd']); 
	$userkey = md5($aAuth['login'].$authkey.$aAuth['passwd']); 
 
	if(!in_array('', $aAuth) && $authkey == $aAuth['authkeycheck']) 
	{ 
		$users = $mcache->get('users_auth'); 
 
		$user = isset($users[$userkey]) ? $users[$userkey] : 0; 
 
		if(!$user) 
		{ 
			if((!sys::valid($aAuth['login'], 'other', $aValid['login'])) && !sys::valid($aAuth['passwd'], 'md5')) 
			{ 
				$sql->query('SELECT `id` FROM `users` WHERE `login`="'.$aAuth['login'].'" AND `passwd`="'.$aAuth['passwd'].'" LIMIT 1'); 
				if($sql->num()) 
				{ 
					$sql->query('SELECT `id`, `login`, `passwd`, `balance`, `group`, `level`, `time` FROM `users` WHERE `login`="'.$aAuth['login'].'" AND `passwd`="'.$aAuth['passwd'].'" LIMIT 1'); 
					$user = array_merge(array('authkey' => $authkey), $sql->get()); 
 
					$auth = 1; 
 
					sys::users($users, $user, $authkey); 
				} 
			} 
 
			if(!$auth) 
			{ 
				sys::cookie('bsp_login', 'quit', -1); 
				sys::cookie('bsp_passwd', 'quit', -1); 
				sys::cookie('bsp_authkeycheck', 'quit', -1); 
			} 
		}else{ 
			$sql->query('SELECT `balance`, `time` FROM `users` WHERE `id`="'.$user['id'].'" LIMIT 1'); 
			$user = array_merge($user, $sql->get()); 
 
			sys::user($user); 
 
			$auth = 1; 
		} 
	} 
 
	//  
	$title = ''; 
 
	//  
	$html->nav($cfg['name'], $cfg['http']); 
 
	include(DATA.'header.php'); 
 
	//   
	if(in_array($route, $aRoute)) 
		include(ENG.$route.'.php'); 
	else 
		include(ENG.'404.php'); 
 
	//   
	if(isset($html->arr['main'])) 
	{ 
		$html->upd( 
			array( 
				'[home]', 
				'[js]', 
				'[css]', 
				'[img]', 
				'[add]' 
			), 
 
			array( 
				$cfg['http'], 
				$cfg['http'].'template/js/', 
				$cfg['http'].'template/css/', 
				$cfg['http'].'template/images/', 
				$cfg['http'].'template/addons/' 
			), 
			'main' 
		); 
	} 
 
	$aop = $mcache->get('all_online_players'); 
 
	if($aop == '') 
	{ 
		$sql->query('SELECT SUM(`online`) FROM `servers` WHERE `status`="working" OR `status`="change"'); 
		$sum = $sql->get(); 
 
		$aop = $sum['SUM(`online`)']; 
 
		$mcache->set('all_online_players', $aop, false, 600); 
	} 
 
	//   
	$html->get('all'); 
		$html->set('title', $title.' | '.$cfg['name']); 
		$html->set('description', sys::head('description')); 
		$html->set('keywords', sys::head('keywords')); 
		$html->set('home', $cfg['http']); 
		$html->set('js', $cfg['http'].'template/js/'); 
		$html->set('css', $cfg['http'].'template/css/'); 
		$html->set('img', $cfg['http'].'template/images/'); 
		$html->set('add', $cfg['http'].'template/addons/'); 
		$html->set('aop', $aop); 
		$html->set('mdl', $mdl); 
		$html->set('modal', $modal); 
		$html->set('cur', $cfg['currency']); 
 
		//   
		if($auth) 
		{ 
			$html->set('login', $user['login']); 
			$html->set('balance', round($user['balance'], 2)); 
			$html->set('other_menu', isset($html->arr['vmenu']) ? $html->arr['vmenu'] : ''); 
		}else 
			$html->set('other_menu', ''); 
 
		$html->set('nav', isset($html->arr['nav']) ? $html->arr['nav'] : '', true); 
		$html->set('main', isset($html->arr['main']) ? $html->arr['main'] : '', true); 
 
		$sql->query('SELECT `id`, `login`, `time` FROM `users` ORDER BY `id` ASC'); 
		$online = '<span style="padding:0 5px;">'; 
		while($staff = $sql->get()) 
		{ 
			if ($staff['time']+15 > $start_point) { 
				$online .= $staff['login'].', '; 
			} 
			else { 
				$online .= ''; 
			} 
		} 
		$online .= '</span>'; 
		$html->set('online_users', $online); 
	$html->pack('all'); 
 
	//  
	if($auth) 
	{ 
		//     
		$servers = $sql->query('(SELECT `id` FROM `servers` WHERE `user`="'.$user['id'].'" LIMIT 1) UNION (SELECT `id` FROM `owners` WHERE `user`="'.$user['id'].'" LIMIT 1)'); 
 
		if($sql->num()) 
			$html->unitall('all', 'servers', 1, 1); 
		else 
			$html->unitall('all', 'servers', 0, 1); 
 
		//     
		$servers = $sql->query('SELECT `id` FROM `control` WHERE `user`="'.$user['id'].'" LIMIT 1'); 
 
		if($sql->num()) 
			$html->unitall('all', 'control', 1); 
		else 
			$html->unitall('all', 'control', 0); 
 
		$html->unitall('all', 'auth', 1, 1); 
	}else{ 
		$html->unitall('all', 'auth', 0, 1); 
		$html->unitall('all', 'servers', 0, 1); 
		$html->unitall('all', 'control', 0, 1); 
	} 
?>

Did this file decode correctly?

Original Code

<?php

	if(!DEFINED('BSP'))
		exit(header('Refresh: 0; URL=http://'.$_SERVER['SERVER_NAME'].'/404'));

	//  
	$url = is_array(sys::url()) ? sys::url() : array();
	$route = sys::url(false);
	$section = isset($url['section']) ? $url['section'] : false;

	$id = array_key_exists('id', $url) ? sys::int($url['id']) : false;
	$go = array_key_exists('go', $url);
	$page = array_key_exists('page', $url) ? sys::int($url['page']) : 1;
	$route = $route == '' ? 'index' : $route;

	// 
	if(isset($_GET['account']))
		sys::cookie('part', sys::int($_GET['account']), 10);

	$auth = false;

	//  cookie  
	$aAuth = array();

	$aAuth['login'] = isset($_COOKIE['bsp_login']) ? $_COOKIE['bsp_login'] : '';
	$aAuth['passwd'] = isset($_COOKIE['bsp_passwd']) ? $_COOKIE['bsp_passwd'] : '';
	$aAuth['authkeycheck'] = isset($_COOKIE['bsp_authkeycheck']) ? $_COOKIE['bsp_authkeycheck'] : '';

	$authkey = md5('bspv1.01'.$aAuth['login'].$uip.$aAuth['passwd']);
	$userkey = md5($aAuth['login'].$authkey.$aAuth['passwd']);

	if(!in_array('', $aAuth) && $authkey == $aAuth['authkeycheck'])
	{
		$users = $mcache->get('users_auth');

		$user = isset($users[$userkey]) ? $users[$userkey] : 0;

		if(!$user)
		{
			if((!sys::valid($aAuth['login'], 'other', $aValid['login'])) && !sys::valid($aAuth['passwd'], 'md5'))
			{
				$sql->query('SELECT `id` FROM `users` WHERE `login`="'.$aAuth['login'].'" AND `passwd`="'.$aAuth['passwd'].'" LIMIT 1');
				if($sql->num())
				{
					$sql->query('SELECT `id`, `login`, `passwd`, `balance`, `group`, `level`, `time` FROM `users` WHERE `login`="'.$aAuth['login'].'" AND `passwd`="'.$aAuth['passwd'].'" LIMIT 1');
					$user = array_merge(array('authkey' => $authkey), $sql->get());

					$auth = 1;

					sys::users($users, $user, $authkey);
				}
			}

			if(!$auth)
			{
				sys::cookie('bsp_login', 'quit', -1);
				sys::cookie('bsp_passwd', 'quit', -1);
				sys::cookie('bsp_authkeycheck', 'quit', -1);
			}
		}else{
			$sql->query('SELECT `balance`, `time` FROM `users` WHERE `id`="'.$user['id'].'" LIMIT 1');
			$user = array_merge($user, $sql->get());

			sys::user($user);

			$auth = 1;
		}
	}

	// 
	$title = '';

	// 
	$html->nav($cfg['name'], $cfg['http']);

	include(DATA.'header.php');

	//  
	if(in_array($route, $aRoute))
		include(ENG.$route.'.php');
	else
		include(ENG.'404.php');

	//  
	if(isset($html->arr['main']))
	{
		$html->upd(
			array(
				'[home]',
				'[js]',
				'[css]',
				'[img]',
				'[add]'
			),

			array(
				$cfg['http'],
				$cfg['http'].'template/js/',
				$cfg['http'].'template/css/',
				$cfg['http'].'template/images/',
				$cfg['http'].'template/addons/'
			),
			'main'
		);
	}

	$aop = $mcache->get('all_online_players');

	if($aop == '')
	{
		$sql->query('SELECT SUM(`online`) FROM `servers` WHERE `status`="working" OR `status`="change"');
		$sum = $sql->get();

		$aop = $sum['SUM(`online`)'];

		$mcache->set('all_online_players', $aop, false, 600);
	}

	//  
	$html->get('all');
		$html->set('title', $title.' | '.$cfg['name']);
		$html->set('description', sys::head('description'));
		$html->set('keywords', sys::head('keywords'));
		$html->set('home', $cfg['http']);
		$html->set('js', $cfg['http'].'template/js/');
		$html->set('css', $cfg['http'].'template/css/');
		$html->set('img', $cfg['http'].'template/images/');
		$html->set('add', $cfg['http'].'template/addons/');
		$html->set('aop', $aop);
		$html->set('mdl', $mdl);
		$html->set('modal', $modal);
		$html->set('cur', $cfg['currency']);

		//  
		if($auth)
		{
			$html->set('login', $user['login']);
			$html->set('balance', round($user['balance'], 2));
			$html->set('other_menu', isset($html->arr['vmenu']) ? $html->arr['vmenu'] : '');
		}else
			$html->set('other_menu', '');

		$html->set('nav', isset($html->arr['nav']) ? $html->arr['nav'] : '', true);
		$html->set('main', isset($html->arr['main']) ? $html->arr['main'] : '', true);

		$sql->query('SELECT `id`, `login`, `time` FROM `users` ORDER BY `id` ASC');
		$online = '<span style="padding:0 5px;">';
		while($staff = $sql->get())
		{
			if ($staff['time']+15 > $start_point) {
				$online .= $staff['login'].', ';
			}
			else {
				$online .= '';
			}
		}
		$online .= '</span>';
		$html->set('online_users', $online);
	$html->pack('all');

	// 
	if($auth)
	{
		//    
		$servers = $sql->query('(SELECT `id` FROM `servers` WHERE `user`="'.$user['id'].'" LIMIT 1) UNION (SELECT `id` FROM `owners` WHERE `user`="'.$user['id'].'" LIMIT 1)');

		if($sql->num())
			$html->unitall('all', 'servers', 1, 1);
		else
			$html->unitall('all', 'servers', 0, 1);

		//    
		$servers = $sql->query('SELECT `id` FROM `control` WHERE `user`="'.$user['id'].'" LIMIT 1');

		if($sql->num())
			$html->unitall('all', 'control', 1);
		else
			$html->unitall('all', 'control', 0);

		$html->unitall('all', 'auth', 1, 1);
	}else{
		$html->unitall('all', 'auth', 0, 1);
		$html->unitall('all', 'servers', 0, 1);
		$html->unitall('all', 'control', 0, 1);
	}
?>

Function Calls

DEFINED 1

Variables

None

Stats

MD5 23738f1a80e9755eeaac585b5ff69ade
Eval Count 0
Decode Time 142 ms