PHP simple deobfuscation


|||

I don’t like obfuscation.

Because it is unprofessional – source can be simply opened, but server loaded and any troubleshooting and changes will be a problem

Because all obfuscated scripts which I ever meet is hodgie code. I don’t like stink people :)

Because most code under obfuscation has some validation on external sites, which is increase the response time.

So there is simple deobfuscator:

  1. <?php
  2. $s = "eval(...);";
  3. while(strpos($s, 'eval')===0) {
  4.     $s = substr_replace($s, 'print', 0, 4);
  5.     ob_start();
  6.     eval($s);
  7.     $s = ob_get_contents();
  8.     ob_end_clean();
  9. }
  10. print($s);
  11. ?>

If you find in the code eval function with some encrypting inside – just copy eval and all content into $s variable in the script above and run. The script print the original code.

If you need more help with deobfuscation – you are welcome.

feedback content * preview