GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - GToad/Android_Inline_Hook_Arm_Example

BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
arm32-example/armeabi-v7a
arm32-example/armeabi-v7a
 
 
jni
jni
 
 
libs/armeabi-v7a
libs/armeabi-v7a
 
 
obj/local/armeabi-v7a
obj/local/armeabi-v7a
 
 
.DS_Store
.DS_Store
 
 
ArmHooked.mp4
ArmHooked.mp4
 
 
README.md
README.md
 
 
arm32-example.apk
arm32-example.apk
 
 
arm32-example.zip
arm32-example.zip
 
 
armhook.pdf
armhook.pdf
 
 
notArmHooked.mp4
notArmHooked.mp4
 
 
todo.txt
todo.txt
 
 

Repository files navigation

This is the example of my Android Inline Hook Project in arm mode. So I will only update that repo.

The target APP is arm32-example.apk and our .so file has already been compiled in /libs/armeabi-v7a/libInlineArmHook.so.

In this APP, you should touch the button more than 10 and it will show Enough in a toast. After the example libInlineArmHook.so is effective, the register R0 will be set to 0x333 (>10) so you can touch it just once to get Enough.

notArmHooked.mp4 shows the APP run in a normal environment.

ArmHooked.mp4 shows the APP run in a hooked environment.

The pictures of effect are showed below:

Android Inline Hook

This project make an Android .so file that can automatically do some native hook works.

It mainly use Android Inline Hook, not PLT Hook.

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. I highly recommend you to read the articles before reading the code. These article will save you a lot of time, I promise.

  1. Android Inline Hook Practice
  2. Opcode Fix In Android Inline Hook
  3. An Introduction to Android Native Hook

How To Use

The only thing you have to change is the code in InlineHook.cpp.

You can name the __attribute__((constructor)) ModifyIBored() function at your will and change the follow arg in it:

  1. pModuleBaseAddr is the address of your target so.
  2. target_offset is the offset of your hook point in the target so.
  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.

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;.

After you finish the args above, just ndk-build and you will get your .so file.

Example

I've make some examples in other repo, it includes code and the target APK file.

  1. thumb-2 example
  2. arm32 example

Contact

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!

Reference

Game Security Lab of Tencent

Ele7enxxh's Blog

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

34 stars

Watchers

1 watching

Forks

14 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.