从单个Webpack包重建Vue和Three.js应用

1作者: YufanZhang3 个月前
我一直在做一个小项目,尝试从打包后的 JavaScript 中重建可读的源代码。 我最近在一个真实世界的例子上测试了它:一个 Vue 2 + Three.js 的塔防游戏,它被打包成一个单独的 webpack 文件。 该工具尝试: * 恢复模块边界 * 重建类似项目的结构 * 恢复变量和函数的命名 在这种情况下,它设法重建了项目的大部分内容: * ~90% 的文件映射 * ~93% 的命名恢复 * 核心游戏逻辑得以保留 示例代码库(包含前后对比): [https://github.com/zhongguagua/jsunpack-example](https://github.com/zhongguagua/jsunpack-example) 这仍然是一个正在进行中的项目,并且存在一些限制(缺少导入,一些错误的映射等)。 很想听听那些从事逆向工程或 JS 工具开发的人的反馈。
查看原文
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&#x2F;after): https:&#x2F;&#x2F;github.com&#x2F;zhongguagua&#x2F;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.