SuperAPI AI 工具集

hermes-dec-bytecode-reverse-engineering

通用与其它

查看项目

更新于 10-16 01:28

技能介绍

用途:hermes-dec 面向 React Native 应用的逆向工程,用于解析、反汇编和反编译 Hermes VM 字节码(HBC)。Hermes 自 React Native 0.70 起是 Android 默认 JS 引擎,字节码通常位于 APK 的 assets/index.android.bundle。

主要能力:工具提供三个命令——hbc-file-parser 解析并显示 HBC 文件头、字节码版本与元数据;hbc-disassembler 将字节码转换为类汇编的 .hasm 表示;hbc-decompiler 将字节码反编译为伪 JavaScript 代码。

安装:推荐 pipx install hermes-dec;也可 uv tool install hermes-dec、pip install hermes-dec,或从源码 git clone https://github.com/P1sec/hermes-dec.git 后 pip install -e .。Ubuntu 可用 sudo snap install hermes-dec(命令带前缀 hermes-dec.);Arch Linux 可用 yay -S hermes-dec。

使用方式:先从 APK 提取字节码,如 unzip my_application.apk -d my_application/,用 file assets/index.android.bundle 验证是否为 Hermes 字节码。随后运行 hbc-file-parser assets/index.android.bundle、hbc-disassembler assets/index.android.bundle output.hasm、hbc-decompiler assets/index.android.bundle decompiled.js。可配合 grep 搜索 API 端点或敏感字符串,或用 diff 比较不同版本。

限制:反编译输出为基于寄存器的伪 JavaScript,不重建控制流(循环、条件呈线性),可能含死代码,需手工整理才能成为有效 JS;反编译为尽力而为,复杂模式可能不完整。不支持的字节码版本需升级工具。文件头 magic 为 \xC6\x1F\xBC\x03。收费、价格与平台支持详情暂未提供。