當(dāng)前位置:首頁(yè) > IT技術(shù) > 微信平臺(tái) > 正文

微信小程序分包反編譯教程
2021-07-26 10:26:18

?

以EMS中國(guó)郵政速遞物流小程序?yàn)槔榻B下帶分包小程序反編譯操作流程

應(yīng)部分同學(xué)的要求做了一個(gè)分包教程

實(shí)驗(yàn)環(huán)境

  • 操作系統(tǒng):MacOS v10.15.7

  • node: v10.18.0

  • 微信開(kāi)發(fā)者工具: Nightly v1.04.2011202

前置準(zhǔn)備

  • 需要安裝pc端模擬器工具可以選擇網(wǎng)易MuMu,或者其它模擬器

  • 模擬器設(shè)置中配置共享文件夾

  • 下載反編譯工具

    • wxappUnpacker:https://github.com/xuedingmiaojun/wxappUnpacker

模擬器內(nèi)軟件安裝

需要安裝以下兩個(gè)軟件

  • RE文件管理器(獲取root權(quán)限,查看小程序壓縮包)

  • 微信(使用微信打開(kāi)小程序以下載小程序包)
    微信小程序分包反編譯教程_微信小程序

獲取小程序包

1.使用自己手機(jī)上的微信打開(kāi)"EMS中國(guó)郵政速遞物流"小程序,可以添加到"我的小程序"
2.打開(kāi)模擬器的微信并登錄
3.在模擬器微信的下拉小程序最近使用歷史中打開(kāi)"EMS中國(guó)郵政速遞物流",如果歷史記錄中沒(méi)有就在我的小程序中找一找
4.打開(kāi)小程序等待加載之后點(diǎn)擊相關(guān)頁(yè)面就可以去找源碼包了
5.打開(kāi)RE文件管理器,進(jìn)入到以下路徑查找源碼包(可以根據(jù)下載時(shí)間區(qū)分出你想要的源碼包)

  1. /data/data/com.tencent.mm/MicroMsg/4c8188dbf07eec893d0ac90974657aeb/appbrand/pkg

6.拷貝小程序包至模擬器共享文件夾
微信小程序分包反編譯教程_微信小程序_02獲取完畢。

開(kāi)始解包

這個(gè)小程序分包不多,只有一個(gè)。

解包流程

1.復(fù)制小程序包文件夾到工具根目錄,cd 進(jìn)入工具根目錄
如果沒(méi)有安裝過(guò)依賴包就先執(zhí)行安裝

  1. npm install

2.解主包

  1. ./bingo.sh ems/_1968016507_142.wxapkg

可以看到命令行輸出如下提示

  • ?
