pk-fr / yakpro-po

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

Add defined() function for define #70

Closed da411d closed 4 years ago

da411d commented 4 years ago

Sory, i cant explain in English, i hope you understand😅

lucasexe commented 4 years ago

Thanks for contributing to this project. I'm also a fan :)

My suggestion: I think that you can reuse the code to avoid repeating the same code:

just changing two lines:

if ( is_string($name) && ($name=='define') ) to: if ( is_string($name) && ($name=='define' || $name=='defined') )

and: if (count($node->args)!=2) to: if (($name=='define' && count($node->args)!=2) || ($name=='defined' && count($node->args)!=1))

lucasexe commented 4 years ago

I've forgotten about the exception message. Now, I don't know if it is valid to reuse the code

pk-fr commented 4 years ago

fixed in 2.0.11 thanx for reporting the bug

da411d commented 4 years ago

@pk-fr you also may take a look for https://github.com/javascript-obfuscator/javascript-obfuscator It has many interesting things, for example deobfuscate-protection.