Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Ensure __autoload is called twice if unserialize_callback_func is defined. --FILE..

Decoded Output download

--TEST--
Ensure __autoload is called twice if unserialize_callback_func is defined.
--FILE--
<?php
namespace MessagePacki;

if (!extension_loaded('msgpacki')) {
    dl('msgpacki.' . PHP_SHLIB_SUFFIX);
}

/*
function __autoload($name) {
    echo "in __autoload($name)
";
}
*/
eval('function __autoload($name) { echo "in __autoload($name)
"; }');

ini_set('unserialize_callback_func','MessagePacki\check');

function check($name) {
    echo "in check($name)
";
}

$o = decode(pack('H*', '81c0a3464f4f'));

var_dump($o);

echo "Done";
?>
--EXPECTF--
object(stdClass)#1 (0) {
}
Done

Did this file decode correctly?

Original Code

--TEST--
Ensure __autoload is called twice if unserialize_callback_func is defined.
--FILE--
<?php
namespace MessagePacki;

if (!extension_loaded('msgpacki')) {
    dl('msgpacki.' . PHP_SHLIB_SUFFIX);
}

/*
function __autoload($name) {
    echo "in __autoload($name)\n";
}
*/
eval('function __autoload($name) { echo "in __autoload($name)\n"; }');

ini_set('unserialize_callback_func','MessagePacki\check');

function check($name) {
    echo "in check($name)\n";
}

$o = decode(pack('H*', '81c0a3464f4f'));

var_dump($o);

echo "Done";
?>
--EXPECTF--
object(stdClass)#1 (0) {
}
Done

Function Calls

None

Variables

None

Stats

MD5 7f71ca2c3451723d6fa60ebf9f17a370
Eval Count 0
Decode Time 87 ms