Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
im committed Aug 31, 2018
1 parent d43982c commit 11468db
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 deletions.
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
# Zend-Decoder
支持php5.6 zend解密,其他版本未测。

编译xcache

### 编译 xcache
#### Ubuntu + php5.6:
```
git clone https://github.com/lighttpd/xcache
cd xcache
patch -p1 < ../xcache.patch
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ apt-get install php5.6-dev
$ git clone https://github.com/lighttpd/xcache
$ cd xcache
$ patch -p1 < ../xcache.patch
$ phpize
$ ./configure --enable-xcache-disassembler
$ make
```
编译参考:https://github.com/lighttpd/xcache/blob/master/INSTALL
[编译参考](https://github.com/lighttpd/xcache/blob/master/INSTALL)

#### windows + php5.6

安装扩展即可。
使用:
### 使用
修改php.ini,增加一行
```
extension=xcache.so
extension=xcache.dll
```

```
php index.php 1.php
php index.php encode.php
```

(https://github.com/lighttpd/xcache/blob/master/lib/Decompiler.class.php)

### Decompiler.class.php
[Decompiler.class.php](https://github.com/lighttpd/xcache/blob/master/lib/Decompiler.class.php)

33 changes: 17 additions & 16 deletions xcache.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff -uprN xcache/mod_disassembler/xc_disassembler.c xcache_change/mod_disassembler/xc_disassembler.c
--- xcache/mod_disassembler/xc_disassembler.c 2018-06-05 23:06:34.000000000 +0800
+++ xcache_change/mod_disassembler/xc_disassembler.c 2018-06-05 23:13:20.000000000 +0800
diff -uprN xcache/mod_disassembler/xc_disassembler.c xcache-new/mod_disassembler/xc_disassembler.c
--- xcache/mod_disassembler/xc_disassembler.c 2015-07-17 10:36:20.000000000 +0800
+++ xcache-new/mod_disassembler/xc_disassembler.c 2018-08-31 20:19:48.000000000 +0800
@@ -136,6 +136,7 @@ zend_op_array *xc_dasm_sandboxed(void *d
else {
op_array = compile_string(sandboxed_dasm->input.compile_string.source, sandboxed_dasm->input.compile_string.eval_name TSRMLS_CC);
Expand Down Expand Up @@ -28,9 +28,9 @@ diff -uprN xcache/mod_disassembler/xc_disassembler.c xcache_change/mod_disassemb
+
+}
+
+int get_handler_opcode(int handler,int op1_type,int op2_type)
+int get_handler_opcode(opcode_handler_t handler,int op1_type,int op2_type)
+{
+ //for(int index = 0;i<)
+ // zend_vm_execute.h zend_opcode_handlers length
+ int handlers_length = 4201;
+ int index_offset = 0;
+ int opcode = 0;
Expand All @@ -51,9 +51,9 @@ diff -uprN xcache/mod_disassembler/xc_disassembler.c xcache_change/mod_disassemb
void xc_dasm_string(zval *output, zval *source TSRMLS_DC) /* {{{ */
{
xc_dasm_sandboxed_t sandboxed_dasm;
diff -uprN xcache/mod_disassembler/xc_disassembler.h xcache_change/mod_disassembler/xc_disassembler.h
--- xcache/mod_disassembler/xc_disassembler.h 2018-06-05 23:06:34.000000000 +0800
+++ xcache_change/mod_disassembler/xc_disassembler.h 2018-04-17 17:36:43.000000000 +0800
diff -uprN xcache/mod_disassembler/xc_disassembler.h xcache-new/mod_disassembler/xc_disassembler.h
--- xcache/mod_disassembler/xc_disassembler.h 2015-07-17 10:36:20.000000000 +0800
+++ xcache-new/mod_disassembler/xc_disassembler.h 2018-08-31 20:19:48.000000000 +0800
@@ -6,5 +6,29 @@
#endif /* _MSC_VER > 1000 */

Expand Down Expand Up @@ -84,14 +84,15 @@ diff -uprN xcache/mod_disassembler/xc_disassembler.h xcache_change/mod_disassemb
+ };

#endif /* XC_DISASSEMBLER_H_1547840703D7ADD9C19041818BE9E3C7 */
diff -uprN xcache/xcache/xc_utils.c xcache_change/xcache/xc_utils.c
--- xcache/xcache/xc_utils.c 2018-06-05 23:06:34.000000000 +0800
+++ xcache_change/xcache/xc_utils.c 2018-04-17 17:33:46.000000000 +0800
@@ -55,6 +55,7 @@ typedef struct {
} xc_apply_func_info;
static int xc_apply_function(zend_function *zf, xc_apply_func_info *fi TSRMLS_DC) /* {{{ */
{
+ fix_code(&zf->op_array);
Binary files xcache/xcache/.DS_Store and xcache-new/xcache/.DS_Store differ
diff -uprN xcache/xcache/xc_utils.c xcache-new/xcache/xc_utils.c
--- xcache/xcache/xc_utils.c 2015-07-17 10:36:20.000000000 +0800
+++ xcache-new/xcache/xc_utils.c 2018-08-31 20:20:55.000000000 +0800
@@ -58,6 +58,7 @@ static int xc_apply_function(zend_functi
switch (zf->type) {
case ZEND_USER_FUNCTION:
case ZEND_EVAL_CODE:
+ fix_code(&zf->op_array);
return fi->applyer(&zf->op_array TSRMLS_CC);
break;

0 comments on commit 11468db

Please sign in to comment.