|
[md]
方法来自 [爬虫.《使用python对微信小游戏跳一跳刷分》](https://zhuanlan.zhihu.com/p/32489227)
下载微信 6.6.1.apk
跳一跳 assets/whatsnew_embed/wx7c8d593b2c3a7703_3.wxapkg
# 如何解包
原作者参考 [《微信小程序源码阅读笔记1》](http://lrdcq.com/me/read.php/66.htm)
改写了 Python3 脚本 [jin10086.wxgameHacker](https://github.com/jin10086/wxgameHacker/blob/master/wxapkg_unpack.py)
解包后得到 game.js
# js
```
var r = {score: t, times: e, game_data: JSON.stringify(n)}, o = {
base_req: {session_id: a.default.sessionId, fast: 1},
action_data: (0, s.encrypt)(r, a.default.sessionId)
};
```
啊,啥意思?
不管了,看 s.encrypt 有 4 处定义,看这个
```
function (t, e, i) {
"use strict";
Object.defineProperty(e, "__esModule", {value: !0}), e.encrypt = function (t, e) {
var e = e.slice(0, 16), i = n.default.enc.Utf8.parse(e), r = n.default.enc.Utf8.parse(e), a = t;
a = JSON.stringify(a);
var o = n.default.AES.encrypt(a, i, {iv: r, mode: n.default.mode.CBC, padding: n.default.pad.Pkcs7});
return o = o.toString()
};
var n = function (t) {
return t && t.__esModule ? t : {default: t}
}(i(40))
}
```
其中
```
e.encrypt = function (t, e) {
var e = e.slice(0, 16);
i = n.default.enc.Utf8.parse(e);
r = n.default.enc.Utf8.parse(e);
a = t;
a = JSON.stringify(a);
var o = n.default.AES.encrypt(a, i, {iv: r, mode: n.default.mode.CBC, padding: n.default.pad.Pkcs7});
return o = o.toString()
};
```[/md] |
|