node /Users/xg/project/wxappUnpacker/wuWxapkg.js Unpack file ems/_1968016507_142.wxapkg...
Header info: firstMark: 0xbe unknownInfo: 0 infoListLength: 7589 dataLength: 2424590 lastMark: 0xed
File list info: fileCount: 220Saving files...Unpack done.Split app-service.js and make up configs & wxss & wxml & wxs...deal config okdeal js okdeal wxss.js okdeal css ok=======================================================這個(gè)小程序采用了分包子包個(gè)數(shù)為: 1 =======================================================Decompile ./components/Dialog/dialog.wxml...Decompile success!Decompile ./components/address-card/address-card.wxml...Decompile success!Decompile ./components/address-view/address-view.wxml...Decompile success!Decompile ./components/agreeMent/agreeMent.wxml...Decompile success!Decompile ./components/appointment/appointment.wxml...Decompile success!Decompile ./components/childaddress-card/childaddress-card.wxml...Decompile success!Decompile ./components/cityView/cityView.wxml...Decompile success!Decompile ./components/cropper/cropper.wxml...Decompile success!Decompile ./components/pasteboard/pasteboard.wxml...Decompile success!Decompile ./components/realInfo-view/realInfo-view.wxml...Decompile success!Decompile ./components/show-model/show-model.wxml...Decompile success!Decompile ./components/show-protocol/show-protocol.wxml...Decompile success!Decompile ./components/tip/tip.wxml...Decompile success!Decompile ./pages/address/address.wxml...Decompile success!Decompile ./pages/batchGoodsType/batchGoodsType.wxml...Decompile success!Decompile ./pages/batchRecognition/batchRecognition.wxml...Decompile success!Decompile ./pages/batchRecognitionSuccess/batchRecognitionSuccess.wxml...Decompile success!Decompile ./pages/batchSend/batchSend.wxml...Decompile success!Decompile ./pages/batchSendList/batchSendList.wxml...Decompile success!Decompile ./pages/batchSendSuccess/batchSendSuccess.wxml...Decompile success!Decompile ./pages/dropin_order/order.wxml...Decompile success!Decompile ./pages/emsCropper/emsCropper.wxml...Decompile success!Decompile ./pages/estimatedCost/estimatedCost.wxml...Decompile success!Decompile ./pages/evaluate/evaluate.wxml...Decompile success!Decompile ./pages/follow/follow.wxml...Decompile success!Decompile ./pages/freightTime/freightTime.wxml...Decompile success!Decompile ./pages/home/home.wxml...Decompile success!Decompile ./pages/inviteFriends/inviteFriends.wxml...Decompile success!Decompile ./pages/inviteOrder/inviteOrder.wxml...Decompile success!Decompile ./pages/main/main.wxml...Decompile success!Decompile ./pages/message/message.wxml...Decompile success!Decompile ./pages/myMessage/myMessage.wxml...Decompile success!Decompile ./pages/newOrEditAddress/newOrEditAddress.wxml...Decompile success!Decompile ./pages/orderDetails/orderDetails.wxml...Decompile success!Decompile ./pages/orderDetailsByCancel/orderDetailsByCancel.wxml...Decompile success!Decompile ./pages/place_order/order.wxml...Decompile success!Decompile ./pages/printOrders/printOrders.wxml...Decompile success!Decompile ./pages/queryMail/queryMail.wxml...Decompile success!Decompile ./pages/queryResult/queryResult.wxml...Decompile success!Decompile ./pages/returnGoods/returnGoods.wxml...Decompile success!Decompile ./pages/wxLogin/wxLogin.wxml...Decompile success!Guess wxss(first turn)...splitJs: /Users/xg/project/wxappUnpacker/ems/_1968016507_142/app-service.js@babel/runtime/helpers/arrayWithoutHoles.js@babel/runtime/helpers/asyncToGenerator.js@babel/runtime/helpers/defineProperty.js@babel/runtime/helpers/interopRequireDefault.js@babel/runtime/helpers/iterableToArray.js@babel/runtime/helpers/nonIterableSpread.js@babel/runtime/helpers/toConsumableArray.js@babel/runtime/regenerator.jspages/address/city-data.min.jsutils/barIndex.jsutils/barcode.jsutils/base64.jsutils/bluetooth.jsutils/common.jsutils/config.jsutils/internationalCode/hkList.jsutils/internationalCode/internationalCode.jsutils/login.jsutils/md5.jsutils/qqmap-wx-jssdk.min.jsutils/qrcode.jsutils/requestApi.jsutils/urlEncodeGBK.min.jsapp.jscomponents/Dialog/dialog.jscomponents/address-card/address-card.jscomponents/address-view/address-view.jscomponents/agreeMent/agreeMent.jscomponents/appointment/appointment.jscomponents/childaddress-card/childaddress-card.jscomponents/cityView/cityView.jscomponents/cropper/cropper.jscomponents/pasteboard/pasteboard.jscomponents/realInfo-view/realInfo-view.jscomponents/show-model/show-model.jscomponents/show-protocol/show-protocol.jscomponents/tip/tip.jspages/main/main.jspages/place_order/order.jspages/dropin_order/order.jspages/home/home.jspages/address/address.jspages/newOrEditAddress/newOrEditAddress.jspages/follow/follow.jspages/printOrders/printOrders.jspages/batchSend/batchSend.jspages/batchSendSuccess/batchSendSuccess.jspages/emsCropper/emsCropper.jspages/message/message.jspages/estimatedCost/estimatedCost.jspages/freightTime/freightTime.jspages/queryMail/queryMail.jspages/wxLogin/wxLogin.jspages/inviteFriends/inviteFriends.jspages/inviteOrder/inviteOrder.jspages/myMessage/myMessage.jspages/orderDetails/orderDetails.jspages/batchRecognition/batchRecognition.jspages/batchRecognitionSuccess/batchRecognitionSuccess.jspages/evaluate/evaluate.jspages/batchGoodsType/batchGoodsType.jspages/orderDetailsByCancel/orderDetailsByCancel.jspages/batchSendList/batchSendList.jspages/queryResult/queryResult.jspages/returnGoods/returnGoods.jsSplitting "/Users/xg/project/wxappUnpacker/ems/_1968016507_142/app-service.js" done.Import count info: {"./bin/weui.wxss":3}Guess wxss(first turn) done.Generate wxss(second turn)...Generate wxss(second turn) done.Save wxss...saveDir: /Users/xg/project/wxappUnpacker/ems/_1968016507_142Split and make up done.Delete files...Deleted.
File done.Total use: 4801.182ms

