lihancong / tonyenc Goto Github PK
View Code? Open in Web Editor NEW高性能、跨平台的 PHP7 代码加密扩展 (A high performance and cross-platform encrypt extension for PHP source code)
高性能、跨平台的 PHP7 代码加密扩展 (A high performance and cross-platform encrypt extension for PHP source code)
使用的是预编译好的dll
php.ini中添加了
extension=php_tonyenc_php70_x64_ts.dll
启动后报错
Warning: PHP Startup: Unable to load dynamic library 'C:\Soft\xampp\php\ext\php_tonyenc_php70_x64_ts.dll' - %1 不是有效 的 Win32 应用程序。
in Unknown on line 0
OS:Win10
PHP Version 7.1.7 TS
Big guy, can there be a function that can bind the network card or machine code of the other party, so that it is more difficult to crack
PHP版本以及环境
[root@DESKTOP-C05T56D solution ]$ php737 -v
PHP 7.3.7 (cli) (built: Sep 29 2019 09:34:46) ( NTS DEBUG )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.7, Copyright (c) 1998-2018 Zend Technologies
[root@DESKTOP-C05T56D solution ]$ uname -a
Linux DESKTOP-C05T56D 4.4.0-18362-Microsoft #1-Microsoft Mon Mar 18 12:02:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux
test.php 文件
<?php
echo 33;
运行后提示一处内存错误
[root@DESKTOP-C05T56D solution ]$ php737 test.php
33[Thu Oct 10 11:20:02 2019] Script: '/mnt/c/Users/You/c/php-7.3.7/ext/solution/test.php'
/home/xmc/oneinstack/src/php-7.3.7/Zend/zend_string.h(133) : Freeing 0x00007fd5f6470150 (80 bytes), script=/mnt/c/Users/You/c/php
-7.3.7/ext/solution/test.php
=== Total 1 memory leaks detected ===
valgrind执行获取的信息
[root@DESKTOP-C05T56D solution ]$ valgrind --leak-check=full --show-leak-kinds=all php737 test.php
==7255== Memcheck, a memory error detector
==7255== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==7255== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==7255== Command: php737 test.php
==7255==
==7255== error calling PR_SET_PTRACER, vgdb might block
==7255== Conditional jump or move depends on uninitialised value(s)
==7255== at 0x51D037: zend_string_equal_val (zend_string.c:417)
==7255== by 0x4F191B: zend_string_equal_content (zend_string.h:310)
==7255== by 0x4F3B18: zend_hash_find_bucket (zend_hash.c:587)
==7255== by 0x4F8E30: zend_hash_find (zend_hash.c:2092)
==7255== by 0x4C4F86: zend_get_constant_impl (zend_constants.c:279)
==7255== by 0x4C511D: zend_get_constant (zend_constants.c:301)
==7255== by 0x49AA0A: zend_ini_get_constant (zend_ini_parser.c:223)
==7255== by 0x49C0F5: ini_parse (zend_ini_parser.c:1927)
==7255== by 0x49AE5D: zend_parse_ini_file (zend_ini_parser.c:309)
==7255== by 0x456DE3: php_init_config (php_ini.c:630)
==7255== by 0x44C7E7: php_module_startup (main.c:2270)
==7255== by 0x5BA9D4: php_cli_startup (php_cli.c:420)
==7255==
==7255== Conditional jump or move depends on uninitialised value(s)
==7255== at 0x51D037: zend_string_equal_val (zend_string.c:417)
==7255== by 0x4F191B: zend_string_equal_content (zend_string.h:310)
==7255== by 0x4F3B18: zend_hash_find_bucket (zend_hash.c:587)
==7255== by 0x4F3E8A: _zend_hash_add_or_update_i (zend_hash.c:670)
==7255== by 0x4F4621: zend_hash_update (zend_hash.c:817)
==7255== by 0x4560CD: php_ini_parser_cb (php_ini.c:239)
==7255== by 0x49BA2F: ini_parse (zend_ini_parser.c:1676)
==7255== by 0x49AE5D: zend_parse_ini_file (zend_ini_parser.c:309)
==7255== by 0x456DE3: php_init_config (php_ini.c:630)
==7255== by 0x44C7E7: php_module_startup (main.c:2270)
==7255== by 0x5BA9D4: php_cli_startup (php_cli.c:420)
==7255== by 0x5BCB54: main (php_cli.c:1356)
==7255==
==7255== Conditional jump or move depends on uninitialised value(s)
==7255== at 0x51D037: zend_string_equal_val (zend_string.c:417)
==7255== by 0x51C2ED: zend_string_equal_content (zend_string.h:310)
==7255== by 0x51CA69: zend_interned_string_ht_lookup (zend_string.c:156)
==7255== by 0x51CBA4: zend_new_interned_string_permanent (zend_string.c:196)
==7255== by 0x5077D3: zend_register_ini_entries (zend_ini.c:261)
==7255== by 0x44C80A: php_module_startup (main.c:2275)
==7255== by 0x5BA9D4: php_cli_startup (php_cli.c:420)
==7255== by 0x5BCB54: main (php_cli.c:1356)
==7255==
==7255== Conditional jump or move depends on uninitialised value(s)
==7255== at 0x51D037: zend_string_equal_val (zend_string.c:417)
==7255== by 0x4F191B: zend_string_equal_content (zend_string.h:310)
==7255== by 0x4F5F61: zend_hash_del (zend_hash.c:1235)
==7255== by 0x4EEB1C: zend_declare_property_ex (zend_API.c:3748)
==7255== by 0x4EEE2F: zend_declare_property (zend_API.c:3793)
==7255== by 0x4EF0B0: zend_declare_property_string (zend_API.c:3840)
==7255== by 0x30B2EE: zm_startup_reflection (php_reflection.c:6650)
==7255== by 0x4E8067: zend_startup_module_ex (zend_API.c:1878)
==7255== by 0x4E80C2: zend_startup_module_zval (zend_API.c:1893)
==7255== by 0x4F7823: zend_hash_apply (zend_hash.c:1689)
==7255== by 0x4E8706: zend_startup_modules (zend_API.c:2004)
==7255== by 0x44C8F5: php_module_startup (main.c:2333)
==7255==
33[Thu Oct 10 11:22:15 2019] Script: '/mnt/c/Users/You/c/php-7.3.7/ext/solution/test.php'
/home/xmc/oneinstack/src/php-7.3.7/Zend/zend_string.h(133) : Freeing 0x000000000647d150 (80 bytes), script=/mnt/c/Users/You/c/php-7.3.7/ext/solution/test.php
=== Total 1 memory leaks detected ===
==7255==
==7255== HEAP SUMMARY:
==7255== in use at exit: 32 bytes in 1 blocks
==7255== total heap usage: 7,050 allocs, 7,049 frees, 1,158,714 bytes allocated
==7255==
==7255== 32 bytes in 1 blocks are still reachable in loss record 1 of 1
==7255== at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7255== by 0x55FE7E4: _dlerror_run (dlerror.c:140)
==7255== by 0x55FE050: dlopen@@GLIBC_2.2.5 (dlopen.c:87)
==7255== by 0x38EBC5: php_load_shlib (dl.c:84)
==7255== by 0x38EDC6: php_load_extension (dl.c:149)
==7255== by 0x4564AB: php_load_php_extension_cb (php_ini.c:344)
==7255== by 0x4CBE7D: zend_llist_apply (zend_llist.c:182)
==7255== by 0x4575C0: php_ini_register_extensions (php_ini.c:777)
==7255== by 0x44C8F0: php_module_startup (main.c:2332)
==7255== by 0x5BA9D4: php_cli_startup (php_cli.c:420)
==7255== by 0x5BCB54: main (php_cli.c:1356)
==7255==
==7255== LEAK SUMMARY:
==7255== definitely lost: 0 bytes in 0 blocks
==7255== indirectly lost: 0 bytes in 0 blocks
==7255== possibly lost: 0 bytes in 0 blocks
==7255== still reachable: 32 bytes in 1 blocks
==7255== suppressed: 0 bytes in 0 blocks
==7255==
==7255== For counts of detected and suppressed errors, rerun with: -v
==7255== Use --track-origins=yes to see where uninitialised values come from
==7255== ERROR SUMMARY: 231 errors from 4 contexts (suppressed: 0 from 0)
[root@DESKTOP-C05T56D solution ]$
你的域名到期了
感谢分享!可以增加域名、IP和到期时间 这些限制选项吗?
如题
赶紧处理吧
我对代码解密了之后,出于安全考虑,尝试劫持zend,在扩展前载入个劫持zend的扩展,结果十分轻松的就获取内容了...建议搞搞秘匙之类更安全的方式.
Sir,
I have spent several days trying to compile, but still not successful, please teach me? Thank you!
忘记密码找回密码界面,点击发送邮件后,log界面出现:
发送邮件失败:454 Transient reject by behaviour spam at Rcpt State(Connection IP address:113.110.224.169)ANTISPAM_BAT[01201311R1868S553012151f, e02c03291]: too frequently sendingCONTINUE
一年前提交的...emmm使用的是laravel框架 再不更新 laravel的php最低要求就要超过7.2了,挺害怕的
在作者源码基础上稍作修改使其支持了PHP7.4至PHP8.1;码云地址:https://gitee.com/lfveeker/tonyenc
这个链接打不开了
http://lihancong.cn/blog/article/104
方便说一下加密原理吗?不懂C语言
作者您好,我一直在用您开发的这个加密模块,很好用,请问能不能抽个时间更新一下对8.0的支持,谢谢。
fileno(fp) 报错 fp 0x00c60348 {_ptr=0x00000001 <读取字符串的字符时出错。> _cnt=6 _base=0x00000000 ...} _iobuf * 这是什么情况呢,求解答
[26-May-2020 05:38:23 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:/ipwebV2/PHP7/ext\php_tonyenc_php70_x64_nts.dll' - %1 不是有效的 Win32 应用程序。
in Unknown on line 0
https://gitee.com/lfveeker/tonyenc
具体操作步骤请阅读 build_windows_dll.pdf ,每一步步骤都详细记录并配图
使用最新的代码加密后,打开页面成了乱码,经查是这里的fixed出错了,而还原就正常。a4f51c4
win10 64位,php7.0+nginx
我在php.ini中加入这个
extension=php_tonyenc_php70_x64_ts.dll
vc14 安装的64位的
按照你写的例子执行后报错如下:
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\phpStudy\php\php-7.0.12-nts\ext\php_tonyenc_php70_x64_ts.dll' - %1 不是有效的 Win32 应用程 序。
win10 x64,用的:Laragon,PHP版本:php-7.2.19-Win32-VC15-x64
下载后,用的:php_tonyenc_php70_x64_ts.dll版本
在php.ini中加入:
extension=php_tonyenc_php70_x64_ts
在命令行下:php -v 就提示如下。。哪里搞错了?
Warning: PHP Startup: tonyenc: Unable to initialize module
Module compiled with module API=20151012
PHP compiled with module API=20170718
These options need to match
in Unknown on line 0
如题
PHP 7.4 上用不了了, 而且7.4好像移除了ZEND_HANDLE_FD
1>------ 已启动生成: 项目: TONYENC, 配置: Release Win32 ------
1>tonyenc.c
1>C:\php-7.1.6\win32/ioutil.h(372): warning C4996: '_wfopen': This function or variable may be unsafe. Consider using _wfopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt\corecrt_wstdio.h(130): note: 参见“_wfopen”的声明
1>C:\php-7.1.6\win32/ioutil.h(479): warning C4018: “>”: 有符号/无符号不匹配
1>c:\tonyenc-master\core.h(56): warning C4018: “>”: 有符号/无符号不匹配
1>c:\tonyenc-master\core.h(66): warning C4996: 'fileno': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _fileno. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt\stdio.h(2450): note: 参见“fileno”的声明
1>c:\tonyenc-master\core.h(83): warning C4996: 'close': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _close. See online help for details.
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\ucrt\corecrt_io.h(459): note: 参见“close”的声明
1>c:\tonyenc-master\core.h(105): warning C4101: “write_len”: 未引用的局部变量
1>LINK : warning LNK4075: 忽略“/INCREMENTAL”(由于“/OPT:ICF”规范)
1> 正在创建库 C:\tonyenc-master\Release\TONYENC.lib 和对象 C:\tonyenc-master\Release\TONYENC.exp
1>TONYENC.vcxproj -> C:\tonyenc-master\Release\TONYENC.dll
1>TONYENC.vcxproj -> C:\tonyenc-master\Release\TONYENC.pdb (Full PDB)
1>已完成生成项目“TONYENC.vcxproj”的操作。
========== 生成: 成功 1 个,失败 0 个,最新 0 个,跳过 0 个 ==========
配置: Release Win64 成功编译,并且测试正常.请求指导win32编译方法.谢谢您的好项目.
It is wonderful. :)
I can not decode absolute? :)
and And is it also available in php7.2?
运行完提示 Segmentation fault
最好有加个过期时间,就更好了
加解密后模版引擎(blade、smarty)语句不能正常处理,所以页面有乱码(原语句),情理之中。
但如果能解决更好。
谢谢.
作者您好,众里寻他千百度,蓦然回首竟在身边处,一直寻找合适php加密库,突然在52里面看到了,而且简单上手,太感人了,希望可以继续更新下php7.3 php7.4,现在都在更新,性能也好点,希望不要放弃,继续更新,谢谢
有继承关系,命名空间的文件 加密后,无法正常执行
例子
一个完整项目中 我加密了 1个A.php文件
B类继承了A类
代码执行时,提示 找不到A类
Fatal error: Uncaught Error: Class 'A' not found
Libraries have been installed in:
/home/vagrant/tonyenc/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
Build complete.
Don't forget to run 'make test'.
vagrant@homestead:~/tonyenc$ make install
Installing shared extensions: /usr/lib/php/20151012/
cp: cannot create regular file '/usr/lib/php/20151012/#INST@3820#': Permission denied
Makefile:87: recipe for target 'install-modules' failed
make: *** [install-modules] Error 1
php72使用成功
php74使用不成功
如题,作者能帮忙解决一下不
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.