Binary Ninja 插件,自动加载 JNI 类型并设置函数签名,让分析 Android SO 更轻松。
作者:LunFengChen 交流群:686725227 (QQ)
- 自动加载 JNI 类型库(
JNIEnv*,JavaVM*,jobject等) - 完整的 JNINativeInterface 结构:即使类型库加载失败,fallback 也能正确识别 JNI API 调用(如
NewStringUTF、FindClass等) - 自动设置
JNI_OnLoad、Java_*函数签名 - 导入 Frida RegisterNatives JSON,命名动态注册的 JNI 函数(功能3未测试,有问题和我反馈就行)
# Windows (PowerShell)
cd "$env:APPDATA\Binary Ninja\plugins"
git clone https://github.com/LunFengChen/ninja-jni-helper.git# Windows (CMD)
cd "%APPDATA%\Binary Ninja\plugins"
git clone https://github.com/LunFengChen/ninja-jni-helper.git# macOS/Linux(未测试)
cd ~/.binaryninja/plugins
git clone https://github.com/LunFengChen/ninja-jni-helper.git打开 Binary Ninja 加载so即可。
打开 Android SO 文件后自动执行:
- 加载 JNI 类型库
- 设置
JNI_OnLoad(JavaVM* vm, void* reserved)签名 - 设置
Java_*函数签名:jobject Java_xxx(JNIEnv* env, jobject thiz, ...)
- 运行 Frida 脚本获取 RegisterNatives JSON(脚本来自 jadx-frida-hookAll):
findJNIfunc_byClassName("com.example.ClassName");输出格式:
{
"class_name": "com.example.Class",
"name&signature": "methodName(Landroid/content/Context;II)Ljava/lang/String;",
"which_so": "libexample.so",
"func_offest": "0x12345"
}-
Binary Ninja 菜单:
Plugins > JNI Helper > Import Frida RegisterNatives JSON -
粘贴 JSON 内容,自动命名函数并设置签名
- aarch64 (ARM64)
- armv7 (ARM32)
Binary Ninja plugin for automatic JNI type loading and function signature setup.
Author: LunFengChen
QQ Group: 686725227
- Auto-load JNI type library (
JNIEnv*,JavaVM*,jobject, etc.) - Complete JNINativeInterface structure: Even if type library fails to load, fallback correctly identifies JNI API calls (e.g.,
NewStringUTF,FindClass) - Auto-set
JNI_OnLoadandJava_*function signatures - Import Frida RegisterNatives JSON for dynamic JNI functions
# Windows (PowerShell)
cd "$env:APPDATA\Binary Ninja\plugins"
git clone https://github.com/LunFengChen/ninja-jni-helper.git# Windows (CMD)
cd "%APPDATA%\Binary Ninja\plugins"
git clone https://github.com/LunFengChen/ninja-jni-helper.git# macOS/Linux
cd ~/.binaryninja/plugins
git clone https://github.com/LunFengChen/ninja-jni-helper.gitRestart Binary Ninja.
Open an Android SO file, the plugin will:
- Load JNI type library
- Set
JNI_OnLoad(JavaVM* vm, void* reserved)signature - Set
Java_*signatures:jobject Java_xxx(JNIEnv* env, jobject thiz, ...)
- Run Frida script to get RegisterNatives JSON (from jadx-frida-hookAll)
- Menu:
Plugins > JNI Helper > Import Frida RegisterNatives JSON - Paste JSON content
- aarch64 (ARM64)
- armv7 (ARM32)