3.解分包
命令格式:./bingo.sh分包.wxapkg-s=主包目錄

  1. ./bingo.sh ems/_-844810613_142.wxapkg -s=ems/_1968016507_142


執(zhí)行結(jié)果

  • ?
node /Users/xg/project/wxappUnpacker/wuWxapkg.js Unpack file ems/_-844810613_142.wxapkg...
Header info: firstMark: 0xbe unknownInfo: 0 infoListLength: 2065 dataLength: 518422 lastMark: 0xed
File list info: fileCount: 38Saving files...Unpack done.now dir: /Users/xg/project/wxappUnpacker/ems/_-844810613_142param of mainDir: ems/_1968016507_142sub package word dir: /Users/xg/project/wxappUnpacker/ems/_-844810613_142/packageAreal mainDir: /Users/xg/project/wxappUnpacker/ems/_-844810613_142/ems/_1968016507_142Split app-service.js and make up configs & wxss & wxml & wxs...deal js okdeal sub html oksplitJs: /Users/xg/project/wxappUnpacker/ems/_-844810613_142/packageA/app-service.jspackageA/components/advertBanner/advertBanner.jspackageA/pages/advertLoadHtl/advertLoadHtl.jspackageA/pages/internationalOrder/baojia/baojia.jspackageA/pages/internationalOrder/goodsName/goodsName.jspackageA/pages/printer/printer.jspackageA/pages/explain/explain.jspackageA/pages/invoice/invoice.jspackageA/pages/certification/certification.jspackageA/pages/member/member.jspackageA/pages/newAddAddress/newAddAddress.jspackageA/pages/goodsType/goodsType.jspackageA/pages/orderDoorResult/orderDoorResult.jspackageA/pages/orderSelfResult/orderSelfResult.jspackageA/pages/internationalAddress/receive/receive.jspackageA/pages/internationalList/internationalList.jspackageA/pages/interOrderDetails/interOrderDetails.jspackageA/pages/internationalOrder/haiguan/haiguan.jspackageA/pages/internationalOrder/internationalOrder.jspackageA/pages/internationalSuccess/internationalSuccess.jspackageA/pages/internationalOrder/addHaiguanContent/addHaiguanContent.jspackageA/pages/stayInviteOrder/stayInviteOrder.jspackageA/pages/pickUpComplaint/pickUpComplaint.jspackageA/pages/complaintSuccess/complaintSuccess.jspackageA/pages/complaintDetail/complaintDetail.jspackageA/pages/entertainment/entertainment.jsSplitting "/Users/xg/project/wxappUnpacker/ems/_-844810613_142/packageA/app-service.js" done.Decompile ./packageA/components/advertBanner/advertBanner.wxml...Decompile success!Decompile ./packageA/pages/advertLoadHtl/advertLoadHtl.wxml...Decompile success!Decompile ./packageA/pages/certification/certification.wxml...Decompile success!Decompile ./packageA/pages/complaintDetail/complaintDetail.wxml...Decompile success!Decompile ./packageA/pages/complaintSuccess/complaintSuccess.wxml...Decompile success!Decompile ./packageA/pages/entertainment/entertainment.wxml...Decompile success!Decompile ./packageA/pages/explain/explain.wxml...Decompile success!Decompile ./packageA/pages/goodsType/goodsType.wxml...Decompile success!Decompile ./packageA/pages/interOrderDetails/interOrderDetails.wxml...Decompile success!Decompile ./packageA/pages/internationalAddress/receive/receive.wxml...Decompile success!Decompile ./packageA/pages/internationalList/internationalList.wxml...Decompile success!Decompile ./packageA/pages/internationalOrder/addHaiguanContent/addHaiguanContent.wxml...Decompile success!Decompile ./packageA/pages/internationalOrder/baojia/baojia.wxml...Decompile success!Decompile ./packageA/pages/internationalOrder/goodsName/goodsName.wxml...Decompile success!Decompile ./packageA/pages/internationalOrder/haiguan/haiguan.wxml...Decompile success!Decompile ./packageA/pages/internationalOrder/internationalOrder.wxml...Decompile success!Decompile ./packageA/pages/internationalSuccess/internationalSuccess.wxml...Decompile success!Decompile ./packageA/pages/invoice/invoice.wxml...Decompile success!Decompile ./packageA/pages/member/member.wxml...Decompile success!Decompile ./packageA/pages/newAddAddress/newAddAddress.wxml...Decompile success!Decompile ./packageA/pages/orderDoorResult/orderDoorResult.wxml...Decompile success!Decompile ./packageA/pages/orderSelfResult/orderSelfResult.wxml...Decompile success!Decompile ./packageA/pages/pickUpComplaint/pickUpComplaint.wxml...Decompile success!Decompile ./packageA/pages/printer/printer.wxml...Decompile success!Decompile ./packageA/pages/stayInviteOrder/stayInviteOrder.wxml...Decompile success!Guess wxss(first turn)...Import count info: {}Guess wxss(first turn) done.Generate wxss(second turn)...Generate wxss(second turn) done.Save wxss...saveDir: /Users/xg/project/wxappUnpacker/ems/_-844810613_142/ems/_1968016507_142

