function obfuscate($code) { $len = strlen($code); $obf = ''; for ($i = 0; $i < $len; $i++) { // i- $bin = decbin(ord($code[$i])); // , 0 $bin = ($binLen = strlen($bin) > 7) ? $bin : implode('', array_fill(0, 8 - strlen($bin), '0')) . $bin; // 1 , 0 , $obf .= str_replace(array('1', '0'), array(chr(9), chr(32)), $bin); } return $obf; }
function include_o($file) { $file = trim($file); // if ( empty($file) || !is_readable($file) ) { throw new Exception("Filename is empty or file isn't readable"); } $string = file_get_contents($file); $len = strlen($string); $out = ''; for ($i = 0; $i < $len; $i++) { /* * 8 , * */ $out .= chr(bindec(str_replace(array(chr(9), chr(32)), array('1', '0'), substr($string, $i, 8)))); $i += 7; } if (!empty($out)) { eval($out); } }
Source: https://habr.com/ru/post/458710/
All Articles