/Android-Hooking-Template

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

Primary LanguageC++

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/