diff --git a/bin/phpdc.phpr b/bin/phpdc.phpr index e90fc28..969cbb5 100755 --- a/bin/phpdc.phpr +++ b/bin/phpdc.phpr @@ -14,10 +14,12 @@ if (!isset($argv)) { $dc = new Decompiler(); if (isset($argv[2])) { - eval('$dc->dc = ' . file_get_contents($argv[2]) . ';'); + eval('$dc->decompileDasm(' . file_get_contents($argv[2]) . ');'); } else if (isset($argv[1])) { - $dc->decompileFile($argv[1]); + if ($dc->decompileFile($argv[1]) === false) { + exit(2); + } } else { $phpcode = ''; @@ -27,7 +29,9 @@ else { while (!feof(stdin)) { $phpcode .= fgets(stdin); } - $dc->decompileString($phpcode); + if ($dc->decompileString($phpcode) === false) { + exit(2); + } } $dc->output(); diff --git a/lib/Decompiler.class.php b/lib/Decompiler.class.php index f78d59d..c0a2272 100644 --- a/lib/Decompiler.class.php +++ b/lib/Decompiler.class.php @@ -2568,6 +2568,7 @@ class Decompiler echo "error compling string\n"; return false; } + return true; } // }}} function decompileFile($file) // {{{ @@ -2577,11 +2578,13 @@ class Decompiler echo "error compling $file\n"; return false; } + return true; } // }}} function decompileDasm($content) // {{{ { $this->dc = $content; + return true; } // }}} function output() // {{{