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 error_reporting(E_ALL); ini_set('display_errors', 1); session_start(); $cr..

Decoded Output download

<?php 
 
error_reporting(E_ALL); 
ini_set('display_errors', 1); 
 
session_start(); 
 
$crcTable = NULL; 
 
function make64int($high,$low) 
{ 
    return ($high<<32) | $low; 
} 
 
function right_shift($value) 
{ 
    $sign = (1<<63) & $value; 
    return ($value >> 1) ^ $sign; 
} 
 
function makeCRCTable() 
{ 
    global $crcTable; 
     
    $crcTable = array(); 
 
    for ($n = 0; $n < 0x100; $n++) 
    { 
        $c = $n; 
        for($k = 0; $k < 16; $k++) 
        { 
            $c = ($c&1 ? make64int(0xC96C5795,0xD7870F42) ^ right_shift($c) : right_shift($c)); 
        } 
        $crcTable[$n] = $c; 
    } 
} 
 
function checkCRC($data) 
{ 
    global $crcTable; 
    if ( $crcTable == NULL ) 
        makeCRCTable(); 
     
    $crc = make64int(0xFFFFFFFF,0xFFFFFFFF); 
 
    for($i=0; $i<strlen($data); $i++) 
    { 
        $crc = (($crc << 8) ^ $crcTable[($crc ^ ord($data[$i])) & 0xFF])&make64int(0xFFFFFFFF,0xFFFFFFFF); 
    } 
         
    return $crc ^ make64int(0xFFFFFFFF,0xFFFFFFFF); 
} 
 
 
if($_SERVER["REQUEST_METHOD"] == "POST") 
{ 
    $myusername=urldecode($_POST['username']); 
    $mypassword=urldecode($_POST['password']); 
    if( $myusername == 'admin' and checkCRC($mypassword) == make64int(0xDF3EB920,0xCBBCB200) ) 
    { 
        $_SESSION['loggedin'] = true; 
        header("Location: index.php"); 
        exit(); 
    } 
    else 
    { 
        echo 'Invalid Login/Password<br>'; 
    } 
} 
 
?>

Did this file decode correctly?

Original Code

<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);

session_start();

$crcTable = NULL;

function make64int($high,$low)
{
    return ($high<<32) | $low;
}

function right_shift($value)
{
    $sign = (1<<63) & $value;
    return ($value >> 1) ^ $sign;
}

function makeCRCTable()
{
    global $crcTable;
    
    $crcTable = array();

    for ($n = 0; $n < 0x100; $n++)
    {
        $c = $n;
        for($k = 0; $k < 16; $k++)
        {
            $c = ($c&1 ? make64int(0xC96C5795,0xD7870F42) ^ right_shift($c) : right_shift($c));
        }
        $crcTable[$n] = $c;
    }
}

function checkCRC($data)
{
    global $crcTable;
    if ( $crcTable == NULL )
        makeCRCTable();
    
    $crc = make64int(0xFFFFFFFF,0xFFFFFFFF);

    for($i=0; $i<strlen($data); $i++)
    {
        $crc = (($crc << 8) ^ $crcTable[($crc ^ ord($data[$i])) & 0xFF])&make64int(0xFFFFFFFF,0xFFFFFFFF);
    }
        
    return $crc ^ make64int(0xFFFFFFFF,0xFFFFFFFF);
}


if($_SERVER["REQUEST_METHOD"] == "POST")
{
    $myusername=urldecode($_POST['username']);
    $mypassword=urldecode($_POST['password']);
    if( $myusername == 'admin' and checkCRC($mypassword) == make64int(0xDF3EB920,0xCBBCB200) )
    {
        $_SESSION['loggedin'] = true;
        header("Location: index.php");
        exit();
    }
    else
    {
        echo 'Invalid Login/Password<br>';
    }
}

?>

Function Calls

ini_set 1
urldecode 1
session_start 1
error_reporting 1

Variables

$crcTable 0

Stats

MD5 f0f8744a5523c07492f8ea0b0ddc8301
Eval Count 0
Decode Time 114 ms