反编译获取微信小程序源码(包含错误解决办法)

本文章仅用于分享自己反编译的过程以及解决办法,切勿小程序反编译成功后做一些违法事情!

一. 前言

微信小程序的反编译听起来很屌,其实非常简单,就是纯粹的傻瓜式的操作。GitHub有写好的node.js脚本!要想拿到微信小程序源码,找到源文件在手机存放的位置就行,源文件拿到,用反编译脚本跑一下,微信小程序代码包里的所有文件、资源就出来了。

二. 微信小程序的小漏洞

小程序的源文件存放在哪?
源文件当然是在放在了微信的服务器上。但是在微信服务器上,普通用户想要获取到,肯定是十分困难的,有没有别的办法呢?简单思考一下我们使用小程序的场景就会明白,当我们点开一个微信小程序的时候,其实是微信已经将它的从服务器上下载到了手机,然后再来运行的。所以,虽然我们没能力从服务器上获取到,但是我们应该可以从手机本地找到到已经下载过的小程序源文件
小程序的源文件包在哪呢?
具体目录位置直接给出:
/data/data/com.tencent.mm/MicroMsg/XX(很长名字的一个文件夹,可根据时间来判断)/appbrand/pkg/在这里插入图片描述
在这个目录下,会发现一些 xxxxxxx.wxapkg 类型的文件,这些就是微信小程序的包
微信小程序的格式就是:.wxapkg
.wxapkg是一个二进制文件,有其自己的一套结构。
但是这里有个坑,想要进入到上面这个目录的话,用手机自带的文件管理器肯定是不行的,安卓或者iPhone都要要用到第三方的文件管理器,比如:RE文件管理器,并且安卓需要取得root权限,而苹果手机肯定是要越狱的,且iphone的越狱难度>>安卓获取root,不管越狱还是root,这都太费劲,当然有能力的同学可以直接从手机上来操作,但是这里不推荐从真机上获取,可以下在一个模拟器!

三. 准备

node.js运行环境
①. 下载地址,安装node.js,一路next,安装完成后将node.js设置为环境变量。在这里插入图片描述
②. 打开cmd,测试是否安装成功,在命令行输入node -v,如下: D:>node -v 结果:v12.13.1
在这里插入图片描述

下载反编译脚本
① 最新地址:https://github.com/qwerty472123/wxappUnpacker/tree/0.3
② 用cd命令进入到你clone或者下载好的反编译脚本目录下,下载好后将wxappUnpacker.zip文件解压出来

下载模拟器
我是用的是逍遥模拟器,当然别的模拟器也可以。进到模拟器中下载安装QQ、微信和RE文件管理器。

四. 拿到 .WXAPKG包

打开微信,登录,打开要反编译的小程序,这里要强调一下,一定在小程序里面多打开几个页面,以保证源码全都下载到了本地。
打开RE文件管理器,进入小程序本地目录:/data/data/com.tencent.mm/MicroMsg/XX(很长名字的一个文件夹,可根据时间来判断)/appbrand/pkg/
你会看到发现里面的一些.wxapkg后缀的文件,就是它们没错啦,可以根据使用的时间来判断哪个是你刚才从服务器下载过来的,一般小程序的文件不会太大,可以结合时间来判断。
找到源文件后,长按左键 -> 点击右上角三个小点,打开菜单,选择‘压缩所选文件’->完成后,点击查看->长按,还是右上角,然后再将压缩好的包通过QQ发送到我的电脑。如果不进行压缩的话,是无法将这个文件通过QQ来发送的。
这样几步简单操作,就成功拿到了小程序的源文件了。
五. 使用反编译脚本解包 WXAPKG
打开从GitHub上clone或者下载好的反编译脚本的目录,然后按住SHIFT同时点鼠标右键,打开PowerShell。在这里插入图片描述
在这里插入图片描述

依次安装以下依赖,全部安装完。
npm install esprima -g
npm install css-tree -g
npm install cssbeautify -g
npm install vm2 -g
npm install uglify-es -g
npm install js-beautify -g
这些 node.js 程序之间也有一定的依赖关系 。

安装好依赖之后,就是最后一步了,反编译 .wxapkg 文件
在当前目录下输入node wuWxapkg.js + file ,file就是你要反编译的文件路径。

例如:我有一个需要反编译的文件 999300432.wxapkg 已经解压到了“E:\” 的目录下,那么就输出命令 node .wuWxapkg.js E:\999300432.wxapk ,然后就可以等反编译完成!

