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 defined('BASEPATH') OR exit('No direct script access allowed'); class Casino ext..
Decoded Output download
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Casino extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->helper("url");
$this->load->database();
$this->load->library("session");
$this->load->helper('file');
}
public function index( )
{
parent::__construct();
$flink = $_SERVER['DOCUMENT_ROOT'].'/chace/slot_list.txt';
$fp=fopen($flink, 'r');
$source=fread($fp, filesize($flink));
fclose($fp);
$this->load->view('Casino/Dashboard', array('gameList' => json_decode($source, true)['content']['gameList']));
}
public function callback(){
$pl=file_get_contents('php://input');
$json=json_decode($pl, true);
header("content-type: application/json");
if($json['hall']==$this->config->item('casinohall') && $json['key']==$this->config->item('casinokey')){
if($json['cmd']=='getBalance'){
$pus=$this->db->query("select * from `users` where username ='$json[login]'")->result_array()[0];
if(!isset($pus['username'])){
die('{"status":"fail","error":"user_not_found"}');
}else{
echo '{"status":"success","error":"","login":"'.$json['login'].'","balance":"'.$pus['slot'].'","currency":"TRY"}';
}
}elseif($json['cmd']=='writeBet'){
$pus=$this->db->query("select * from `users` where username ='$json[login]'")->result_array()[0];
$pbalance=$pus['slot'] + $json['winLose'];
$gid=$json['gameId'];
$flink = $_SERVER['DOCUMENT_ROOT'].'/chace/slot_list.txt';
$fp=fopen($flink, 'r');
$games=json_decode(fread($fp, filesize($flink)), true)['content']['gameList'];
fclose($fp);
$game=array_filter($games, function($e) use($gid){
return $e['id']==$gid;
});
$game=$game[key($game)];
if($pbalance<0){
die('{"status":"fail","error":"fail_balance"}');
}elseif(!isset($pus['username'])){
die('{"status":"fail","error":"user_not_found"}');
}else{
$this->db->query("update users set slot = slot + '$json[winLose]' where id ='$pus[id]'");
$tip=0;
if($json['winLose']<0 && $json['bet']>0){
$word='bahis yapt';$tip=0;
}elseif($json['winLose']<0 && $json['bet']==0){
$word='kaybetti'; $tip=2;
}elseif($json['winLose']>0){$tip=1;$word='kazand';}
$log=$pus['username'].' kullancs '.$game['name'].' oyununda '.$json['winLose'].' TL '.$word;
$this->db->query("insert into galogs set uid ='$pus[id]', `time` ='".time()."', uname ='$pus[username]', gid ='$gid', gname ='$game[name]', amount ='$json[winLose]', `wl` ='$json[bet]', type ='$tip', log ='$log'");
$opid=$this->db->insert_id();
$opid=$opid+100;
echo '{"status":"success","error":"","login":"'.$json['login'].'","balance":"'.$pbalance.'","currency":"TRY", "operationId":"'.$opid.'"}';
}
}
}
}
public function playGame(){
$pid=$this->input->get('pid', TRUE);
$form=$this->input->get('form', TRUE);
if (!User::is_loggedin()) {
$demo=1;
}
if($demo==1 or $form==1){
$gameln="<iframe src='https://supermegaslot.com/demo/game.php?game=".$pid."' style='width:100%; height:610px;border:none'></iframe>";
}else{
$user=User::view_user(User::get_id());
$source=$this->getJson('openGame/', 'cmd=openGame&hall='.$this->config->item('casinohall').'&key='.$this->config->item('casinokey').'&login='.$user->username.'&gameId='.$pid.'&demo=0&continent=eur&domain=domain.com');
$json=json_decode($source, true);
if($json['content']['game']['iframe']==1){
$gameln="<iframe src='".$json['content']['game']['url']."' style='width:100%; height:610px;border:none'></iframe>";
}else{
$gameln=$json['content']['game']['url'];
}
}
$this->load->view('Casino/playGame', array('gamelink' => $gameln));
}
private function getJson($link, $pl){
$link=$this->config->item('casinolink').$link;
$ch=curl_init($link);
curl_setopt($ch, CURLOPT_REFERER, $_SERVER['HTTP_HOST']);
curl_setopt($ch, CURLOPT_POSTFIELDS, $pl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 8);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
return $res;
}
function renewGameList(){
$data=$this->getJson('', 'cmd=gamesList&hall='.$this->config->item('casinohall').'&key='.$this->config->item('casinokey'));
echo $data;
write_file('./chace/slot_list.txt', $data);
}
}
?>
Did this file decode correctly?
Original Code
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Casino extends CI_Controller {
function __construct()
{
parent::__construct();
$this->load->helper("url");
$this->load->database();
$this->load->library("session");
$this->load->helper('file');
}
public function index( )
{
parent::__construct();
$flink = $_SERVER['DOCUMENT_ROOT'].'/chace/slot_list.txt';
$fp=fopen($flink, 'r');
$source=fread($fp, filesize($flink));
fclose($fp);
$this->load->view('Casino/Dashboard', array('gameList' => json_decode($source, true)['content']['gameList']));
}
public function callback(){
$pl=file_get_contents('php://input');
$json=json_decode($pl, true);
header("content-type: application/json");
if($json['hall']==$this->config->item('casinohall') && $json['key']==$this->config->item('casinokey')){
if($json['cmd']=='getBalance'){
$pus=$this->db->query("select * from `users` where username ='$json[login]'")->result_array()[0];
if(!isset($pus['username'])){
die('{"status":"fail","error":"user_not_found"}');
}else{
echo '{"status":"success","error":"","login":"'.$json['login'].'","balance":"'.$pus['slot'].'","currency":"TRY"}';
}
}elseif($json['cmd']=='writeBet'){
$pus=$this->db->query("select * from `users` where username ='$json[login]'")->result_array()[0];
$pbalance=$pus['slot'] + $json['winLose'];
$gid=$json['gameId'];
$flink = $_SERVER['DOCUMENT_ROOT'].'/chace/slot_list.txt';
$fp=fopen($flink, 'r');
$games=json_decode(fread($fp, filesize($flink)), true)['content']['gameList'];
fclose($fp);
$game=array_filter($games, function($e) use($gid){
return $e['id']==$gid;
});
$game=$game[key($game)];
if($pbalance<0){
die('{"status":"fail","error":"fail_balance"}');
}elseif(!isset($pus['username'])){
die('{"status":"fail","error":"user_not_found"}');
}else{
$this->db->query("update users set slot = slot + '$json[winLose]' where id ='$pus[id]'");
$tip=0;
if($json['winLose']<0 && $json['bet']>0){
$word='bahis yapt';$tip=0;
}elseif($json['winLose']<0 && $json['bet']==0){
$word='kaybetti'; $tip=2;
}elseif($json['winLose']>0){$tip=1;$word='kazand';}
$log=$pus['username'].' kullancs '.$game['name'].' oyununda '.$json['winLose'].' TL '.$word;
$this->db->query("insert into galogs set uid ='$pus[id]', `time` ='".time()."', uname ='$pus[username]', gid ='$gid', gname ='$game[name]', amount ='$json[winLose]', `wl` ='$json[bet]', type ='$tip', log ='$log'");
$opid=$this->db->insert_id();
$opid=$opid+100;
echo '{"status":"success","error":"","login":"'.$json['login'].'","balance":"'.$pbalance.'","currency":"TRY", "operationId":"'.$opid.'"}';
}
}
}
}
public function playGame(){
$pid=$this->input->get('pid', TRUE);
$form=$this->input->get('form', TRUE);
if (!User::is_loggedin()) {
$demo=1;
}
if($demo==1 or $form==1){
$gameln="<iframe src='https://supermegaslot.com/demo/game.php?game=".$pid."' style='width:100%; height:610px;border:none'></iframe>";
}else{
$user=User::view_user(User::get_id());
$source=$this->getJson('openGame/', 'cmd=openGame&hall='.$this->config->item('casinohall').'&key='.$this->config->item('casinokey').'&login='.$user->username.'&gameId='.$pid.'&demo=0&continent=eur&domain=domain.com');
$json=json_decode($source, true);
if($json['content']['game']['iframe']==1){
$gameln="<iframe src='".$json['content']['game']['url']."' style='width:100%; height:610px;border:none'></iframe>";
}else{
$gameln=$json['content']['game']['url'];
}
}
$this->load->view('Casino/playGame', array('gamelink' => $gameln));
}
private function getJson($link, $pl){
$link=$this->config->item('casinolink').$link;
$ch=curl_init($link);
curl_setopt($ch, CURLOPT_REFERER, $_SERVER['HTTP_HOST']);
curl_setopt($ch, CURLOPT_POSTFIELDS, $pl);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 8);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($ch);
return $res;
}
function renewGameList(){
$data=$this->getJson('', 'cmd=gamesList&hall='.$this->config->item('casinohall').'&key='.$this->config->item('casinokey'));
echo $data;
write_file('./chace/slot_list.txt', $data);
}
}
Function Calls
| None |
Stats
| MD5 | 2b1890350276e0d66edefb68504eef68 |
| Eval Count | 0 |
| Decode Time | 92 ms |