GithubHelp home page GithubHelp logo

php-mfenc-decompiler's Introduction

PHP mfenc Decompiler

PHP mfenc 反编译器

目前不保证反编译结果的正确性,仅供参考。

反汇编和结构化之后的汇编指令应该没什么问题。

Usage

use Ganlv\MfencDecompiler\AutoDecompiler;
use Ganlv\MfencDecompiler\Helper;

require __DIR__ . '/../vendor/autoload.php';

file_put_contents(
    $output_file,
    Helper::prettyPrintFile(
        AutoDecompiler::autoDecompileAst(
            Helper::parseCode(
                file_get_contents($input_file)
            )
        )
    )
);

Source Files

DfsDisassembler.php  主反汇编器(DFS算法)
Disassembler1.php    一级指令反汇编器
Disassembler2.php    二级指令反汇编器
instructions.php     二级指令匹配列表

GraphViewer.php                       反汇编指令列表->有向图转换器
DirectedGraph.php                     有向图类
DirectedGraphSimplifier.php           用于简化有向图的抽象类
DirectedGraphSimpleSimplifier.php     简单地合并1进1出和没有指令的节点
DirectedGraphStructureSimplifier.php  分析流程结构生成if、loop、break等语句

BaseDecompiler.php  基础反编译器
Decompiler.php      反编译指令
Beautifier.php      反编译后代码美化

VmDecompiler.php    自动将从ast中找到VM,并对其进行反编译的类
AutoDecompiler.php  全自动反汇编器

Helper.php                       助手函数
Formatter.php                    测试过程中用于把乱码变量名替换成英文
instructions_display_format.php  指令翻译

LICENSE

暂时保留所有权利

All Right Reserved.

php-mfenc-decompiler's People

Contributors

ganlvtech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-mfenc-decompiler's Issues

代码反编译的还是有些问题: https://share.weiyun.com/5bO7wdE

我比对了一下从云路破解的文件,发现代码恢复的有些还是有问题,比如:
用这个反编译:

function hqgetip111()
{
if (isset($_SERVER)) {
if (!$_SERVER['SERVER_ADDR']) {
}
}
return $server_ip;
}
云路破解
function hqgetip111()
{
if (isset($_SERVER))
{
if ($_SERVER['SERVER_ADDR'])
{
$server_ip=$_SERVER['SERVER_ADDR'];
}
else
{
$server_ip=$_SERVER['LOCAL_ADDR'];
}
}
else
{
$server_ip=getenv('SERVER_ADDR');
}
return $server_ip;
}

输出了空文件

测试了两个样本,发现有个样本没有输出正常的文件,而是一个空文件
Example.zip
linux下 php 7.1.5
样本输出了空文件,检查2进制文件中有序列化后的内容

windows下7.0.2
抛出异常

Parse error: syntax error, unexpected '=' in mofang\src\BaseDecompiler.php on line 114

正在排查php版本问题

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.