decompiler: fix handling of stdin. support of exported dasm result
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@819 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
This commit is contained in:
parent
6dbbd04a8e
commit
c667b51f43
|
@ -2574,6 +2574,11 @@ class Decompiler
|
|||
}
|
||||
}
|
||||
// }}}
|
||||
function decompileDasm($content) // {{{
|
||||
{
|
||||
$this->dc = $content;
|
||||
}
|
||||
// }}}
|
||||
function output() // {{{
|
||||
{
|
||||
echo "<?". "php\n\n";
|
||||
|
|
|
@ -13,7 +13,10 @@ if (!isset($argv)) {
|
|||
}
|
||||
|
||||
$dc = new Decompiler();
|
||||
if (isset($argv[1])) {
|
||||
if (isset($argv[2])) {
|
||||
eval('$dc->dc = ' . file_get_contents($argv[2]) . ';');
|
||||
}
|
||||
else if (isset($argv[1])) {
|
||||
$dc->decompileFile($argv[1]);
|
||||
}
|
||||
else {
|
||||
|
@ -24,7 +27,7 @@ else {
|
|||
while (!feof(stdin)) {
|
||||
$phpcode .= fgets(stdin);
|
||||
}
|
||||
$dc->decompileFile($phpcode);
|
||||
$dc->decompileString($phpcode);
|
||||
}
|
||||
$dc->output();
|
||||
|
||||
|
|
Loading…
Reference in New Issue