Giter Club home page Giter Club logo

pc_wxapkg_decrypt_python's Introduction

pc_wxapkg_decrypt_python

License

概述

PC微信小程序加密包解密方案 wxapkg

本脚本在PC微信版本 2.9.5.41 上测试可用, 不排除后续更新更换相关密钥参数的可能,如无法解密可自行替换。

准备工作

找到 C:\Users\{用户名}\Documents\WeChat Files\Applet 目录, 找到你要解密的 wxapkg文件, 以及目录父级目录的 微信APPID

使用

完成了准备工作之后, 就可以愉快的使用脚本了

命令

usage: main.py [-h] --wxid 微信小程序ID [--iv iv] [--salt salt] -f 加密的小程序包文件路径 -o
               解密后的小程序包文件路径

PC微信小程序wxapkg包解密工具

optional arguments:
  -h, --help            show this help message and exit
  --wxid 微信小程序ID
  --iv iv
  --salt salt
  -f 加密的小程序包文件路径, --file 加密的小程序包文件路径
  -o 解密后的小程序包文件路径, --output 解密后的小程序包文件路径

例子

# python main.py --wxid 微信APPID --file 输入文件 --output 输出文件
$ python main.py --wxid wx1234567890123456 --file __APP__.wxapkg --output dec.wxapkg

原理

PC版本的微信的加密特征: V1MMWX

下面直接引用 BlackTrace 大神的解释, 原文链接看下面相关链接里的GO版本代码。

首先pbkdf2生成AES的key。利用微信小程序id字符串为pass,salt为saltiest 迭代次数为1000。调用pbkdf2生成一个32位的key 首先取原始的wxapkg的包得前1023个字节通过AES通过1生成的key和iv(the iv: 16 bytes),进行加密 接着利用微信小程序id字符串的倒数第2个字符为xor key,依次异或1023字节后的所有数据,如果微信小程序id小于2位,则xorkey 为 0x66,把AES加密后的数据(1024字节)和xor后的数据一起写入文件,并在文件头部添加V1MMWX标识

相关链接

License

The MIT License(http://opensource.org/licenses/MIT)

请自由地享受和参与开源

pc_wxapkg_decrypt_python's People

Contributors

superdashu avatar

Watchers

 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.