Teach you how to decrypt the "PHP Shield decryption Tool" _php instance

Source: Internet
Author: User
Tags decrypt

In fact, the decryption is not so interested in the shield, just see the author of the tool and encryption, feeling uncomfortable. Research, in fact, decryption is not so complicated.

It's easy to get this done with the PHP_APD extension. Only four lines of code.

<?php
rename_function (' gzuncompress ', ' new_gzuncompress ');
Override_function (' gzuncompress ', ' $arg ', ' Print (New_gzuncompress ($arg)); return new_gzuncompress ($arg)
 
; Require_once ' decryption.php ';
Decryption (' decryption.php ');

The core code for the tool: decryption.php

<?php function Decryption ($fileName) {/** * decoding functions * @param string $str to be decoded string * @param string $FLG parsing after decoding
    * @return String decoded strings */function decode ($str, $FLG = ') {if ($FLG = = = ') {$ret = $str;
      else {$ret = ' ۯ '; $i = 0; $l = strlen ($STR);
        while ($i + + < $l) {$c = Ord ($str [$i-1]); $ret. = $c <245?
      ($c >136 chr ($c/2): $str [$i-1]): "";
  } return Base64_decode ($ret);
  $err = ' decoding encountered an error, please contact the Archbishop to process the file! ';
  $str = file_get_contents ($fileName);
  $path = PathInfo ($fileName); $dirname = $path [' dirname ']; The directory where the file is located $baseName = $path [' filename ']; FileName if (Preg_match (' | In_decode_ (\w{32}) |s ', $str, $arr)} {//Prevent decryption of themselves, in fact, the method has been told you, their own hands to decode the happy $arr [1] = = ' 761b5f52db6dff7ce91344e99dcedab 7 ' && die ("ERR: [-1]-do not attempt to decrypt this tool with this tool!"
  "); else {die ("err: [-1]-did not find the Shield feature, are you sure it is a shield encryption?"
  "); //Match Code topic section//'; @\$[\x00-\xff]+\ (\ \x00-\xff]+?) \ \.\ Preg_match ('|\ ' @\$[\x00-\xff]+\ (\\\\\ ' (\x00-\xff]+?) \\\\\ ' \.\ (|s ', $str, $arr) | |
  Die ("ERR: [0]-". $err);
 
  $code = $arr [1];
  Match the Middle encryption section Preg_match (' |\ ([\x00-\xff]+) \ ', \ ' |s ', $code, $arr) | | die ("ERR: [1]-". $err);
 
  $key = Base64_decode (Decode ($arr [1], "decode")); $code = preg_replace (' |\ ' \.[
 
  \x00-\xff]+\ ' \) \.\ ' |s ', $key, $code); Matching tail is encrypted code preg_match (' |=\ ' (x[\x00-\xff]+) \); |s ', $str, $arr) | |
  Die ("ERR: [2]-". $err);
 
  $core = $arr [1]; Match verification Key Preg_match (' |[ \w+/=]{59}=|s ', $arr [1], $arr) | |
  Die ("ERR: [3]-". $err);
 
  $key = $arr [0]; $core = Str_replace ($key, ', $core); Remove Key $suffix = Gzuncompress ($core);
 
  Gets the end part//decoding $code = Gzuncompress (Base64_decode ($code. $suffix)) of the Base64; Match Clean Code if (Preg_match (' |<!--<\?php endif;\?> (<\?php[\r\n]{1,2}[\x00-\xff]+\?>) <\?php \$
  Globals\[|s ', $code, $arr)) {$code = $arr [1]; //write to File $source = $dirname. Directory_separator. $baseName.
  "_source.php"; File_Put_contents ($source, $code); Die ("decrypted successfully, saved as:".
$source); }

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.