GithubHelp home page GithubHelp logo

djngo / hooking-and-patching-android-template Goto Github PK

View Code? Open in Web Editor NEW
47.0 2.0 14.0 63 KB

Hooking and binary patching template using Substrate and KittyMemory respectively.

Smali 1.19% Batchfile 0.95% Makefile 1.67% C++ 82.27% C 13.91%

hooking-and-patching-android-template's Introduction

Hooking-and-Patching-android-template

This is a template for the usage of Cydia Substrate and KittyMemory.

It is based on an already made hooking template by joeyjurjens/Ted2 here https://github.com/joeyjurjens/Android-Hooking-Template

And the KittyMemory repo by MJx0 here https://github.com/MJx0/KittyMemory

NEW Added hook alternative for aarch64 from this repo https://github.com/Rprop/And64InlineHook


Installation


How to use

  • x32/main.cpp This is where you will write your hooks and patches for armeabi-7va.
  • x64/main.cpp This is where you will write your hooks and patches for arm64-v8a (I added an example for the hook alternative but it works exactly like mshook).
  • Utils.h Edit the targeted library here. (In x64 too)

Change the outputed library name:

  • Android.mk Replace the default name by whatever you want at "LOCAL_MODULE :="
  • Android.mk Do the same for the other folder (x64)
  • libLoader$1.smali Change it in this file as well. (line 38)

Loading the lib.so

First we need to compile our project.

  • Edit params.txt & paste your ndk-build path location on the very first line and the project location on the second line like I did.
  • Start Build.bat and follow instructions.
  • Once compiled you'll have 2 new file in x32 and x64 named libs and obj. In order to load your lib.so, you'll need to decompile the apk, you can use Apk Easy Tool for this.
  • Go to Libs and copy the created lib.so in the Lib folder of your game.
  • Navigate to "/smali/com" & copy the loadLib from this git inside of that folder.
  • Open the AndroidManifest.xml file in the decompiled apk and search this
android:name="com.unity3d.player.UnityPlayerActivity" 

it will give us the path of the MainActivity so in our case it's at "com/unity3d/player/UnityPlayerActivity"

  • Open that file with Notepad++ or any text editing software and search 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
  • Step 1: Recompile the apk
  • Step 2: Profit

Useful links

For Cydia Substrate:

If you're here or if you made mod menus before you probably already know how to use KittyMemory.

hooking-and-patching-android-template's People

Contributors

djngo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.