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 $src = realpath(__DIR__ . '/../../../'); $name = "swoole-cli-v" . SWOOLE_VERSION . ..

Decoded Output download

<?php

$src = realpath(__DIR__ . '/../../../');
$name = "swoole-cli-v" . SWOOLE_VERSION . "-cygwin-x64";

$dst = "/tmp/{$name}";
if (!is_dir($dst)) {
    mkdir($dst, 0777, true);
}

$match = "";
$patten = "#\s+(\S+)\s+\=\>\s+(\S+)\s+\(0x[a-f0-9]+\)#i";
$list = `ldd {$src}/bin/swoole-cli.exe`;

preg_match_all($patten, $list, $match);

if (!is_dir($dst . '/bin')) {
    mkdir($dst . '/bin');
}
if (!is_dir($dst . '/etc')) {
    mkdir($dst . '/etc');
}

foreach ($match[2] as $file) {
    if (str_starts_with($file, '/cygdrive/')) {
        continue;
    }
    echo $file . "
";
    copy($file, $dst . "/bin/" . basename($file));
}

echo `chmod a+x {$src}/bin/swoole-cli.exe`;

copy("{$src}/bin/swoole-cli.exe", $dst . "/bin/swoole-cli.exe");
if (is_file("{$src}/bin/LICENSE")) {
    copy("{$src}/bin/LICENSE", $dst . "/LICENSE");
}

echo `cp -rL /etc/pki/ {$dst}/etc`;
echo "done.
";


$pack = "cd " . dirname($dst) . " && zip -r {$name}.zip {$name} && cd -";
echo $pack . PHP_EOL;
echo `$pack`;

$move = "mv {$dst}.zip {$src}";
echo $move . PHP_EOL;
echo `$move`;

echo "clean..." . PHP_EOL;
echo `rm -rf {$dst}`;
 ?>

Did this file decode correctly?

Original Code

<?php

$src = realpath(__DIR__ . '/../../../');
$name = "swoole-cli-v" . SWOOLE_VERSION . "-cygwin-x64";

$dst = "/tmp/{$name}";
if (!is_dir($dst)) {
    mkdir($dst, 0777, true);
}

$match = "";
$patten = "#\s+(\S+)\s+\=\>\s+(\S+)\s+\(0x[a-f0-9]+\)#i";
$list = `ldd {$src}/bin/swoole-cli.exe`;

preg_match_all($patten, $list, $match);

if (!is_dir($dst . '/bin')) {
    mkdir($dst . '/bin');
}
if (!is_dir($dst . '/etc')) {
    mkdir($dst . '/etc');
}

foreach ($match[2] as $file) {
    if (str_starts_with($file, '/cygdrive/')) {
        continue;
    }
    echo $file . "\n";
    copy($file, $dst . "/bin/" . basename($file));
}

echo `chmod a+x {$src}/bin/swoole-cli.exe`;

copy("{$src}/bin/swoole-cli.exe", $dst . "/bin/swoole-cli.exe");
if (is_file("{$src}/bin/LICENSE")) {
    copy("{$src}/bin/LICENSE", $dst . "/LICENSE");
}

echo `cp -rL /etc/pki/ {$dst}/etc`;
echo "done.\n";


$pack = "cd " . dirname($dst) . " && zip -r {$name}.zip {$name} && cd -";
echo $pack . PHP_EOL;
echo `$pack`;

$move = "mv {$dst}.zip {$src}";
echo $move . PHP_EOL;
echo `$move`;

echo "clean..." . PHP_EOL;
echo `rm -rf {$dst}`;

Function Calls

None

Variables

None

Stats

MD5 0d9d2a5595352c0d8659bd869e53affd
Eval Count 0
Decode Time 91 ms