source: trunk/phpdc.phpr @ 819

Last change on this file since 819 was 819, checked in by moo, 4 years ago

decompiler: fix handling of stdin. support of exported dasm result

  • Property svn:eol-style set to native
File size: 650 bytes
RevLine 
[52]1#! /usr/bin/php -dopen_basedir=
[1]2<?php
3
4$srcdir = dirname(__FILE__);
5require_once("$srcdir/Decompiler.class.php");
6if (file_exists("$srcdir/phpdc.debug.php")) {
7    include("$srcdir/phpdc.debug.php");
8}
9
10if (!isset($argv)) {
11    $argv = $_SERVER['argv'];
12    $argc = $_SERVER['argc'];
13}
14
[522]15$dc = new Decompiler();
[819]16if (isset($argv[2])) {
17    eval('$dc->dc = ' . file_get_contents($argv[2]) . ';');
18}
19else if (isset($argv[1])) {
[1]20    $dc->decompileFile($argv[1]);
21}
22else {
23    $phpcode = '';
24    if (!defined('stdin')) {
25        define('stdin', fopen('php://stdin', 'rb'));
26    }
27    while (!feof(stdin)) {
28        $phpcode .= fgets(stdin);
29    }
[819]30    $dc->decompileString($phpcode);
[1]31}
32$dc->output();
33
Note: See TracBrowser for help on using the repository browser.