Coder Social home page Coder Social logo

orionnnnnnn / wedecode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from biggerstar/wedecode

0.0 0.0 0.0 416 KB

微信小程序 wxapkg 包 源代码还原工具, 线上代码安全审计

License: GNU General Public License v3.0

JavaScript 7.99% TypeScript 88.07% HTML 3.95%

wedecode's Introduction

Wedecode


npm package license license


微信 wxapkg 反编译工具, 支持 小程序小游戏

准备

该工具只能在有 nodejs 环境设备上运行, 如果您还没有 nodejs 环境,点这里 去准备环境

安装工具

全局安装, 安装完成后在任意终端都可使用

# window
  npm i wedecode -g
# mac
  sudo npm i wedecode -g

运行

命令行直接输入 wedecode 即可运行, 全程自动引导

  wedecode

命令行直接指定

# 手动指定一个包
  wedecode ./xxx.wxapkg
# 或者   直接编译整个文件夹里面的主包和子包
  wedecode ./dir
# 或者:  指定所有子包和主包输出到指定目录 --out 为输出目录
  wedecode ./dir  --out ./all_child_file_out

使用源码运行

  git clone https://github.com/biggerstar/wedecode
  npm i  # 如果 npm 安装很慢, 可以使用右侧命令换国内的淘宝源  npm config set registry https://registry.npmmirror.com
  npm run start

命令参数

参数 作用
<packages...> 包所在路径,可以是文件或者目录
-o, --out 产物及输出路径, 未指定默认放到同级目录下的 __OUTPUT__
-ow --overwrite 是否直接覆盖旧产物

polyfill

在编译过程中, 在包所在文件夹在创建一个 polyfill 目录,如果发现里面的模块和输出到产物中的模块路径名称一致, 将会使用自定义的js模块,忽略原本js模块的编译

小程序包所在位置目录结构
  
├── target_dir  
│   ├── xxx.wxapkg    
│   ├── xxx-sub.wxapkg    
│   └── polyfill/  
│       └── @babel/    
│           └── array.js    

输出产物目录结构   

├── OUTPUT  
│   ├─ app.json  
│   ├─ pages/  
│   ├─ components/  
│   ├─ @babel/  
│      └── array.js

QA

  1. Q: 为何编译出来好多文件只有默认模板?
    A: 这可能是缺失分包,你需要把分包放在一起编译, 你可以在 app.config.json 或者 app.json 文件中查看你依赖的分包信息,
    在编译产物中出现默认模板是因为小程序会检查依赖,为了保证在缺失部分分包的情况下正常运行而生成的默认模板

免责声明

该工具仅限用于 线上代码安全审计以便快速发现漏洞 以及 手残党误删源代码丢失后还原项目减少损失,
严禁任何非法用途。
若你使用的范围不在允许范围内,造成的一切法律后果与作者无关。

wedecode's People

Contributors

biggerstar avatar

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.