1
0
Fork 0

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:
Xuefer 2011-06-08 02:51:59 +00:00
parent 6dbbd04a8e
commit c667b51f43
2 changed files with 10 additions and 2 deletions

View File

@ -2574,6 +2574,11 @@ class Decompiler
}
}
// }}}
function decompileDasm($content) // {{{
{
$this->dc = $content;
}
// }}}
function output() // {{{
{
echo "<?". "php\n\n";

View File

@ -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();