phpjm解密程序,也适用于其他混淆加密的破解
<?php
$file = 'plugin.php'; //要破解的文件 $fp = fopen($file, 'r');
$str = fread($fp, filesize($file));
fclose($fp); copy($file, '0_'.$file); $n = 1;
while($n < 10){
$code = strdecode($str);
if($n == 1){
$code = str_replace("__FILE__", "'0_$file'", $code);
} $replace = '$decode'.$n.'=trim';
if(strpos($code, 'eval(') > 0){
$code = str_replace('eval(', $replace.'(', $code);
}else{
preg_match("/@\\$(.*)\(\\$(.*),(.*)\(/isU", $code, $res);
$code = str_replace($res[3], "'$replace", $code);
} $code = preg_replace('/\\$(.*)=false;(.*?)\(\);/', '', $code); //上一版本
$code = preg_replace('/\|\|@\\$(.*?)\(\);/', '|| print("ok");', $code); $code = destr($code);
$tmp_file = 'detmp'.$n.'.php';
file_put_contents($tmp_file, $code);
include($tmp_file); $val = 'decode'.$n;
$str = $$val; unlink($tmp_file); if(strpos($str, ';?>') === 0){
$decode = $str;
break;
} $str = "<?php\r\n". $str;
$n++;
} $decode = preg_replace("/^(.*)exit\('Access Denied'\); /", "<?php\r\n", $decode);
$del = strrchr($decode, 'unset');
$decode = str_replace($del, "\r\n?>", $decode);
file_put_contents($file.'.de.php' ,$decode);
unlink('0_'.$file);
echo 'done'; ////////////
function val_replace($code, $val, $deval){
$code = str_replace('$'.$val.',', '$'.$deval.',', $code);
$code = str_replace('$'.$val.';', '$'.$deval.';', $code);
$code = str_replace('$'.$val.'=', '$'.$deval.'=', $code);
$code = str_replace('$'.$val.'(', '$'.$deval.'(', $code);
$code = str_replace('$'.$val.')', '$'.$deval.')', $code);
$code = str_replace('$'.$val.'.', '$'.$deval.'.', $code);
$code = str_replace('$'.$val.'/', '$'.$deval.'/', $code);
$code = str_replace('$'.$val.'>', '$'.$deval.'>', $code);
$code = str_replace('$'.$val.'<', '$'.$deval.'<', $code);
$code = str_replace('$'.$val.'^', '$'.$deval.'^', $code);
$code = str_replace('$'.$val.'||', '$'.$deval.'||', $code);
$code = str_replace('($'.$val.' ', '($'.$deval.' ', $code);
return $code;
} function fmt_code($code){
global $vals,$funs;
preg_match_all("/\\$[0-9a-zA-Z\[\]']+(,|;)/iesU", $code, $res);
foreach($res[0] as $v){
$val = str_replace(array('$',',',';'), '', $v);
$deval = destr($val, 1);
$vals[$val] = $deval;
$code = val_replace($code, $val, $deval);
} preg_match_all("/\\$[0-9a-zA-Z\[\]']+=/iesU", $code, $res);
foreach($res[0] as $v){
$val = str_replace(array('$','='), '', $v);
$deval = destr($val, 1);
$vals[$val] = $deval;
$code = val_replace($code, $val, $deval);
} preg_match_all("/function\s[0-9a-zA-Z\[\]]+\(/iesU", $code, $res);
foreach($res[0] as $v){
$val = str_replace(array('function ','('), '', $v);
$deval = destr($val, 1);
$funs[$val] = $deval;
$code = str_replace('function '.$val.'(', 'function '.$deval.'(', $code);
$code = str_replace('='.$val.'(', '='.$deval.'(', $code);
$code = str_replace('return '.$val.'(', 'return '.$deval.'(', $code);
}
return $code;
} function strdecode($str){
$len = strlen($str);
$newstr = '';
for($i=0; $i<$len; $i++){
$n = ord($str[$i]);
$newstr .= decode($n);
}
return $newstr;
} function decode($dec){
if(($dec > 126 || $dec<32) && $dec<>13 && $dec<>10){
return '['.$dec.']';
}else{
return chr($dec);
}
} function destr($str, $val=0){
$k = 0;
$num = '';
$n = strlen($str);
$code = '';
for($i=0; $i<$n; $i++){
if($str[$i] == '[' && ($str[$i+1]==1 || $str[$i+1]==2)){
$k = 1;
}elseif($str[$i] == ']' && $k==1){
$num = intval($num);
if($val==1){
$num = 97 + fmod($num, 25);
}
$code .= chr($num);
$k = 0;
$num = null;
}else{
if($k == 1){
$num .= $str[$i];
}else{
$code .= $str[$i];
}
}
}
return $code;
}
?>
<?php
//解密 PHP神盾 $file = 'Code2.php'; $fp = fopen($file, 'r');
$str = fread($fp, filesize($file));
fclose($fp); $code = strdecode($str); //for func de1
preg_match("/;(.*)\]='(.*?)';for\(/e", $code, $res);
$c1 = $res[2]; //for func de1
preg_match("/;(.*)=(.*)\('(.*)'\);(.*);(.*)$/e", $res[1], $rs);
$c2 = $rs[3]; //for func de2
preg_match("/'\(@(.*?)\(\\\'(.*?)\\\'\)\)/e", $code, $res);
$c3 = $res[2]; preg_match("/'\.(.*?)\.'/e", $c3, $r);
preg_match("/\('(.*?)','/e", $r[1], $r2);
$c4 = $r2[1];
$c4 = base64_decode(de1(destr($c4), 1));
$c3 = str_replace($r[0], $c4, $c3); $funstr = gzuncompress(base64_decode($c3)).base64_decode($c1);
preg_match("/if(.*),'(.*?)'\)\)/e", $funstr, $res);
$c5 = $res[2]; //find main code
preg_match("/'\(@(.*)\(\\\'(.*?)\\\'\.\(/e", $code, $res);
$c = $res[2];
preg_match("/'\.(.*?)\.'/e", $c, $r);
preg_match("/\('(.*?)','/e", $r[1], $r2);
$c6 = base64_decode(de1(destr($r2[1]), 1));
$c = str_replace($r[0], $c6, $c); //find $de2
preg_match("/\"\.\((.*)='(.*?)'\)\);/e", $code, $res);
$de2 = destr($res[2]);
$x = ($de2.=de2($de2));
$c .= $x;
$decode = gzuncompress(base64_decode($c)); $str = explode('<!--<?php endif;?>', $decode);
$str = explode('?><?php $GLOBALS', $str[1]);
$decode = $str[0].'?>'; echo $decode; file_put_contents($file.'.de.php' ,$decode); ////////////////////////////// function de1($de1,$str2=''){
global $c1,$c2;
if(!$str2)return(base64_decode(destr($de1)));
$s9=de1($c2);
for($i=0;$i<strlen($de1);$i++)
$s9.=ord($de1{$i})<245?((ord($de1{$i})>140&&ord($de1{$i})<245)?chr(ord($de1{$i})/2):$de1{$i}):"";
return(base64_decode($s9));
} function de2(&$de2){
global $c5;
if(strstr($de2,$c5)){
$de2=str_replace($c5,'',$de2);
$de2=gzuncompress($de2);
}
if(strstr($de2,$c5)){
$de2=str_replace($c5,'',$de2);
de2($de2);
} } ///////////////////////////// function strdecode($str){
$len = strlen($str);
$newstr = '';
for($i=0; $i<$len; $i++){
$n = ord($str[$i]);
$newstr .= decode($n);
}
return $newstr;
} function decode($dec){
if(($dec > 126 || $dec<32)){
return '['.$dec.']';
}else{
return chr($dec);
}
} function destr($str){
$k = 0;
$num = '';
$n = strlen($str);
$code = '';
for($i=0; $i<$n; $i++){
if($str[$i] == '['){
$k = 1;
}elseif($str[$i] == ']'){
$num = intval($num);
$code .= chr($num);
$k = 0;
$num = null;
}else{
if($k == 1){
$num .= $str[$i];
}else{
$code .= $str[$i];
}
}
}
return $code;
}
?>
phpjm解密程序,也适用于其他混淆加密的破解的更多相关文章
- 解析php混淆加密解密的手段,如 phpjm,phpdp神盾,php威盾
原文 解析php混淆加密解密的手段,如 phpjm,phpdp神盾,php威盾 php做为一门当下非常流行的web语言,常常看到有人求解密php文件,想当年的asp也是一样.一些人不理解为什么要混淆( ...
- 破解phpjm.net加密,解密程序,全部公布
原文:破解phpjm.net加密,解密程序,全部公布 2014-05-23更新: 很久没人找我解密了,看来这加密已过时,现公布我这边最新的解密工具. 若有解不出的可联系qq: 267014855 (不 ...
- base64随机字符混淆加密、解密-美拍视频地址解密,反推加密算法
用火车头测试采集美拍的数据时无意中发现美拍的视频地址是一段加了混淆字符串的base64代码.如下图 于是好奇之下研究了下解密算法.具体过程省略800字.发现美拍的视频解密是通过js完成,于是找到了具体 ...
- PHP加密解密数字,适用于URL加密。
本博主最近正在建设一个9元包邮的网站,希望各位光临指导一些意见: 9元包邮 http://www.jiubaou.com/ <?php /** * 加密解密类 * 该算法仅支持加密数字.比较适用 ...
- php混淆加密解密实战
在查看别人的php源码的时候,我们经常会看到加密后的php代码.那么php加密原理是什么呢?怎么解密呢? 混淆加密 我们从百度随便搜索一个加密网站,例如:http://dezend.qiling.or ...
- [.NET产品源码保护].NET防止反编译(非混淆加密)
.NET产品源码保护产生的背景: .NET源码加密方案支持C#及VB.NET等语言开发的ASP.NET及WINFORM应用.利用.NET支持托管代码与非托管代码共存的特性,将C#代码经过处理放于非托管 ...
- 小程序 之使用HMACSHA1算法加密报文
首先说说我们前端常用的加密技术, 我们常用的加密技术有:如MD5加密,base64加密 今天要说的是HMACSHA1加密技术 先介绍下什么是SHA1算法, 安全哈希算法(Secure Hash Alg ...
- 【Java】通过DES加密和解密工具,对字符串进行加密和解密操作
分享一个非常不错的字符串加密和解密的程序. 可以指定不同的密钥对同一字符串进行不同的加密操作,增强加密性能. Java代码如下: package com.app; import java.securi ...
- [asp.net mvc 奇淫巧技] 05 - 扩展ScriptBundle,支持混淆加密javascript
一.需求: 在web开发中,经常会处理javascript的一些问题,其中就包括js的压缩,合并,发布版本以及混淆加密等等问题.在asp.net 开发中我们使用ScriptBundle已经可以解决ja ...
随机推荐
- Caffe:深入分析(怎么训练)
main() 首先入口函数caffe.cpp int main(int argc, char** argv) { ...... ) { #ifdef WITH_PYTHON_LAYER try { # ...
- SpringBoot 使用Mybatis+MySql
pom配置 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http: ...
- Spring MVC @RequestBody自动转JSON HTTP415错误解决方法
转自:http://blog.csdn.net/tiantiandjava/article/details/46125141 项目中想用@RequestBody直接接收json串转成对象 网上查了使用 ...
- 创建Spring Boot微服务项目
创建一个测试用的微服务项目HelloWorld 创建项目 编写服务代码 @RestController public class HelloWorld { @RequestMapping(" ...
- Python之文件和异常IO
文件和异常 读写文本文件 读取文本文件时,需要在使用open函数时指定好带路径的文件名(可以使用相对路径或绝对路径)并将文件模式设置为'r'(如果不指定,默认值也是'r'),然后通过encoding参 ...
- 字典树(Trie树)实现与应用(转)
一.概述 1.基本概念 字典树,又称为单词查找树,Tire数,是一种树形结构,它是一种哈希树的变种. 2.基本性质 根节点不包含字符,除根节点外的每一个子节点都包含一个字符 从根节点到某一节点.路径上 ...
- 一些WinAPI 处理 字符的函数和连接(GetACP和SetThreadLocale最重要,还有SetConsoleCP)
虽然东西都是现成的.但是也要脑子里有个概念. // 地区与语言GetACP 取得 ANSI code page,法语XP+设置中文内核 = 936 // ShowMessage(IntToStr(Ge ...
- sqoop简单使用
一,通过sqoop将MySQL里面的数据加载到HDFS 先查看有哪些数据库 查看表person sqoop list-databases --connect jdbc:mysql://ly-p2p4: ...
- C# 获取一个文件的MD5值
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Tex ...
- JS window对象 返回前一个浏览的页面 back()方法
JS window对象 返回前一个浏览的页面 back()方法,加载 history 列表中的前一个 URL. 语法: window.history.back(); 返回前一个浏览的页面 back ...