4.將分包內(nèi)容拷貝至主包相應(yīng)目錄

導(dǎo)入開(kāi)發(fā)者工具

打開(kāi)微信開(kāi)發(fā)者工具,導(dǎo)入項(xiàng)目
注意在項(xiàng)目設(shè)置中勾選不校驗(yàn)合法域名

微信小程序分包反編譯教程_微信小程序_03

參考資料

  • 網(wǎng)易MuMu:http://mumu.163.com/

?

微信小程序分包反編譯教程_微信小程序_04

啥??微信小程序逆向教程微信小程序上線嘞


微信小程序分包反編譯教程_微信小程序_05

微信小程序解包常見(jiàn)問(wèn)題匯總第二彈


微信小程序分包反編譯教程_微信小程序_06

2020年微信小程序解包常見(jiàn)問(wèn)題匯總


微信小程序分包反編譯教程_微信小程序_07

一起來(lái)探索下微信小程序包的魔數(shù)


微信小程序分包反編譯教程_微信小程序_08

微信小程序逆向源碼深度揭秘


微信小程序分包反編譯教程_微信小程序_09

介紹一個(gè)可跨平臺(tái)的微信小程序反編譯客戶端

?

本文摘自 :https://blog.51cto.com/x

開(kāi)通會(huì)員,享受整站包年服務(wù)立即開(kāi)通 >