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 @eval("?>".base64_decode("PD9waHAKaWYgKGJhc2VuYW1lKCRfU0VSVkVSWyJQSFBfU0VMRiJdKSA9PT..

Decoded Output download

?>b'<?php
if (basename($_SERVER["PHP_SELF"]) === basename(__FILE__)) {
    header(\'HTTP/1.0 403 Forbidden\');
    header("Location: ../index.php");
    die();
}
require_once("conexao.php");

function listarListas() {
    $listas = array();
    global $conexao;
    if($_SESSION[\'admin\']){
        $query = "select * from lista";
    } else {
        $query = "select * from lista l where l.id_lista in (select lu.id_lista from lista_usuario lu where lu.id_usuario = ".$_SESSION[\'id_usuario\'].")";
    }
    
    $resultado = mysqli_query($conexao, $query);
    while($lista = mysqli_fetch_assoc($resultado)) {
        array_push($listas, $lista);
    }
    return $listas;
}

function adicionarLista($nome, $lista) {
    global $conexao;
    $query = "insert into lista (nome_lista, lista, id_usuario) values (\'$nome\', \'$lista\', ".$_SESSION[\'id_usuario\'].")";
    return mysqli_query($conexao, $query);
}

function adicionarListaGlobal($nome, $categoria) {
    global $conexao;
    $query = "insert into lista (nome_lista, global) values (\'$nome\', 1)";
    $resultado = mysqli_query($conexao, $query);
    $id = mysqli_insert_id($conexao);
    if (count($categoria) > 0) {
        mysqli_query($conexao, "delete from lista_global_categoria where id_lista= $id");
        for ($i =0; $i < count($categoria); $i++) {
            mysqli_query($conexao, "insert into lista_global_categoria (id_categoria, id_lista) values ($categoria[$i], $id)");
        }
    }
    return $resultado;
}

function editarListaGlobal($id, $nome, $categoria) {
    global $conexao;
    $query = "update lista set nome_lista= \'$nome\' where id_lista=$id";
    
    if (count($categoria) > 0) {
        mysqli_query($conexao, "delete from lista_global_categoria where id_lista= $id");
        for ($i =0; $i < count($categoria); $i++) {
            if (mysqli_num_rows(mysqli_query($conexao, "select * from lista_global_categoria where id_lista= $id and id_categoria = $categoria[$i]")) == 0) {
                mysqli_query($conexao, "insert into lista_global_categoria (id_categoria, id_lista) values ($categoria[$i], $id)");
            }
        }
    } else {
        mysqli_query($conexao, "delete from lista_global_categoria where id_lista= $id");
    }

    return mysqli_query($conexao, $query);
}

function categoriasLista($id) {
    $categorias = array();
    global $conexao;
    $query = "select categoria.* FROM lista_global_categoria INNER JOIN lista ON (lista.id_lista = lista_global_categoria.id_lista) INNER JOIN categoria ON (categoria.id = lista_global_categoria.id_categoria) where lista.id_lista = $id";
    $resultado = mysqli_query($conexao, $query);
    while($categoria = mysqli_fetch_assoc($resultado)) {
        array_push($categorias, $categoria);
    }
    return $categorias;
}

function removerLista($id) {
    global $conexao;
    $query = "delete from lista where id_lista=$id";
    return mysqli_query($conexao, $query);
}

function obterLista($id) {
    global $conexao;
    $query = "select lista.lista from lista where id_lista = $id";
    $resultado = mysqli_query($conexao, $query);
    return mysqli_fetch_assoc($resultado)[\'lista\'];
}

function editarLista($id, $nome, $lista) {
    global $conexao;
    $query = "update lista set nome_lista= \'$nome\', lista = \'$lista\' where id_lista=$id";
    return mysqli_query($conexao, $query);
}

function obterListaUsuarios($id) {
    $usuarios = array();
    session_start();
    global $conexao;
    $query = "select u.id_usuario, u.nome_usuario from usuario u inner join lista_usuario lu on lu.id_usuario = u.id_usuario and lu.id_lista = ".$id." and lu.id_usuario != ".$_SESSION[\'id_usuario\']." where u.id_criador = ".$_SESSION[\'id_usuario\']." group by u.id_usuario";
    if($_SESSION[\'admin\']){
        $query = "select u.id_usuario, u.nome_usuario from usuario u inner join lista_usuario lu on lu.id_usuario = u.id_usuario and lu.id_lista = ".$id." and lu.id_usuario != ".$_SESSION[\'id_usuario\']." group by u.id_usuario";
    }
    $resultado = mysqli_query($conexao, $query);
    while ($usuario = mysqli_fetch_assoc($resultado)) {
        array_push($usuarios,$usuario);
    }
    return $usuarios;
}

function obterLinkLista($idLista,$idUsuario) {
    global $conexao;
    $query = "select acesso from usuario where id_usuario= $idUsuario";
    $resultadoUsuario = mysqli_query($conexao, $query);
    $usuario = mysqli_fetch_assoc($resultadoUsuario);
    return preg_replace(\'/controles\/obter-link-lista.php/\', \'\', (isset($_SERVER[\'HTTPS\']) && $_SERVER[\'HTTPS\'] === \'on\' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]exibir.php?usuario={$usuario[\'acesso\']}&lista={$idLista}&tipo=m3u_plus");
    
}

function listaGlobal($idlista) {
    $links = array();
    global $conexao;
    $resultado = mysqli_query($conexao, "select distinct link.nome_link, link.link_link, link.logo, link.acessoLink, 
    categoria.nome from link inner join lista_global_categoria on 
    (link.id_categoria = lista_global_categoria.id_categoria) inner join categoria on 
    (link.id_categoria = categoria.id) where lista_global_categoria.id_lista = $idlista order by categoria.nome asc");
    while($link = mysqli_fetch_assoc($resultado)) {
        array_push($links,$link);
    }
    return $links;
}
?>'

Did this file decode correctly?

Original Code

<?php @eval("?>".base64_decode("PD9waHAKaWYgKGJhc2VuYW1lKCRfU0VSVkVSWyJQSFBfU0VMRiJdKSA9PT0gYmFzZW5hbWUoX19GSUxFX18pKSB7CiAgICBoZWFkZXIoJ0hUVFAvMS4wIDQwMyBGb3JiaWRkZW4nKTsKICAgIGhlYWRlcigiTG9jYXRpb246IC4uL2luZGV4LnBocCIpOwogICAgZGllKCk7Cn0KcmVxdWlyZV9vbmNlKCJjb25leGFvLnBocCIpOwoKZnVuY3Rpb24gbGlzdGFyTGlzdGFzKCkgewogICAgJGxpc3RhcyA9IGFycmF5KCk7CiAgICBnbG9iYWwgJGNvbmV4YW87CiAgICBpZigkX1NFU1NJT05bJ2FkbWluJ10pewogICAgICAgICRxdWVyeSA9ICJzZWxlY3QgKiBmcm9tIGxpc3RhIjsKICAgIH0gZWxzZSB7CiAgICAgICAgJHF1ZXJ5ID0gInNlbGVjdCAqIGZyb20gbGlzdGEgbCB3aGVyZSBsLmlkX2xpc3RhIGluIChzZWxlY3QgbHUuaWRfbGlzdGEgZnJvbSBsaXN0YV91c3VhcmlvIGx1IHdoZXJlIGx1LmlkX3VzdWFyaW8gPSAiLiRfU0VT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RVJbJ0hUVFBTJ10gPT09ICdvbicgPyAiaHR0cHMiIDogImh0dHAiKSAuICI6Ly8kX1NFUlZFUltIVFRQX0hPU1RdJF9TRVJWRVJbUkVRVUVTVF9VUkldZXhpYmlyLnBocD91c3VhcmlvPXskdXN1YXJpb1snYWNlc3NvJ119Jmxpc3RhPXskaWRMaXN0YX0mdGlwbz1tM3VfcGx1cyIpOwogICAgCn0KCmZ1bmN0aW9uIGxpc3RhR2xvYmFsKCRpZGxpc3RhKSB7CiAgICAkbGlua3MgPSBhcnJheSgpOwogICAgZ2xvYmFsICRjb25leGFvOwogICAgJHJlc3VsdGFkbyA9IG15c3FsaV9xdWVyeSgkY29uZXhhbywgInNlbGVjdCBkaXN0aW5jdCBsaW5rLm5vbWVfbGluaywgbGluay5saW5rX2xpbmssIGxpbmsubG9nbywgbGluay5hY2Vzc29MaW5rLCAKICAgIGNhdGVnb3JpYS5ub21lIGZyb20gbGluayBpbm5lciBqb2luIGxpc3RhX2dsb2JhbF9jYXRlZ29yaWEgb24gCiAgICAobGluay5pZF9jYXRlZ29yaWEgPSBsaXN0YV9nbG9iYWxfY2F0ZWdvcmlhLmlkX2NhdGVnb3JpYSkgaW5uZXIgam9pbiBjYXRlZ29yaWEgb24gCiAgICAobGluay5pZF9jYXRlZ29yaWEgPSBjYXRlZ29yaWEuaWQpIHdoZXJlIGxpc3RhX2dsb2JhbF9jYXRlZ29yaWEuaWRfbGlzdGEgPSAkaWRsaXN0YSBvcmRlciBieSBjYXRlZ29yaWEubm9tZSBhc2MiKTsKICAgIHdoaWxlKCRsaW5rID0gbXlzcWxpX2ZldGNoX2Fzc29jKCRyZXN1bHRhZG8pKSB7CiAgICAgICAgYXJyYXlfcHVzaCgkbGlua3MsJGxpbmspOwogICAgfQogICAgcmV0dXJuICRsaW5rczsKfQo/Pg=="));//Generated by Ampare PHP Encoder. For more security please use php protect before encode the php program

Function Calls

base64_decode 1

Variables

None

Stats

MD5 7cb515d69392833390432d6c400d2391
Eval Count 1
Decode Time 47 ms