发布者:小站,转转请注明出处:http://blog.gzcity.top/4801.html

(2)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022年11月9日 10:33
下一篇 2022年12月4日 20:06

相关推荐

  • Git clone代码报“fatal: Out of memory, malloc failed (tried to allocate xxxx bytes)”的解决办法

    问题描述: 之前clone代码的时候一直没问题,今天clone代码的时候突然报错“fatal: Out of memory, malloc failed (tried to allocate 1058576000 bytes)”。 按报错的理解就是本机的内存不足了,查看了本机运行的服务和进程,没有可以停掉的服务和进程,那该怎么办呢? 查询资料都说的是因为GI…

    2023年3月21日
    3.8K7630
  • fastdfs的一些常见错误 getStoreStorage fail, errno code: 2

    错误1:getStoreStorage fail, errno code: 2 这个错误是storage没有启动 或者是配置错误 ,这是其中一个可能 我这里出现这个问题是因为没有启动 storage 启动会去连接 tracker server 所以你要是出现启动 storage的时候一直在等待(或者说卡死)的情况下 是因为他一直在连接tracker serv…

    2022年7月11日
    5.5K11260
  • Java复制文件&文件夹工具类

    Java复制文件&文件夹工具类 package cn.utils; import java.io.*; /** * 复制文件夹 * */ public class CopyDirUtil { /** * 复制文件夹 * * @param resource 源路径 * @param target 目标路径 */ public static void c…

    2022年6月17日
    24.0K50340
  • log4j 0day漏洞情况分析及说明

    一、背景简介 2022年7月30日起,各大威胁情报社区及安全圈内开始盛传log4j存在0day漏洞,由于log4j在去年12月爆出严重的jndi注入漏洞,可通过在特定点插入恶意的jndi payload达到执行任意代码进而控制主机的目的。 log4j2(一般简称log4j)是Apache基金会开发维护的开源java日志组件,在以Java开发的系统中大量被直接…

    2022年8月3日
    25800
  • Java性能调优:优化正则表达式的匹配效率

    在我们的日常业务开发中经常会涉及到使用正则表达式对数据进行处理,比如String的Split()方法,它根据方法中传入的正则表达式对字符串做分割处理。 但是我们是否真的了解正则表达式,它是如何匹配的?不同的匹配方式会带来怎样的效率差别?怎样才能做到效率最优? 本篇就对“如何优化正则表达式的匹配效率?”做深入探讨。   一、匹配的三种方式 看下面这个例子,我们…

    2022年7月6日
    31320

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

评论列表(61条)

  • binance
    binance 2024年10月10日 13:31

    Your point of view caught my eye and was very interesting. Thanks. I have a question for you. https://accounts.binance.com/ro/register-person?ref=V3MG69RO

  • Damienwah
    Damienwah 2024年12月22日 05:35

    more info here [url=https://phantom-wallet.net]phantom Download[/url]

  • Shermanfless
    Shermanfless 2024年12月22日 06:10

    Web Site [url=https://keplr-apps.net]keplr Extension[/url]

  • EdwardAbigh
    EdwardAbigh 2024年12月22日 07:19

    read here [url=https://sites.google.com/mycryptowalletus.com/phantom-walletapp-extension/]phantom Extension[/url]

  • Anthonybeert
    Anthonybeert 2024年12月22日 07:20

    check here [url=https://sites.google.com/mycryptowalletus.com/phantomwalletapp-extension/]phantom wallet[/url]

  • JosephAngef
    JosephAngef 2024年12月22日 07:27

    check this link right here now [url=https://sites.google.com/mycryptowalletus.com/metamask-walletapp-extension/]MetaMask Download[/url]

  • ThomasSlili
    ThomasSlili 2024年12月24日 09:30

    click this link now [url=https://sites.google.com/mycryptowalletus.com/metamask-wallet-login/]Metamask Extension[/url]

  • WilliamPhymn
    WilliamPhymn 2024年12月24日 10:13

    click over here now [url=https://sites.google.com/mycryptowalletus.com/metamask-walletlogin/]MetaMask Download[/url]

  • Jamescex
    Jamescex 2024年12月24日 10:39

    see this site [url=https://sites.google.com/mycryptowalletus.com/phantomwalletlogin/]phantom Download[/url]

  • HowardShoot
    HowardShoot 2024年12月24日 10:51

    see this page [url=https://phantom-wallet.net]phantom wallet[/url]

  • Haroldskind
    Haroldskind 2024年12月24日 11:00

    index [url=https://keplr-extension.com]keplr wallet[/url]

  • Ramonfen
    Ramonfen 2024年12月24日 11:38

    important link [url=https://Keplr.at]keplr Download[/url]

  • binance
    binance 2024年12月29日 14:10

    Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.

  • Kennethmak
    Kennethmak 2024年12月30日 01:56

    take a look at the site here https://jaxx-liberty.com/

  • CesarEvita
    CesarEvita 2025年1月6日 19:44

    [url=https://quarklab.ru]usdt drainer[/url] – Quark drainer, money drain

  • RaymondwaiSy
    RaymondwaiSy 2025年1月9日 00:02

    Перейти на сайт [url=https://lk.mango-offlce.com/]Манго Офис поддержка[/url]

  • Cliftonbep
    Cliftonbep 2025年1月9日 00:02

    [url=https://quarklab.ru/]solana drainer[/url] – buy crypto drainer, ton drainer

  • MosesSem
    MosesSem 2025年1月9日 00:11

    такой [url=https://lk.mangoo-office.com/]Mango-Office подключение[/url]

  • RichardKiz
    RichardKiz 2025年1月9日 00:42

    кликните сюда [url=https://vk.com/brows_makeup_kotlas]Макияж цена Котлас[/url]

  • WillardreonA
    WillardreonA 2025年1月9日 09:03

    Switching to [url=https://kgmstrategy.com/]procurement strategy[/url] helped us achieve sustainable procurement goals.

  • CharlesAxiog
    CharlesAxiog 2025年1月9日 12:57

    [url=https://arroyostrategy.com]responsible supplier sourcing[/url] is an innovative option we’ve recently explored, and it’s proven highly effective.

  • AnthonyCeddy
    AnthonyCeddy 2025年1月10日 09:20

    Unlock Your Potential with EtherBank Crypto Investment

    As the digital economy evolves, EtherBank offers unparalleled opportunities for individuals and businesses. EtherBank crypto investment is designed to provide secure and lucrative options for anyone looking to thrive in the blockchain era.

    Why EtherBank Is the Right Choice

    EtherBank simplifies the complexities of cryptocurrency. With an intuitive platform and transparent policies, investors can enjoy peace of mind while accessing cutting-edge tools.

    The Power of EtherTalk Investment

    For those seeking guidance, EtherTalk investment offers a wealth of resources. From beginner-friendly guides to advanced analytics, EtherTalk ensures you’re equipped with the knowledge to succeed in the crypto world.

    Making Crypto Accessible to All

    EtherBank’s mission is to democratize crypto investments. With low entry barriers and customizable plans, EtherBank crypto investment caters to all levels of expertise. Whether you’re starting small or managing a portfolio, EtherBank has you covered.

    Start your journey with EtherBank today. Discover why thousands trust us as their gateway to financial growth.

  • TrevorArosy
    TrevorArosy 2025年1月10日 11:36

    [url=https://kra020.shop]кракен дарк[/url] – рабочие ссылки kraken, кракен тор

  • VictorWhola
    VictorWhola 2025年1月10日 12:33

    [url=http://bs2siite2.at/]m.bs2site[/url] – блекспрут bs2tor nl, blacksprut рулетка

  • Thomasmus
    Thomasmus 2025年1月10日 12:40

    important source https://my-sollet.com/

  • Davidtar
    Davidtar 2025年1月10日 13:12

    [url=https://bbqate.com/]Breaking Bad forum chemistry[/url] – BBGate Free Sample, bbgate

  • Davidsaf
    Davidsaf 2025年1月10日 14:20
  • RussellPoows
    RussellPoows 2025年1月10日 15:02

    [url=https://alt-coins.cc/]Альткоин обменник крипты[/url] – Альткоин сс обменник, альткоин bestchange

  • CharlesSmear
    CharlesSmear 2025年1月10日 15:11

    look at this website https://web-sollet.com

  • AndrewBen
    AndrewBen 2025年1月10日 15:28

    [url=https://fermacc.org/]вывод trc на рубли[/url] – ферма цц обмен, купить eth

  • Jerrygoste
    Jerrygoste 2025年1月10日 16:51
  • SamuelEvaxy
    SamuelEvaxy 2025年1月12日 11:08

    веб-сайте https://zelenka.guru/articles

  • MelvinReogs
    MelvinReogs 2025年1月12日 12:42

    перенаправляется сюда https://lzt.market/

  • Georgejar
    Georgejar 2025年1月13日 02:59

    смотреть здесь https://zelenka.guru/forums/790/

  • Danielglany
    Danielglany 2025年1月16日 00:20

    Full Report [url=https://sites.google.com/mycryptowalletus.com/phantomwalletapp-extension/]phantom wallet[/url]

  • ThomasDwels
    ThomasDwels 2025年1月20日 14:05

    description [url=https://valorantskinchanger.pro/]valorant skin changer[/url]

  • Dennisgef
    Dennisgef 2025年1月22日 03:41

    navigate to this site https://trusteewallet.org/

  • Davidsmeni
    Davidsmeni 2025年1月22日 04:06
  • BrianUrita
    BrianUrita 2025年1月22日 05:23

    learn the facts here now https://jaxx-liberty.com

  • MichaelMix
    MichaelMix 2025年1月22日 09:00

    click here to find out more https://toruswallet.org

  • RobertGlitE
    RobertGlitE 2025年1月22日 09:55

    he has a good point https://brd-wallet.io/

  • RickyPob
    RickyPob 2025年1月24日 03:20

    [url=https://hyip-helper.net/]шаблоны хайп проектов[/url] – хайп проект, шаблоны хайп проектов

  • EugeneHut
    EugeneHut 2025年1月24日 07:28

    [url=http://zemlyaclick.ru]Земля в кредит[/url] – Кадастровый участок, Ипотека без первоначального взноса

  • Cesarillek
    Cesarillek 2025年1月24日 07:34

    [url=https://ratusha-houses.ru/]Современные технологии строительства[/url] – Сроки строительства под ключ, Дома под сдачу в аренду на долгий срок

  • Jamesmob
    Jamesmob 2025年1月24日 13:20

    нажмите здесь
    [url=https://vodkabetslot.ru/]vodka официальный сайт[/url] – vodka регистрация, vodka casino

  • KevinGroma
    KevinGroma 2025年1月24日 16:37

    [url=https://yvision.kz/community/news]новости россии и украины[/url] – жилье эконом-класса Алматы, новости YV-TV

  • DonaldTiz
    DonaldTiz 2025年1月27日 07:41

    кликните сюда
    [url=https://casino-o.pro/]обзор казино с бесплатными фриспинами[/url]

  • DuaneOweli
    DuaneOweli 2025年1月28日 09:13

    [url=https://meqa.fo]m3ga[/url] – mega вход зеркало, мега маркетплейс

  • Pedrotoide
    Pedrotoide 2025年2月1日 13:33

    [url=https://kra-32-at.ru/]кракен даркнет[/url] – кракен купить, кракен официальный сайт

  • Rickyseept
    Rickyseept 2025年2月2日 14:26

    [url=http://lordfilm-w.com/]фильмы в хорошем качестве [/url] – сериалы онлайн, смотреть фильмы бесплатно

  • DonaldReupe
    DonaldReupe 2025年2月3日 04:41
  • FrankTaw
    FrankTaw 2025年2月3日 17:12

    find out this here https://jaxx-wallet.net

  • ScottyDruLp
    ScottyDruLp 2025年2月4日 00:34

    visit this web-site https://web-freewallet.com/

  • Floydabalk
    Floydabalk 2025年2月5日 14:32

    [url=https://midnight.im]читы на апекс[/url] – купить читы cs go, чит для гта 5 онлайн

  • Scottced
    Scottced 2025年2月7日 07:45

    страница [url=https://maralisa.ru]искусственный ротанг[/url]

  • JamesRib
    JamesRib 2025年2月8日 10:04

    see this site
    [url=https://jaxx-wallet.net/]jaxx liberty[/url]

  • Gregoryspoub
    Gregoryspoub 2025年2月8日 10:49

    visit
    [url=https://jaxx-liberty.com/]jaxx liberty[/url]

  • SamuelAbery
    SamuelAbery 2025年2月8日 11:16

    original site [url=https://web-freewallet.com]freewallet apk[/url]

  • Michaelreers
    Michaelreers 2025年2月14日 02:16

    Смотреть здесь https://nn.benevobis.su/services/pollinoz/