Changeset 820 in svn


Ignore:
Timestamp:
2011-06-08T03:45:25Z (4 years ago)
Author:
Xuefer
Message:

decode optimized if/return

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Decompiler.class.php

    r819 r820  
    906906            return;
    907907        }
     908        if ($firstOp['opcode'] == XC_JMPZ && !empty($firstOp['jmpouts'])
     909         && $firstOp['jmpouts'][0] - 1 == $range[1] && $opcodes[$firstOp['jmpouts'][0] - 1]['opcode'] == XC_RETURN) {
     910            $this->beginComplexBlock($EX);
     911            $this->removeJmpInfo($EX, $range[0]);
     912            $condition = $this->getOpVal($opcodes[$range[0]]['op1'], $EX);
     913
     914            echo $indent, 'if (', str($condition, $EX), ') ', '{', PHP_EOL;
     915            $this->beginScope($EX);
     916            $this->recognizeAndDecompileClosedBlocks($EX, $range);
     917            $this->endScope($EX);
     918            echo $indent, '}', PHP_EOL;
     919            $this->endComplexBlock($EX);
     920            return;
     921        }
    908922        // }}}
    909923        // {{{ try/catch
  • trunk/phpdop.phpr

    r759 r820  
    9595}
    9696$decompiler = new Decompiler();
    97 $pk = xcache_dasm_file($argv[1]);
     97if (isset($argv[2])) {
     98    eval('$pk = ' . file_get_contents($argv[2]) . ';');
     99}
     100else {
     101    $pk = xcache_dasm_file($argv[1]);
     102}
    98103$op_array = $funcs = $classes = null;
    99104if (isset($pk['op_array'])) {
Note: See TracChangeset for help on using the changeset viewer.