Skip to content

Commit 6229daf

Browse files
committed
first
0 parents  commit 6229daf

37 files changed

+2510
-0
lines changed

.DS_Store

8 KB
Binary file not shown.

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Android Inline Hook
2+
3+
This project make an Android .so file that can automatically do some native hook works.
4+
5+
It mainly use Android Inline Hook, not PLT Hook.
6+
7+
If you can read Chinese or wanna see more picture, I've wrote some articles about this repo and the first one is the main article.
8+
9+
1. [Android Inline Hook Practice](https://gtoad.github.io/2018/07/06/Android-Native-Hook-Practice/)
10+
2. [Opcode Fix In Android Inline Hook](https://gtoad.github.io/2018/07/13/Android-Inline-Hook-Fix/)
11+
3. [An Introduction to Android Native Hook](https://gtoad.github.io/2018/07/05/Android-Native-Hook/)
12+
13+
# How To Use
14+
15+
The only thing you have to change is the code in `InlineHook.cpp`.
16+
17+
You can name the `__attribute__((constructor)) ModifyIBored()` function at your will and change the follow arg in it:
18+
19+
1. `pModuleBaseAddr` is the address of your target so.
20+
2. `target_offset` is the offset of your hook point in the target so.
21+
3. `is_target_thumb` shows the hook point's CPU mode. You can know this information in the work of reversing before the hook work.
22+
23+
`EvilHookStubFunctionForIBored` function is the thing you really wanna do when the hook works. You can name at your will, but keep the arg `(pt_regs *regs)`. It brings you the power to control the registers, like set r0 to 0x333 : `regs->uregs[0]=0x333;`.
24+
25+
# Example
26+
27+
I've make some examples in other repo, it includes code and the target APK file.
28+
29+
1. [thumb-2 example](https://github.com/GToad/Android_Inline_Hook_Thumb_Example.git)
30+
2. [arm32 example](https://github.com/GToad/Android_Inline_Hook_Arm_Example.git)
31+
32+
# Contact
33+
34+
I believe that this project still has some problems. If you find some bugs or have some problems, you can send e-mail to `[email protected]`. I wish we can fix it together!
35+
36+
# Reference
37+
38+
[Game Security Lab of Tencent](http://gslab.qq.com/portal.php?mod=view&aid=168)
39+
40+
[Ele7enxxh's Blog](http://ele7enxxh.com/Android-Arm-Inline-Hook.html)
41+
42+
43+
44+

arm32-example.apk

1.31 MB
Binary file not shown.

arm32-example.zip

1.31 MB
Binary file not shown.
177 KB
Binary file not shown.
13.5 KB
Binary file not shown.

armhook.pdf

160 KB
Binary file not shown.

jni/.DS_Store

10 KB
Binary file not shown.

jni/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include $(call all-subdir-makefiles)

jni/Application.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
APP_ABI := armeabi-v7a
2+
APP_STL := gnustl_static
3+
APP_CPPFLAGS += -fexceptions

0 commit comments

Comments
 (0)