pk-fr / yakpro-po

YAK Pro - Php Obfuscator
http://www.php-obfuscator.com
Other
1.32k stars 374 forks source link

PHP 8 Compatibility #94

Closed costel78 closed 3 years ago

costel78 commented 3 years ago

What is the status of PHP 8 compatibility ? I have some issues regarding sessions after code obftucation, but I can not pin point exactly the source of error.

Thank you!

markhughes commented 3 years ago

I've started a new PHP 8 supported version here: https://github.com/markhughes/better-php-obfuscator

Pull the project and create a phar using:

composer install
composer build

php dist/bphpo.phar path/to/dir -o path/to/out
costel78 commented 3 years ago

$conf->shuffle_stmts = false; // shuffle chunks of statements! disable this obfuscation (or minimize the number of chunks) if performance is important for you! $conf->shuffle_stmts_min_chunk_size = 1; // minimum number of statements in a chunk! the min value is 1, that gives you the maximum of obfuscation ... and the minimum of performance... $conf->shuffle_stmts_chunk_mode = 'fixed'; // 'fixed' or 'ratio' in fixed mode, the chunk_size is always equal to the min chunk size! $conf->shuffle_stmts_chunk_ratio = 20; // ratio > 1 100/ratio is the percentage of chunks in a statements sequence ratio = 2 means 50% ratio = 100 mins 1% ... // if you increase the number of chunks, you increase also the obfuscation level ... and you increase also the performance overhead!

The error seems to be due to shuffle_stmts. It caused segmentation fault in opcache.

@markhughes I'll keep an eyes on your project too. Thank you!

pk-fr commented 3 years ago

I did'nt notice anything on my side... even if php source code was wrong, opcache should not segfault ! perhaps try to increase opcache configuration settings values... please tell me if you can figure out the reason, or if you can provide a small piece of code that can reproduce the problem.

costel78 commented 3 years ago

Yes, the error is definitely on the php side. It occur even with opcache.memory_consumption=512 and opcache.interned_strings_buffer=128, but was gone with shuffle_stmts = false or lowering obfuscation level by increasing shuffle_stmts_min_chunk_size and lowering shuffle_stmts_chunk_ratio. Due to my client policy, I am not allowed to share the code. The code have nothing extraordinary, but that are the rules.