Giter Club home page Giter Club logo

php-decrypt's Introduction

PHP Decrypt

License

PHP Decrypt是一个跨平台用来解密PHP源码的扩展,可以解密部分使用扩展跟eval加密的代码。

特点

  • 兼容 OPcache、Xdebug 等其他扩展
  • 兼容 Linux、OSX、Windows 等系统
  • 兼容 Apache、Nginx + php-fpm、命令行等运行模式

安装

环境要求

  • Linux,OSX,Windows
  • PHP7.0.0以上(暂不支持php5版本)

⚠ 安装前请把当前PHP环境的php-config添加到环境变量中。

在Linux,OSX上编译

git clone https://github.com/2654709623/php-decrypt.git
cd php-decrypt
phpize
./configure
make
sudo make install

在Windows上编译

可以自行参考本篇文章:https://learnku.com/articles/22323

TODO

1.目前所有解密代码只能保存在一个文件中以文件名区分

2.暂时还不能解密一些goto加密和混淆加密

使用

上面我们已经编译好PHPDecrypt扩展了,PHPDecrypt安装好默认是关闭自动解密功能的,需要我们在php.ini文件中来配置使用它。

1.非扩展方式的加密源码(eval加密源码)

在你的php.ini文件中加入以下配置项:

extension=你的扩展路径/decrypt.so
[decrypt]
;用来配置解密功能开关,默认为disable
decrypt.switch=enable
;解密后的php源码存放目录
decrypt.save_path=/www/decrypt

2.扩展方式的加密源码

由于PHP扩展加载顺序是栈加载的,需要在加密扩展前先加载解密扩展,php.ini配置项如下:

extension=你的扩展路径/decrypt.so
[decrypt]
;用来配置解密功能开关,默认为disable
decrypt.switch=enable
;解密后的php源码存放目录
decrypt.save_path=/www/decrypt
;假设这是你的加密扩展,你需要在它之前先加载解密扩展
;extension=你的加密扩展路径/encryption.so

保存php.ini文件并重启php-fpm,然后访问加密的源码文件,就会把解密的源码文件保存到/www/decrypt/decrypt.code的文件中。

如果不需要使用解密功能的话可以把php.ini文件中的decrypt.switch=enable设置为decrypt.switch=disable,重启php-fpm。

License

Apache License Version 2.0 see http://www.apache.org/licenses/LICENSE-2.0.html

php-decrypt's People

Contributors

albert-zhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-decrypt's Issues

centos上编译报错了

In file included from /php-decrypt/decrypt.c:30:0:
/php-decrypt/lib.h:29:15: warning: missing terminating " character [enabled by default]

define DS ""

/php-decrypt/decrypt.c: In function ‘decrypt_compile_file’:
/php-decrypt/decrypt.c:57:13: error: ‘for’ loop initial declarations are only allowed in C99 mode
for(int i=0;i<=size;i++)
/php-decrypt/decrypt.c:57:13: note: use option -std=c99 or -std=gnu99 to compile your code
make: *** [decrypt.lo] Error 1

php7+出现free错误

*** Error in `php': free(): invalid next size (fast): 0x00000000016ce0c0 ***
大佬请问这种错误是因为啥,不支持7.3麽还是

Centos7报错 虚拟机

In file included from /tmp/php-decrypt/decrypt.c:28:0:
/tmp/php-decrypt/decrypt.c: 在函数‘decrypt_compile_file’中:
/tmp/php-decrypt/php_decrypt.h:55:45: 错误:‘decrypt’未声明(在此函数内第一次使用)
#define DCG(v) ZEND_MODULE_GLOBALS_ACCESSOR(decrypt, v)
^
/tmp/php-decrypt/decrypt.c:41:16: 附注:in expansion of macro ‘DCG’
if(is_dirs(DCG(global_new)))
^
/tmp/php-decrypt/php_decrypt.h:55:45: 附注:每个未声明的标识符在其出现的函数内只报告一次
#define DCG(v) ZEND_MODULE_GLOBALS_ACCESSOR(decrypt, v)
^
/tmp/php-decrypt/decrypt.c:41:16: 附注:in expansion of macro ‘DCG’
if(is_dirs(DCG(global_new)))
^
/tmp/php-decrypt/decrypt.c:41:20: 错误:‘global_new’未声明(在此函数内第一次使用)
if(is_dirs(DCG(global_new)))
^
/tmp/php-decrypt/php_decrypt.h:55:54: 附注:in definition of macro ‘DCG’
#define DCG(v) ZEND_MODULE_GLOBALS_ACCESSOR(decrypt, v)
^
In file included from /usr/include/string.h:633:0,
from /usr/local/php/include/php/main/../main/php_config.h:2542,
from /usr/local/php/include/php/Zend/zend_config.h:1,
from /usr/local/php/include/php/Zend/zend.h:51,
from /usr/local/php/include/php/main/php.h:35,
from /tmp/php-decrypt/decrypt.c:25:
/tmp/php-decrypt/decrypt.c: 在函数‘zm_startup_decrypt’中:
/tmp/php-decrypt/php_decrypt.h:55:45: 错误:‘decrypt’未声明(在此函数内第一次使用)
#define DCG(v) ZEND_MODULE_GLOBALS_ACCESSOR(decrypt, v)
^
/tmp/php-decrypt/decrypt.c:75:16: 附注:in expansion of macro ‘DCG’
if(!strcmp(DCG(global_switch),"enable"))
^
/tmp/php-decrypt/decrypt.c:75:20: 错误:‘global_switch’未声明(在此函数内第一次使用)
if(!strcmp(DCG(global_switch),"enable"))
^
/tmp/php-decrypt/decrypt.c:75:16: 附注:in expansion of macro ‘DCG’
if(!strcmp(DCG(global_switch),"enable"))
^
/tmp/php-decrypt/decrypt.c: 在函数‘zm_shutdown_decrypt’中:
/tmp/php-decrypt/php_decrypt.h:55:45: 错误:‘decrypt’未声明(在此函数内第一次使用)
#define DCG(v) ZEND_MODULE_GLOBALS_ACCESSOR(decrypt, v)
^
/tmp/php-decrypt/decrypt.c:88:16: 附注:in expansion of macro ‘DCG’
if(!strcmp(DCG(global_switch),"enable"))
^
/tmp/php-decrypt/decrypt.c:88:20: 错误:‘global_switch’未声明(在此函数内第一次使用)
if(!strcmp(DCG(global_switch),"enable"))
^
/tmp/php-decrypt/decrypt.c:88:16: 附注:in expansion of macro ‘DCG’
if(!strcmp(DCG(global_switch),"enable"))
^
make: *** [decrypt.lo] 错误 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.