joeyjurjens / Android-Hooking-Template

Just a simple hooking template which makes use of Cydia Substrate.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android Hooking Template

This is a simple template for the usage of Cydia Substrate.

Installation:


Creating the libhook.so

I'm not going to explain how Cydia Substrate works, since it has it's own documentation.

  • Inside the file "Utils.h", you'll specifiy the lib name of the game.
  • Inside "hook.cpp", you'll write your hooks.
  • Once done, double click compile.bat & it will create a libs folder.
  • Inside the libs folder, you'll have a "libhook.so" file, this will be placed inside the APK's lib folder.

Loading the lib.so

In order to load your libhook.so, you'll need to decompile the apk, you can use ApkTool for this.

  • Navigate to "/smali/com" & create a folder called "loadLib"
  • Copy the two .smali files provided in the smali folder from this Git, inside of that folder.
  • Now, navigate to "com/unity3d/player/UnityPlayerActivity" & search for something like this:
.method protected onCreate(Landroid/os/Bundle;)V
    .locals 2
  • Once found, paste this code under .locals 2:
invoke-static {}, Lcom/loadLib/libLoader;->loadLib()V
  • Recompile the apk & test out your hack!

Useful links

Cydia Substrate Documentation: http://www.cydiasubstrate.com/id/264d6581-a762-4343-9605-729ef12ff0af/

About

Just a simple hooking template which makes use of Cydia Substrate.


Languages

Language:C++ 73.4%Language:C 23.0%Language:Smali 2.1%Language:Makefile 1.3%Language:Batchfile 0.2%