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 (!function_exists('mcrypt_module_open')) { header("charset=UTF-8"); die('MCryp..

Decoded Output download

<?php 
if (!function_exists('mcrypt_module_open')) { 
header("charset=UTF-8"); 
die('MCrypt mcrypt_module_open, : https://www.bsphp.com/chm.html?q=%E6%A3%80%E6%B5%8B%E5%88%B0%E4%BD%A0%E7%8E%AF%E5%A2%83%E4%B8%8D%E6%94%AF%E6%8C%81MCrypt mcrypt_module_open%E5%87%BD%E6%95%B0'); 
exit; 
} 
function bsphp_delphi_hex_bsphp_mdecrypt($, $) 
{ 
$Xif=new Des_delphi(); 
$breakif=$Xif->decrypt($, $); 
return $breakif; 
} 
function bsphp_delphi_hex_bsphp_mencrypt($, $) 
{ 
$Xif=new Des_delphi(); 
$breakif=$Xif->encrypt($, $); 
return $breakif; 
} 
function call_String2__Hex($and) 
{ 
$functionswitch=''; 
for ($=0; $ < strlen($and); $++) { 
$functionswitch .=dechex(ord($and[$])); 
} 
return $functionswitch; 
} 
function call_Hex2__String($functionswitch) 
{ 
$and=''; 
for ($=0; $ < strlen($functionswitch) - 1; $ +=2) { 
$and .=chr(hexdec($functionswitch[$] . $functionswitch[$ + 1])); 
} 
return $and; 
} 
class Des_delphi 
{ 
private static $_instance=NULL; 
var $; 
var $function; 
function __construct() 
{ 
$this->iv='12222222'; 
} 
public static function share() 
{ 
if (is_null(self::$_instance)) { 
self::$_instance=new Des(); 
} 
return self::$_instance; 
} 
function encrypt($switch, $if) 
{ 
$=mcrypt_get_block_size(MCRYPT_DES, MCRYPT_MODE_CBC); 
$switch=$this->pkcs5_pad($switch, $); 
$=str_pad($if, 8, '0'); 
$=mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_CBC, ''); 
if ($this->iv=='') { 
$function=@mcrypt_create_iv(mcrypt_enc_get_iv_size($), MCRYPT_RAND); 
} else { 
$function=$this->iv; 
} 
@mcrypt_generic_init($, $, $function); 
$=mcrypt_generic($, $switch); 
mcrypt_generic_deinit($); 
mcrypt_module_close($); 
$=call_String2__Hex($); 
return $; 
} 
function decrypt($, $if) 
{ 
$=call_Hex2__String($); 
$=str_pad($if, 8, '0'); 
$=mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_CBC, ''); 
if ($this->iv=='') { 
$function=@mcrypt_create_iv(mcrypt_enc_get_iv_size($), MCRYPT_RAND); 
} else { 
$function=$this->iv; 
} 
$returnreturn=mcrypt_enc_get_key_size($); 
@mcrypt_generic_init($, $, $function); 
$=mdecrypt_generic($, $); 
mcrypt_generic_deinit($); 
mcrypt_module_close($); 
$=$this->pkcs5_unpad($); 
return $; 
} 
function pkcs5_pad($, $) 
{ 
$_GETQT=$ - (strlen($) % $); 
return $ . str_repeat(chr($_GETQT), $_GETQT); 
} 
function pkcs5_unpad($) 
{ 
$_GETQT=ord(${ 
strlen($) - 1}); 
if ($_GETQT > strlen($)) { 
return false; 
} 
if (strspn($, chr($_GETQT), strlen($) - $_GETQT) !=$_GETQT) { 
return false; 
} 
return substr($, 0, -1 * $_GETQT); 
} 
function PaddingPKCS7($) 
{ 
$block_size=mcrypt_get_block_size(MCRYPTDES, MCRYPT_MODE_CBC); 
$=$block_size - (strlen($) % $block_size); 
$ .=switch(chr($), $); 
return $; 
} 
private function UnPaddingPKCS7($) 
{ 
$_GETQT=ord(${ 
strlen($) - 1}); 
if ($_GETQT > strlen($)) { 
return false; 
} 
if (strspn($, chr($_GETQT), strlen($) - $_GETQT) !=$_GETQT) { 
return false; 
} 
return substr($, 0, -1 * $_GETQT); 
} 
} 
 ?>

