从单个 Webpack 打包文件重建 Vue 和 Three.js 应用程序
我一直在进行一个小项目,旨在从打包的 JavaScript 中重构可读的源代码。<p>最近,我在一个实际案例上进行了测试:一个使用 Vue 2 和 Three.js 的塔防游戏,该游戏被打包成一个单独的 webpack 文件。<p>该工具尝试:<p>恢复模块边界<br>重建类似项目的结构<br>恢复变量和函数命名<p>在这个案例中,它成功重构了大部分项目:<p>约 90% 的文件映射<br>约 93% 的命名恢复<br>核心游戏逻辑得以保留<p>示例仓库(包含前后对比):<br>https://github.com/zhongguagua/jsunpack-example<p>这仍然是一个进行中的项目,存在一些局限性(缺少导入、某些映射不正确等)。<p>希望听到曾从事逆向工程或 JavaScript 工具开发的人的反馈。
查看原文
I’ve been working on a small project that tries to reconstruct readable source code from bundled JavaScript.<p>I recently tested it on a real-world example:
a Vue 2 + Three.js tower defense game that was bundled into a single webpack file<p>The tool attempts to:<p>recover module boundaries
rebuild a project-like structure
restore variable and function naming<p>In this case, it managed to reconstruct most of the project:<p>~90% file mapping
~93% naming recovery
core game logic preserved<p>Example repo (with before/after):
https://github.com/zhongguagua/jsunpack-example<p>It’s still very much a work in progress, and there are limitations (missing imports, some incorrect mappings, etc).<p>Curious to hear feedback from people who have worked with reverse engineering or JS tooling.