合规国际互联网加速 OSASE为企业客户提供高速稳定SD-WAN国际加速解决方案。 广告
### webpack自吐 案例url: http://www.mtzh.top/mtzh_h5/#/pages/SearchProducts/index?searchName=%E8%9C%82%E5%A7%BF%E6%B0%B4300&searchType=1&index=0 ![](https://img.kancloud.cn/af/92/af9226a8eaf3b45437ab02dfb8464a5d_1712x762.png) . 找到 sign生成的地方 ``` { sign: d, word: a.cartKeywords, OpenID: uni.getStorageSync('openID'), Screen: a.tranche ? '' == a.sortStr ? '7:1' : a.sortStr + ',7:1' : a.sortStr } ``` ``` var d = (0, s.RSAEncrypt) (c, a.key); ``` 发现这个加密是 d生成的,s 是webpack结构找到s生成的位置,断点找到 webpack加载器 ``` var s = e("fadf") ``` ``` function f(a) { if (d[a]) return d[a].exports; var n = d[a] = { i: a, l: !1, exports: { } }; return e[a].call(n.exports, n, n.exports, f), n.l = !0, n.exports } ``` 添加记录点查看 模块名 ![](https://img.kancloud.cn/1e/5a/1e5a28d8574c583252053eb9afea4998_677x310.png) ![](https://img.kancloud.cn/d9/d2/d9d2d2bb41d10a57634bfabb1d1ba036_455x395.png) 我们需要断住 模块 "fadf" 到模块 "41dd" 之间加载的模块 ![](https://img.kancloud.cn/7c/e1/7ce1860501c580eb694761fb9e33576e_751x157.png) 进入f堆载 查看 d和e,这两个都是加载了模块 (d对象里面是没有加载完整的模块) ![](https://img.kancloud.cn/67/3b/673b816b1e18c2ec27e6676547b1e24d_561x297.png) ![](https://img.kancloud.cn/ec/e9/ece9896046c176e4f3ae61debff2191d_1137x141.png) 到加载器这里添加条件断点 ``` wbp[a] = e[a], 0 ``` ![](https://img.kancloud.cn/c5/fd/c5fde9027f7731d663050c98b53a42fe_785x314.png) 刷新网页,控制台清空 d对象(已加载的模块),然后声明wbp对象,释放断点 ``` d = {} wbp = {} ``` ![](https://img.kancloud.cn/b3/a1/b3a13581f4745e7c399edb92c2604761_931x229.png) 打印出wbp加载的模块 ![](https://img.kancloud.cn/25/30/2530be98021215caad27ee675b477cfa_896x137.png) 打印出代码 复制过去 ``` result = `{`; for (let x of Object.keys(wbp)){ result = result + `"` + x + `"` + `:` + wbp[x] + `,` }; result = result + `}`; ``` ~~~ var result = '{'; var keys = Object.keys(wbp); for (var i = 0; i < keys.length; i++) { var x = keys[i]; result += '"' + x + '":' + wbp[x]; // 最后一个元素后面不加逗号 if (i !== keys.length - 1) { result += ','; } } result += '}'; ~~~ ![](https://img.kancloud.cn/79/06/79064b9adf11293a7fc09491a538e183_1559x596.png) ![](https://img.kancloud.cn/13/9d/139d3aae30657beb1d6a2fd0173b69af_1495x1150.png) 这里用 360浏览器可以打印出代码,edge有引号 . 把e里面的全部导出运行才不缺模块,搞不懂 ![](https://img.kancloud.cn/56/d8/56d887cd1be4d7a411115ac2bf6a8edd_1895x217.png) ![](https://img.kancloud.cn/31/24/3124f556beb52b8f7b77fd503f6c4c5e_2119x798.png)