search
HomeBackend DevelopmentPHP TutorialTeach you how to decrypt 'PHP Aegis Decryption Tool'_PHP Tutorial

其实对神盾解密并没有那么感兴趣,只是看到了作者把工具又加密了,感觉不爽。研究了一下,其实解密没那么复杂。

利用php_apd扩展很轻松地就这把这搞定了。只有四句代码。

<&#63;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');

该工具的核心代码:decryption.php

<&#63;php
function decryption($fileName) {
  /**
   * 解码函数
   * @param string $str 待解码字符串
   * @param string $flg 是否解析后解码
   * @return string   已解码字符串
   */
  function decode($str, $flg = '') {
    if($flg === '') {
      $ret = $str;
    } else {
      $ret = '&#1775;'; $i = 0; $l = strlen($str);
      while($i++ < $l) {
        $c = ord($str[$i-1]);
        $ret .= $c<245 &#63; ( $c>136 &#63; chr($c/2) : $str[$i-1] ) : "";
      }
    }
    return base64_decode($ret);
  }
   
  $err = '解码遇到错误,请联系教主处理该文件!';
  $str = file_get_contents($fileName);
  $path = pathinfo($fileName);
  $dirname = $path['dirname']; // 文件所在目录
  $baseName = $path['filename']; // 文件名
   
   
  if (preg_match('|IN_DECODE_(\w{32})|s', $str, $arr)) {
    // 防止解密自己,其实方法都已经告诉你了,自己动手解码才快乐
    $arr[1] === '761b5f52db6dff7ce91344e99dcedab7' && die("err: [-1] - 请勿试图用本工具解密本工具!");
  } else {
    die("err: [-1] - 没有发现神盾特征,你确定这是神盾加密?");
  }
   
  // 匹配代码主题部分
  // '';@\$[\x00-\xff]+\(\\'([\x00-\xff]+&#63;)\\'\.\(
  preg_match('|\'\';@\$[\x00-\xff]+\(\\\\\'([\x00-\xff]+&#63;)\\\\\'\.\(|s', $str, $arr) || die("err: [0] - ".$err);
  $code = $arr[1];
 
  // 匹配中间加密部分
  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);
 
  // 匹配尾部被加密代码
  preg_match('|=\'(x[\x00-\xff]+)\'\)\);|s', $str, $arr) || die("err: [2] - ".$err);
  $core = $arr[1];
 
  // 匹配验证key
  preg_match('|[\w+/=]{59}=|s', $arr[1], $arr) || die("err: [3] - ".$err);
  $key = $arr[0];
 
  $core = str_replace($key, '', $core); // 去除key
  $suffix = gzuncompress($core); // 得到 base64 的末尾部分
 
  // 解码
  $code = gzuncompress(base64_decode($code . $suffix));
 
  // 匹配干净的代码
  if (preg_match('|<!--<\&#63;php endif;\&#63;>(<\&#63;php[\r\n]{1,2}[\x00-\xff]+\&#63;>)<\&#63;php \$GLOBALS\[|s', $code, $arr)) {
    $code = $arr[1];
  }
 
  // 写到文件
  $source = $dirname . DIRECTORY_SEPARATOR . $baseName . "_source.php";
  file_put_contents($source, $code);
  die("解密成功,已经保存为: " . $source);
}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/825429.htmlTechArticle其实对神盾解密并没有那么感兴趣,只是看到了作者把工具又加密了,感觉不爽。研究了一下,其实解密没那么复杂。 利用php_apd扩展很轻...
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP Dependency Injection Container: A Quick StartPHP Dependency Injection Container: A Quick StartMay 13, 2025 am 12:11 AM

APHPDependencyInjectionContainerisatoolthatmanagesclassdependencies,enhancingcodemodularity,testability,andmaintainability.Itactsasacentralhubforcreatingandinjectingdependencies,thusreducingtightcouplingandeasingunittesting.

Dependency Injection vs. Service Locator in PHPDependency Injection vs. Service Locator in PHPMay 13, 2025 am 12:10 AM

Select DependencyInjection (DI) for large applications, ServiceLocator is suitable for small projects or prototypes. 1) DI improves the testability and modularity of the code through constructor injection. 2) ServiceLocator obtains services through center registration, which is convenient but may lead to an increase in code coupling.

PHP performance optimization strategies.PHP performance optimization strategies.May 13, 2025 am 12:06 AM

PHPapplicationscanbeoptimizedforspeedandefficiencyby:1)enablingopcacheinphp.ini,2)usingpreparedstatementswithPDOfordatabasequeries,3)replacingloopswitharray_filterandarray_mapfordataprocessing,4)configuringNginxasareverseproxy,5)implementingcachingwi

PHP Email Validation: Ensuring Emails Are Sent CorrectlyPHP Email Validation: Ensuring Emails Are Sent CorrectlyMay 13, 2025 am 12:06 AM

PHPemailvalidationinvolvesthreesteps:1)Formatvalidationusingregularexpressionstochecktheemailformat;2)DNSvalidationtoensurethedomainhasavalidMXrecord;3)SMTPvalidation,themostthoroughmethod,whichchecksifthemailboxexistsbyconnectingtotheSMTPserver.Impl

How to make PHP applications fasterHow to make PHP applications fasterMay 12, 2025 am 12:12 AM

TomakePHPapplicationsfaster,followthesesteps:1)UseOpcodeCachinglikeOPcachetostoreprecompiledscriptbytecode.2)MinimizeDatabaseQueriesbyusingquerycachingandefficientindexing.3)LeveragePHP7 Featuresforbettercodeefficiency.4)ImplementCachingStrategiessuc

PHP Performance Optimization Checklist: Improve Speed NowPHP Performance Optimization Checklist: Improve Speed NowMay 12, 2025 am 12:07 AM

ToimprovePHPapplicationspeed,followthesesteps:1)EnableopcodecachingwithAPCutoreducescriptexecutiontime.2)ImplementdatabasequerycachingusingPDOtominimizedatabasehits.3)UseHTTP/2tomultiplexrequestsandreduceconnectionoverhead.4)Limitsessionusagebyclosin

PHP Dependency Injection: Improve Code TestabilityPHP Dependency Injection: Improve Code TestabilityMay 12, 2025 am 12:03 AM

Dependency injection (DI) significantly improves the testability of PHP code by explicitly transitive dependencies. 1) DI decoupling classes and specific implementations make testing and maintenance more flexible. 2) Among the three types, the constructor injects explicit expression dependencies to keep the state consistent. 3) Use DI containers to manage complex dependencies to improve code quality and development efficiency.

PHP Performance Optimization: Database Query OptimizationPHP Performance Optimization: Database Query OptimizationMay 12, 2025 am 12:02 AM

DatabasequeryoptimizationinPHPinvolvesseveralstrategiestoenhanceperformance.1)Selectonlynecessarycolumnstoreducedatatransfer.2)Useindexingtospeedupdataretrieval.3)Implementquerycachingtostoreresultsoffrequentqueries.4)Utilizepreparedstatementsforeffi

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment