摘自个人印象笔记,图不完整可查看原笔记:https://app.yinxiang.com/fx/c021af2d-9b6f-42fc-af05-71cf7c929e1c
So-and-so source code acquisition
- Install the Yeghen simulator, install w x on the simulator , and open the "w x index" applet %program%program%
- Use the RE manager to find the file with the wxapkg suffix in the root directory. The code is generally under:
/data/data/com.tencent.mm/MicroMsg/{a string of hexadecimal characters}/appbrand/pkg/ - Compress all the wxapkg files in the directory, copy them out, and prepare for decompilation
. //database/1452:1)] - Decompile with CrackMinApp or wxappUnpacker:
CrackMinApp:
CrackMinApp: https://github.com/Cherrison/CrackMinApp, pay attention to decompress CrackMinApp/nodejs/nodejs/node_modules.zip to the current directory.
Put the wxapkg file in the CrackMinApp/wxapkg directory, and use the UI to decompile it.
If you can’t decompile using the UI, you can use the command line to execute: node .\wuWxapkg.js {wxapkg directory and full file name path}
[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-W1YPGeGV-1691719083037)(en-resource://database/1454:1)]
wxappUnpacker:
wxappUnpacker: The original warehouse has been deleted, this is someone else's fork: https://github.com/system-cpu/wxappUnpacker
In the wxappUnpacker directory, execute the following command to install dependencies:
npm install
npm install esprima
npm install css-tree
npm install cssbeautify
npm install vm2
npm install uglify-es
npm install js-beautify
Then perform decompilation: node .\wuWxapkg.js {full path of wxapkg directory and file name}
[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-MrF8eIXU-1691719083037) (en-resource://database/1456:1)]
wx development tools edit source code
- The development tool opens the compiled source code directory, and solves the prompted errors one by one:
- Major errors like:
- app.json configuration error, solution: try to replace one by one according to the content of app-config.json
- The weui-miniprogram package in the miniprogram_npm directory conflicts with the extension library weui, and the solution is to delete the weui-miniprogram directory in the miniprogram_npm directory.
- Error: xxx.js has been ignored by code dependency analysis and cannot be referenced by other modules:
Solution: https://developers.weixin.qq.com/community/minihome/article/doc/00020631afc6c8c6f62e7b91855c13 - _typeof3 is not a function, solution:
find @babel/runtime/helpers/typeof.js and replace all with the following: (https://www.fenxianglu.cn/note/detail/399)
function _typeof2(o) {
"@babel/helpers - typeof";
return (_typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
})(o);
}
function _typeof(o) {
return "function" == typeof Symbol && "symbol" === _typeof2(Symbol.iterator) ? module.exports = _typeof = function (o) {
return _typeof2(o);
} : module.exports = _typeof = function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : _typeof2(o);
}, _typeof(o);
}
module.exports = _typeof;
- After the above errors are handled, it can basically run.
-
At this time, use Yeshen simulator + Charles to monitor the request and response data structure of w x , and simulate these data structures in the code
The first is the response structure after login:
[External link picture transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the picture and upload it directly (img-Uhl5aWek-1691719083038)(en-resource://database/1460:1 )]
Then wxindexgetusergroup request, the request parameters are:
{"openid":"ov4ns0Fzl49k2gyMVqBfWPHQzZiw","search_key":"1684309087552048_2933883850","action_type":3,"start_ymd":"20230513","end_ymd":"20230517","offset":0,"limit":20}
[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-9p0vVd6u-1691719083039)(en-resource://database/1462:1)] wxawebreport interface, parameters:
{ "openid": "ov4ns0Fzl49k2gyMVqBfWPHQzZiw", "search_key": "1684309087552048_2933883850", "cgi_name": "WxIndexComm", "clientversion": 0, "device": 2, "item_list": [{"logid":22549, "log_buffer ":",0,0,0"},{"logid":22549,"log_buffer":",0,0,9"}]}
[External link picture transfer failed, the source site may have an anti-leeching mechanism, It is recommended to save the picture and upload it directly (img-oXEl925T-1691719083040)(en-resource://database/1464:1)]
Key query interface:
https://search.weixin.qq.com/cgi-bin/wxaweb /wxindex, request parameters:
{
"openid": "ov4ns0Fzl49k2gyMVqBfWPHQzZiw",
"search_key": "1684389050025923_2103581176",
"cgi_name": "GetMultiChannel",
"query": ["儿童节"],
"start_ymd": "20210422",
"end_ymd": "20230518"
}
[External link image transfer failed, the source site may have an anti-leeching mechanism, it is recommended to save the image and upload it directly (img-cB1coK7k-1691719083041)(en-resource://database/1466:1)]
Open xcx, it will check whether the user is logged in, if not logged in, repeat the login 4 times, here directly returns an object of successful login when checking the login, and prevents it from logging in: [External link picture transfer failed, the source site may have an anti-leeching mechanism
, It is recommended to save the picture and upload it directly (img-jlRgxhxu-1691719083041)(en-resource://database/1458:1)]
For the design of login, see my other article: a successful wx index interface call, a failed wx index interface call