Skip to content

Commit 11468db

Browse files
author
im
committed
fix
1 parent d43982c commit 11468db

File tree

2 files changed

+42
-26
lines changed

2 files changed

+42
-26
lines changed

README.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,37 @@
11
# Zend-Decoder
22
支持php5.6 zend解密,其他版本未测。
33

4-
编译xcache
5-
4+
### 编译 xcache
5+
#### Ubuntu + php5.6:
66
```
7-
git clone https://github.com/lighttpd/xcache
8-
cd xcache
9-
patch -p1 < ../xcache.patch
7+
$ sudo apt-get install python-software-properties
8+
$ sudo add-apt-repository ppa:ondrej/php
9+
$ sudo apt-get update
10+
$ apt-get install php5.6-dev
11+
$ git clone https://github.com/lighttpd/xcache
12+
$ cd xcache
13+
$ patch -p1 < ../xcache.patch
14+
$ phpize
15+
$ ./configure --enable-xcache-disassembler
16+
$ make
1017
```
11-
编译参考:https://github.com/lighttpd/xcache/blob/master/INSTALL
18+
[编译参考](https://github.com/lighttpd/xcache/blob/master/INSTALL)
19+
20+
#### windows + php5.6
1221

13-
安装扩展即可。
14-
使用:
22+
### 使用
23+
修改php.ini,增加一行
24+
```
25+
extension=xcache.so
26+
27+
extension=xcache.dll
28+
```
1529

1630
```
17-
php index.php 1.php
31+
php index.php encode.php
1832
```
1933

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

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

xcache.patch

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
diff -uprN xcache/mod_disassembler/xc_disassembler.c xcache_change/mod_disassembler/xc_disassembler.c
2-
--- xcache/mod_disassembler/xc_disassembler.c2018-06-05 23:06:34.000000000 +0800
3-
+++ xcache_change/mod_disassembler/xc_disassembler.c 2018-06-05 23:13:20.000000000 +0800
1+
diff -uprN xcache/mod_disassembler/xc_disassembler.c xcache-new/mod_disassembler/xc_disassembler.c
2+
--- xcache/mod_disassembler/xc_disassembler.c2015-07-17 10:36:20.000000000 +0800
3+
+++ xcache-new/mod_disassembler/xc_disassembler.c 2018-08-31 20:19:48.000000000 +0800
44
@@ -136,6 +136,7 @@ zend_op_array *xc_dasm_sandboxed(void *d
55
else {
66
op_array = compile_string(sandboxed_dasm->input.compile_string.source, sandboxed_dasm->input.compile_string.eval_name TSRMLS_CC);
@@ -28,9 +28,9 @@ diff -uprN xcache/mod_disassembler/xc_disassembler.c xcache_change/mod_disassemb
2828
+
2929
+}
3030
+
31-
+int get_handler_opcode(int handler,int op1_type,int op2_type)
31+
+int get_handler_opcode(opcode_handler_t handler,int op1_type,int op2_type)
3232
+{
33-
+//for(int index = 0;i<)
33+
+// zend_vm_execute.h zend_opcode_handlers length
3434
+int handlers_length = 4201;
3535
+int index_offset = 0;
3636
+int opcode = 0;
@@ -51,9 +51,9 @@ diff -uprN xcache/mod_disassembler/xc_disassembler.c xcache_change/mod_disassemb
5151
void xc_dasm_string(zval *output, zval *source TSRMLS_DC) /* {{{ */
5252
{
5353
xc_dasm_sandboxed_t sandboxed_dasm;
54-
diff -uprN xcache/mod_disassembler/xc_disassembler.h xcache_change/mod_disassembler/xc_disassembler.h
55-
--- xcache/mod_disassembler/xc_disassembler.h2018-06-05 23:06:34.000000000 +0800
56-
+++ xcache_change/mod_disassembler/xc_disassembler.h 2018-04-17 17:36:43.000000000 +0800
54+
diff -uprN xcache/mod_disassembler/xc_disassembler.h xcache-new/mod_disassembler/xc_disassembler.h
55+
--- xcache/mod_disassembler/xc_disassembler.h2015-07-17 10:36:20.000000000 +0800
56+
+++ xcache-new/mod_disassembler/xc_disassembler.h 2018-08-31 20:19:48.000000000 +0800
5757
@@ -6,5 +6,29 @@
5858
#endif /* _MSC_VER > 1000 */
5959

@@ -84,14 +84,15 @@ diff -uprN xcache/mod_disassembler/xc_disassembler.h xcache_change/mod_disassemb
8484
+};
8585

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

0 commit comments

Comments
 (0)