Skip to content

Commit 2ba543f

Browse files
committed
Update files
1 parent 67ee6ec commit 2ba543f

File tree

8 files changed

+89
-20
lines changed

8 files changed

+89
-20
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*.swp
2+
.DS_Store
3+
JadxFindJNI.zip

Makefile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
ghidra:
2-
install -d ${HOME}/ghidra_scripts/data
3-
install -m 644 ghidra/jni_helper.py ${HOME}/ghidra_scripts/
4-
install -m 644 headers/jni.h.gdt ${HOME}/ghidra_scripts/data/jni.h.gdt
1+
jni:
2+
make -C JadxFindJNI
53

6-
ida:
7-
echo "TODO"
4+
demo:
5+
make -C demo
86

9-
r2:
10-
echo "TODO"
7+
dist: jni
8+
zip JadxFindJNI.zip JadxFindJNI/JadxFindJNI.jar JadxFindJNI/lib/*.jar
119

12-
.PHONY: ghidra
10+
clean:
11+
make -C JadxFindJNI clean
12+
make -C demo clean
13+
rm -rf JadxFindJNI.zip
14+
15+
.PHONY: jni demo clean dist

README.md

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,59 @@
11
JNI Helper
22
===
33

4-
Find JNI function signatures from APK and then load to your decompiler tools!
4+
Find JNI function signatures from APK and load to reverse tools.
55

66

77
# Usage
88

9-
1. use [JadxFindJNI.jar][JadxFindJNI] to generate signature.json
9+
1. use [JadxFindJNI.jar](JadxFindJNI) to generate signature.json
1010
2. load signature.json into Ghidra/IDA/Radare2
1111

12-
# Ghidra Plugin
12+
## JadxFindJNI.jar
1313

14-
Install:
15-
```sh
16-
$ make ghidra
14+
Build:
15+
```
16+
$ make jni
1717
```
1818

19-
Load:
19+
Or you can just download the [latest release][dist].
20+
21+
Usage:
22+
```sh
23+
$ java -jar JadxFindJNI/JadxFindJNI.jar
24+
Usage: JadxFindJNI.jar <file.apk> <output.json>
2025
```
21-
Window -> Script Manager -> Run Script jni_helper.py
26+
27+
## Ghidra
28+
29+
See [Ghidra](./ghidra)
30+
31+
## IDA
32+
33+
See [IDA](./ida)
34+
35+
## Radare2
36+
37+
See [Radare2](./r2)
38+
39+
# Demo
40+
41+
Tested with [app-debug.apk](./demo).
42+
43+
```sh
44+
$ make demo
2245
```
46+
47+
48+
# TODO
49+
50+
- [x] support both C/C++ JNI functions
51+
- [ ] support [env->RegisterNatives][reg] JNI functions
52+
53+
# Thanks
54+
55+
- [Ayrx/JNIAnalyzer][ayrx]
56+
57+
[reg]: https://developer.android.com/training/articles/perf-jni#native-libraries
58+
[ayrx]: https://github.com/Ayrx/JNIAnalyzer
59+
[dist]: https://github.com/evilpan/jni_helper/releases

demo/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
app-debug.json
2+
lib

demo/Makefile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
all: app-debug.json lib
2+
3+
lib: app-debug.apk
4+
unzip $^ "lib*"
5+
6+
JadxFindJNI:
7+
make -C ../JadxFindJNI
8+
9+
app-debug.json: app-debug.apk JadxFindJNI
10+
java -jar ../JadxFindJNI/JadxFindJNI.jar $< $@
11+
12+
clean:
13+
rm -rf app-debug.json lib
14+
make -C ../JadxFindJNI clean
15+
16+
.PHONY: all lib clean JadxFindJNI

demo/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Demo apk here
2+
===
3+
4+
extract lib and json from apk:
5+
```sh
6+
$ make
7+
```

demo/app-debug.apk

2.39 MB
Binary file not shown.

ghidra/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
JNI Helper for Ghidra
22
===
33

4-
Install:
4+
# Install
5+
56
```sh
67
$ make install
78
```
89

9-
Load:
10+
# Load
11+
1012
```
11-
Window -> Script Manager -> Run Script jni_helper.py
13+
Window -> Script Manager -> jni_helper.py (Run Script)
1214
```
1315

1416
Logging:

0 commit comments

Comments
 (0)