Did this file decode correctly?

Original Code

<?php
if (!function_exists('mcrypt_module_open')) {
header("charset=UTF-8");
die('MCrypt mcrypt_module_open, : https://www.bsphp.com/chm.html?q=%E6%A3%80%E6%B5%8B%E5%88%B0%E4%BD%A0%E7%8E%AF%E5%A2%83%E4%B8%8D%E6%94%AF%E6%8C%81MCrypt mcrypt_module_open%E5%87%BD%E6%95%B0');
exit;
}
function bsphp_delphi_hex_bsphp_mdecrypt($, $)
{
$Xif=new Des_delphi();
$breakif=$Xif->decrypt($, $);
return $breakif;
}
function bsphp_delphi_hex_bsphp_mencrypt($, $)
{
$Xif=new Des_delphi();
$breakif=$Xif->encrypt($, $);
return $breakif;
}
function call_String2__Hex($and)
{
$functionswitch='';
for ($=0; $ < strlen($and); $++) {
$functionswitch .=dechex(ord($and[$]));
}
return $functionswitch;
}
function call_Hex2__String($functionswitch)
{
$and='';
for ($=0; $ < strlen($functionswitch) - 1; $ +=2) {
$and .=chr(hexdec($functionswitch[$] . $functionswitch[$ + 1]));
}
return $and;
}
class Des_delphi
{
private static $_instance=NULL;
var $;
var $function;
function __construct()
{
$this->iv='12222222';
}
public static function share()
{
if (is_null(self::$_instance)) {
self::$_instance=new Des();
}
return self::$_instance;
}
function encrypt($switch, $if)
{
$=mcrypt_get_block_size(MCRYPT_DES, MCRYPT_MODE_CBC);
$switch=$this->pkcs5_pad($switch, $);
$=str_pad($if, 8, '0');
$=mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_CBC, '');
if ($this->iv=='') {
$function=@mcrypt_create_iv(mcrypt_enc_get_iv_size($), MCRYPT_RAND);
} else {
$function=$this->iv;
}
@mcrypt_generic_init($, $, $function);
$=mcrypt_generic($, $switch);
mcrypt_generic_deinit($);
mcrypt_module_close($);
$=call_String2__Hex($);
return $;
}
function decrypt($, $if)
{
$=call_Hex2__String($);
$=str_pad($if, 8, '0');
$=mcrypt_module_open(MCRYPT_DES, '', MCRYPT_MODE_CBC, '');
if ($this->iv=='') {
$function=@mcrypt_create_iv(mcrypt_enc_get_iv_size($), MCRYPT_RAND);
} else {
$function=$this->iv;
}
$returnreturn=mcrypt_enc_get_key_size($);
@mcrypt_generic_init($, $, $function);
$=mdecrypt_generic($, $);
mcrypt_generic_deinit($);
mcrypt_module_close($);
$=$this->pkcs5_unpad($);
return $;
}
function pkcs5_pad($, $)
{
$_GETQT=$ - (strlen($) % $);
return $ . str_repeat(chr($_GETQT), $_GETQT);
}
function pkcs5_unpad($)
{
$_GETQT=ord(${
strlen($) - 1});
if ($_GETQT > strlen($)) {
return false;
}
if (strspn($, chr($_GETQT), strlen($) - $_GETQT) !=$_GETQT) {
return false;
}
return substr($, 0, -1 * $_GETQT);
}
function PaddingPKCS7($)
{
$block_size=mcrypt_get_block_size(MCRYPTDES, MCRYPT_MODE_CBC);
$=$block_size - (strlen($) % $block_size);
$ .=switch(chr($), $);
return $;
}
private function UnPaddingPKCS7($)
{
$_GETQT=ord(${
strlen($) - 1});
if ($_GETQT > strlen($)) {
return false;
}
if (strspn($, chr($_GETQT), strlen($) - $_GETQT) !=$_GETQT) {
return false;
}
return substr($, 0, -1 * $_GETQT);
}
}

Function Calls

None

Variables

None

Stats

MD5 6a6642a4efc7b9780f89263ea9b4e742
Eval Count 0
Decode Time 50 ms