Skip to content

Commit 04effda

Browse files
author
Collin
committed
Update README.md
1 parent 6623d1e commit 04effda

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

README.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,16 @@ points (in-line hooking).
99
The toolkit consists of two main components the hijack tool and the base
1010
library.
1111

12-
hijack:
13-
The hijack tool provides the injection functionality. It supports a number of
14-
modes for supporting older and newer Android devices. hijack provides help on
15-
the command line.
12+
**hijack**
13+
14+
The hijack tool provides the injection functionality. It supports a number of modes for supporting older and newer Android devices. hijack provides help on the command line.
1615

17-
libbase:
18-
The base library provides the hooking and unhooking functionality. The base
19-
library is compiled as a static library so it can be directly included in the
20-
actual instrumentation library. This is done so we can keep everything in
21-
/data/local/tmp.
22-
23-
Below we provide and easy to follow step-by-step instructions for howto build
24-
and use adbi. The example instrument hijacks epoll_wait() and logs every call
16+
**libbase**
17+
18+
The base library provides the hooking and unhooking functionality. The base library is compiled as a static library so it can be directly included in the
19+
actual instrumentation library. This is done so we can keep everything in /data/local/tmp.
20+
21+
Below we provide and easy to follow step-by-step instructions for howto build and use adbi. The example instrument hijacks epoll_wait() and logs every call
2522
to a file.
2623

2724
=== External Resources ===
@@ -43,47 +40,55 @@ Android NDK
4340
=== How to Build ===
4441

4542
= build the hijack tool =
46-
43+
```
4744
cd hijack
4845
cd jni
4946
ndk-build
5047
cd ..
5148
adb push libs/armeabi/hijack
5249
cd ..
50+
```
5351

5452
= build the instrumentation base code =
5553

54+
```
5655
cd instruments
5756
cd base
5857
cd jni
5958
ndk-build
6059
cd ..
6160
cd ..
61+
```
6262

6363
= build instrumentation example =
6464

65+
```
6566
cd example
6667
cd jni
6768
ndk-build
6869
cd ..
6970
adb push libs/armeabi/libexample.so /data/local/tmp/
70-
71+
```
7172

7273
=== How to Run ===
7374

75+
```
7476
adb shell
7577
su
7678
cd /data/local/tmp
77-
(GET PID from com.android.phone)
79+
# GET PID from com.android.phone
7880
./hijack -d -p PID -l /data/local/tmp/libexample.so
7981
cat adbi_example.log
82+
```
8083

8184
output should look similar to:
8285

86+
```
8387
started
8488
hooking: epoll_wait = 0x4004c378 ARM using 0x4a84a588
8589
epoll_wait() called
8690
epoll_wait() called
8791
epoll_wait() called
8892
removing hook for epoll_wait()
93+
```
8994

0 commit comments

Comments
 (0)