<?php
define('INDENT', "\t");
ini_set('error_reporting', E_ALL);
function color($str, $color = 33)
{
return "\x1B[{$color}m$str\x1B[0m";
}
function printBacktrace() // {{{
{
$backtrace = debug_backtrace();
foreach ($backtrace as $stack) {
$args = array();
foreach ($stack['args'] as $arg) {
if (is_scalar($arg)) {
$args[] = var_export($arg, true);
}
else if (is_array($arg)) {
$array = array();
foreach ($arg as $key => $value) {
$array[] = var_export($key, true) . " => " . (is_scalar($value) ? var_export($value, true) : gettype($value));
if (count($array) >= 5) {
$array[] = '...';
break;
}
}
$args[] = 'array(' . implode(', ', $array) . ')';
}
else {
$args[] = gettype($arg);
}
}
printf("%d: %s::%s(%s)" . PHP_EOL
, $stack['line']
, isset($stack['class']) ? $stack['class'] : ''
, $stack['function']
, implode(', ', $args)
);
}
}
// }}}
function str($code, $indent = '') // {{{
{
if (is_array($code)) {
$array = array();
foreach ($code as $key => $value) {
$array[$key] = str($value, $indent);
}
return $array;
}
if (is_object($code)) {
$code = foldToCode($code, $indent);
return $code->toCode($indent);
}
return (string) $code;
}
// }}}
function unsetArray(&$array, $name) // {{{
{
unset($array[$name]);
}
// }}}
function foldToCode($src, $indent = '') // {{{ wrap or rewrap anything to Decompiler_Code
{
if (is_array($indent)) {
$indent = $indent['indent'];
}
if (!is_object($src)) {
return new Decompiler_Code($src);
}
if (!method_exists($src, 'toCode')) {
var_dump($src);
exit('no toCode');
}
if (get_class($src) != 'Decompiler_Code') {
// rewrap it
$src = new Decompiler_Code($src->toCode($indent));
}
return $src;
}
// }}}
function decompileAst($ast, $EX) // {{{
{
$kind = $ast['kind'];
$children = $ast['children'];
unset($ast['kind']);
unset($ast['children']);
switch ($kind) {
case ZEND_CONST:
return value($ast[0], $EX);
case XC_INIT_ARRAY:
$array = new Decompiler_Array();
for ($i = 0; $i < $children; $i += 2) {
if (isset($ast[$i + 1])) {
$key = decompileAst($ast[$i], $EX);
$value = decompileAst($ast[$i + 1], $EX);
$array->value[] = array($key, $value);
}
else {
$array->value[] = array(null, decompileAst($ast[$i], $EX));
}
}
return $array;
// ZEND_BOOL_AND: handled in binop
// ZEND_BOOL_OR: handled in binop
case ZEND_SELECT:
return new Decompiler_TriOp(
decompileAst($ast[0], $EX)
, decompileAst($ast[1], $EX)
, decompileAst($ast[2], $EX)
);
case ZEND_UNARY_PLUS:
return new Decompiler_Code('+' . str(decompileAst($ast[0], $EX)));
case ZEND_UNARY_MINUS:
return new Decompiler_Code('-' . str(decompileAst($ast[0], $EX)));
default:
$decompiler = $GLOBALS['__xcache_decompiler'];
if (isset($decompiler->binops[$kind])) {
return new Decompiler_Binop($decompiler
, decompileAst($ast[0], $EX)
, $kind
, decompileAst($ast[1], $EX)
);
}
return "un-handled kind $kind in zend_ast";
}
}
// }}}
function value($value, &$EX) // {{{
{
if (ZEND_ENGINE_2_6 && (xcache_get_type($value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT_AST) {
return decompileAst(xcache_dasm_ast($value), $EX);
}
$originalValue = xcache_get_special_value($value);
if (isset($originalValue)) {
if ((xcache_get_type($value) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT) {
// constant
return $GLOBALS['__xcache_decompiler']->stripNamespace($originalValue);
}
$value = $originalValue;
}
if (is_a($value, 'Decompiler_Object')) {
// use as is
}
else if (is_array($value)) {
$value = new Decompiler_ConstArray($value, $EX);
}
else {
if (isset($EX['value2constant'][$value])) {
$value = new Decompiler_Code($EX['value2constant'][$value]);
}
else {
$value = new Decompiler_Value($value);
}
}
return $value;
}
// }}}
function unquoteName_($str, $asVariableName, $indent = '') // {{{
{
$str = str($str, $indent);
if (preg_match("!^'[\\w_][\\w\\d_\\\\]*'\$!", $str)) {
return str_replace('\\\\', '\\', substr($str, 1, -1));
}
else if ($asVariableName) {
return "{" . $str . "}";
}
else {
return $str;
}
}
// }}}
function unquoteVariableName($str, $indent = '') // {{{
{
return unquoteName_($str, true, $indent);
}
// }}}
function unquoteName($str, $indent = '') // {{{
{
return unquoteName_($str, false, $indent);
}
// }}}
class Decompiler_Object // {{{
{
}
// }}}
class Decompiler_Value extends Decompiler_Object // {{{
{
var $value;
function Decompiler_Value($value = null)
{
$this->value = $value;
}
function toCode($indent)
{
$code = var_export($this->value, true);
if (gettype($this->value) == 'string') {
switch ($this->value) {
case "\r":
return '"\\r"';
case "\n":
return '"\\n"';
case "\r\n":
return '"\\r\\n"';
}
$code = str_replace("\r\n", '\' . "\\r\\n" . \'', $code);
$code = str_replace("\r", '\' . "\\r" . \'', $code);
$code = str_replace("\n", '\' . "\\n" . \'', $code);
}
return $code;
}
}
// }}}
class Decompiler_Code extends Decompiler_Object // {{{
{
var $src;
function Decompiler_Code($src)
{
if (!assert('isset($src)')) {
printBacktrace();
}
$this->src = $src;
}
function toCode($indent)
{
return $this->src;
}
}
// }}}
class Decompiler_Binop extends Decompiler_Code // {{{
{
var $opc;
var $op1;
var $op2;
var $parent;
function Decompiler_Binop($parent, $op1, $opc, $op2)
{
$this->parent = &$parent;
$this->opc = $opc;
$this->op1 = $op1;
$this->op2 = $op2;
}
function toCode($indent)
{
$opstr = $this->parent->binops[$this->opc];
if (is_a($this->op1, 'Decompiler_TriOp') || is_a($this->op1, 'Decompiler_Binop') && $this->op1->opc != $this->opc) {
$op1 = "(" . str($this->op1, $indent) . ")";
}
else {
$op1 = $this->op1;
}
if (is_a($this->op2, 'Decompiler_TriOp') || is_a($this->op2, 'Decompiler_Binop') && $this->op2->opc != $this->opc && substr($opstr, -1) != '=') {
$op2 = "(" . str($this->op2, $indent) . ")";
}
else {
$op2 = $this->op2;
}
if (str($op1) == '0' && ($this->opc == XC_ADD || $this->opc == XC_SUB)) {
return $opstr . str($op2, $indent);
}
return str($op1, $indent) . ' ' . $opstr . ($this->opc == XC_ASSIGN_REF ? '' : ' ') . str($op2, $indent);
}
}
// }}}
class Decompiler_TriOp extends Decompiler_Code // {{{
{
var $condition;
var $trueValue;
var $falseValue;
function Decompiler_TriOp($condition, $trueValue, $falseValue)
{
$this->condition = $condition;
$this->trueValue = $trueValue;
$this->falseValue = $falseValue;
}
function toCode($indent)
{
$trueValue = $this->trueValue;
if (is_a($this->trueValue, 'Decompiler_TriOp')) {
$trueValue = "(" . str($trueValue, $indent) . ")";
}
$falseValue = $this->falseValue;
if (is_a($this->falseValue, 'Decompiler_TriOp')) {
$falseValue = "(" . str($falseValue, $indent) . ")";
}
return str($this->condition) . ' ? ' . str($trueValue) . ' : ' . str($falseValue);
}
}
// }}}
class Decompiler_Fetch extends Decompiler_Code // {{{
{
var $src;
var $fetchType;
function Decompiler_Fetch($src, $type, $globalSrc)
{
$this->src = $src;
$this->fetchType = $type;
$this->globalSrc = $globalSrc;
}
function toCode($indent)
{
switch ($this->fetchType) {
case ZEND_FETCH_LOCAL:
return '$' . $this->src;
case ZEND_FETCH_STATIC:
if (ZEND_ENGINE_2_3) {
// closure local variable?
return 'STR' . str($this->src);
}
else {
$EX = array();
return str(value($this->src, $EX));
}
die('static fetch cant to string');
case ZEND_FETCH_GLOBAL:
case ZEND_FETCH_GLOBAL_LOCK:
return $this->globalSrc;
default:
var_dump($this->fetchType);
assert(0);
}
}
}
// }}}
class Decompiler_Box // {{{
{
var $obj;
function Decompiler_Box(&$obj)
{
$this->obj = &$obj;
}
function toCode($indent)
{
return $this->obj->toCode($indent);
}
}
// }}}
class Decompiler_Dim extends Decompiler_Value // {{{
{
var $offset
没有合适的资源?快使用搜索试试~ 我知道了~
XCache-3.2.0-php-5.3.29-Win32-VC9-x64.zip
共70个文件
php:40个
po:12个
css:4个
需积分: 5 1 下载量 3 浏览量
2023-01-20
16:15:35
上传
评论
收藏 173KB ZIP 举报
温馨提示
XCache-3.2.0-php-5.3.29-Win32-VC9-x64.zip
资源推荐
资源详情
资源评论
收起资源包目录
XCache-3.2.0-php-5.3.29-Win32-VC9-x64.zip (70个子文件)
Release_TS
lib
Decompiler.class.php 79KB
ChangeLog 12KB
README 364B
NEWS 4KB
AUTHORS 26B
xcache-zh-gb2312.ini 3KB
xcache.ini 3KB
THANKS 385B
bin
phpdc.phpr 727B
phpdop.phpr 3KB
INSTALL 487B
php_xcache.dll 174KB
htdocs
config.default.php 425B
config.example.php 2KB
diagnosis
diagnosis.tpl.php 803B
lang
zh-simplified.php 8KB
en.php 64B
en.po 8KB
zh-tranditional.php 0B
zh-simplified.po 11KB
zh-traditional.po 8KB
zh-traditional.php 64B
index.php 12KB
diagnosis.css 203B
cacher
config.default.php 461B
lang
zh-simplified.php 4KB
en.php 3KB
en.po 6KB
zh-simplified.po 6KB
zh-traditional.po 6KB
zh-traditional.php 4KB
sub
entrylist.tpl.php 3KB
testcoredump.tpl.php 188B
moduleinfo.tpl.php 100B
summary.tpl.php 4KB
cacher.css 1KB
config.example.php 676B
index.php 7KB
listentries.tpl.php 656B
mkpassword.php 1KB
edit.tpl.php 698B
summary.tpl.php 245B
common.php 103B
edit.php 783B
index.php 185B
common
footer.tpl.php 633B
lang
zh-simplified.php 303B
en.php 64B
en.po 537B
zh-simplified.po 613B
zh-traditional.po 616B
zh-traditional.php 303B
tablesort.js 2KB
common.css 4KB
xcache.png 6KB
header.tpl.php 1KB
common.php 6KB
coverager
config.default.php 363B
lang
zh-simplified.php 250B
en.php 64B
en.po 622B
zh-simplified.po 673B
zh-traditional.po 625B
zh-traditional.php 64B
coverager.tpl.php 5KB
config.example.php 657B
index.php 8KB
coverager.css 1KB
common.php 106B
COPYING 1KB
共 70 条
- 1
资源评论
果果20569
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2022NOC软件创意编程赛项真题python小学高年级-决赛(有解析)
- mathml转换latex需要的xsl文件
- 2022NOC软件创意编程赛项真题图形化小学高年级-决赛赛(有解析)
- gbase驱动下载gbase-connector-java-8.3.81.53驱动下载
- 2022NOC软件创意编程赛项真题图形化小学低年级-决赛赛(有解析)
- InsightFace从青铜到王者,超大规模人脸识别的优雅解法
- python后端开发spider框架详解
- 基于 STM32 与 ESP8266 的智能家居系统源码.zip
- 毕业设计:基于SSM的mysql-个性化点餐配送系统(源码 + 数据库 + 说明文档)
- 基于matlab的鱼苗计数识别(GUI界面).zip代码57
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功