Jump to content

8 posts in this topic

Recommended Posts

Posted (edited)

Hi masters,

I am quite new to this site and I am learning a new way to mod Android games, which is called Hooking functions (I am not sure if I call it right).

As I read the instruction in this GitHub project, at the Creating the libhook.so step (step 2 - Inside "hook.cpp", you'll write your hooks.), I just don't know how to write it (I am completely new to this). I have searched many websites to find a clear instruction for this but there is no one.

So now I am here to ask for your help.

Could anyone please give a sample hook (on Android, of course) when I write in the hook.cpp? Or a screenshot is also pretty good!

For example, in the picture below, I want to GetMoneyTotal (void) at offset 000BBFE8, then what should I write the code?

spacer.png

My English is bad and I don't know if I ask a properly question. I just want to learn new things from this heaven of moddings.

It would be great if any one can help. I am greatful about that.

Hope that @DADi would have a look at this thread and help.

Thanks in advance!

Updated by CeeCeeCee
Posted
1 hour ago, busmanl30 said:

Use MsFindSymbol for that, that game looks like anflex like game on iOS, Shmoo made a tut called Mshook new way

 

https://iosgods.com/topic/4295-tutorial-how-to-hack-with-mshook-new-way/

I have read that thread. But what I want is a complete sample hook to see how it looks like, or something else needed to make the mod works

Posted
17 minutes ago, CeeCeeCee said:

I have read that thread. But what I want is a complete sample hook to see how it looks like, or something else needed to make the mod works

That’s how you do it dude

  • Thanks 1
Posted
8 hours ago, busmanl30 said:

That’s how you do it dude

but I am using Android Hooking Template. is that the same as MSHook?

in MSHook, there is a tweak while the one I am using has a hook.cpp file and I need to write hooks in it

may you give me a sample hook?

Posted

  

ARM V7:


#include <jni.h>
//#include <android/log.h>
#include "libs/KittyMemory/MemoryPatch.h"
#include <libs/Substrate/CydiaSubstrate.h>
#include <memory.h>
#include <dlfcn.h>
#include <cstdio>
#include <cstdlib>
#import "include/Utils.h"

//Struct for patches
struct My_Patches {

    MemoryPatch AddCoin, AddDiamond;
	
} my_cool_Patches;

int (*old_coin)(void *instance);
int (coin)(void *instance) {
	if(instance!=NULL) {
		return 999999;
	}
	return old_coin(instance);
}

int (*old_diamond)(void *instance);
int diamond(void *instance) {
	if(instance!=NULL) {
		return 9999;
	}
	return old_diamond(instance);
}

__attribute__((constructor))
void libhook_main() {

    while(libBase == 0) { 
        libBase = get_libBase(libName); 
        sleep(1); 
    }   
	
	//KittyMemory patch example.
	my_cool_Patches.AddCoin = MemoryPatch(libName, 0xC9C448, "\x3f\x12\x04\xe3\x0f\x10\x40\xe3", 8);
	my_cool_Patches.AddCoin.Modify();
	
	my_cool_Patches.AddDiamond = MemoryPatch(libName, 0xC9C4F4, "\x0f\x17\x02\xe3", 4);
	my_cool_Patches.AddDiamond.Modify();
	
	//Usual Hook example.
	MSHookFunction((void *)getRealOffset(0xC9A8DC), (void *)coin, (void **) &old_coin);
    MSHookFunction((void *)getRealOffset(0xC9AB98), (void *)diamond, (void **) &old_diamond);
}

------------------------------------------------------------------------------------------------------------
And For ARM V8:

Just Edit This Code :

From This:

MSHookFunction((void *)getRealOffset(0xC9A8DC), (void *)coin, (void **) &old_coin);
MSHookFunction((void *)getRealOffset(0xC9AB98), (void *)diamond, (void **) &old_diamond);

To THis:

A64HookFunction((void *)getRealOffset(0xEE218DC), (void *)coin, (void **) &old_coin);
A64HookFunction((void *)getRealOffset(0xEE21A98), (void *)diamond, (void **) &old_diamond);


I Write For You which one Arm V7 & which one Arm V8
And They Are not have change just a latest lines
❤❤❤❤❤❤

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Our picks

    • Lands of Jail v1.0.7 [+1 Jailed Cheats]
      Modded/Hacked App: Lands of Jail By SINGAPORE JUST GAME TECHNOLOGY PTE. LTD.
      Bundle ID: com.justgame.jails.global
      App Store Link: https://apps.apple.com/us/app/lands-of-jail/id6738469826?uo=4



      🤩 Hack Features

      - Enemy Can't Attack (Enable Before Enter the Stage)

      • 1 reply
    • Lands of Jail v1.0.7 [+1 Cheats]
      Modded/Hacked App: Lands of Jail By SINGAPORE JUST GAME TECHNOLOGY PTE. LTD.
      Bundle ID: com.justgame.jails.global
      App Store Link: https://apps.apple.com/us/app/lands-of-jail/id6738469826?uo=4



      🤩 Hack Features

      - Enemy Can't Attack (Enable Before Enter the Stage)
       
      • 3 replies
    • Obsidian Knight RPG v1.97 [+3 Jailed Cheats]
      Modded/Hacked App: Obsidian Knight RPG By ActFirst Games AB
      Bundle ID: com.actfirstgames.obsidianknight
      iTunes Store Link: https://apps.apple.com/us/app/obsidian-knight-rpg/id6505061490?uo=4



      🚀 Hack Features

      - Unlimited Currency
      - God Mode / Never Die
      - High Damage / OHK
      • 16 replies
    • Obsidian Knight RPG v1.97 [+3 Cheats]
      Modded/Hacked App: Obsidian Knight RPG By ActFirst Games AB
      Bundle ID: com.actfirstgames.obsidianknight
      iTunes Store Link: https://apps.apple.com/us/app/obsidian-knight-rpg/id6505061490?uo=4

       

      🚀 Hack Features

      - Unlimited Currency
      - God Mode / Never Die
      - High Damage / OHK
      • 19 replies
    • Z Survivor: Backpack Shooter v0.59 [+2 Cheats]
      Modded/Hacked App: Z Survivor: Backpack Shooter By Tapped Ltd
      Bundle ID: com.tapped.zsurvivor
      iTunes Store Link: https://apps.apple.com/us/app/z-survivor-backpack-shooter/id6557072922?uo=4



      🤩 Hack Features

      - Debug Menu (Auto Play, Skip Level and more)
      - Never Die
      - Unlimited Resource (Currency, Keys, Blueprints)
      • 5 replies
    • Z Survivor: Backpack Shooter v0.59 [+2 Jailed Cheats]
      Modded/Hacked App: Z Survivor: Backpack Shooter By Tapped Ltd
      Bundle ID: com.tapped.zsurvivor
      iTunes Store Link: https://apps.apple.com/us/app/z-survivor-backpack-shooter/id6557072922?uo=4



      🤩 Hack Features

      - Debug Menu (Auto Play, Skip Level and more)
      - Never Die
      - Unlimited Resource (Currency, Keys, Blueprints)
      • 4 replies
    • Kingdom Survivors v1.0720 [+4 Cheats]
      Modded/Hacked App: Kingdom Survivors By a plant standing on a chair Game Studio HB
      Bundle ID: com.DefaultCompany.MonsJacobSurvivorGame
      iTunes Store Link: https://apps.apple.com/us/app/kingdom-survivors/id1662497248?uo=4



      🚀 Hack Features

      - Never Die
      - Gain Exp (Toggle On gives you exp in battle)
      - Unlock All Characters
      - Add Currency
      • 16 replies
    • Kingdom Survivors v1.0720 [+4 Jailed Cheats]
      Modded/Hacked App: Kingdom Survivors By a plant standing on a chair Game Studio HB
      Bundle ID: com.DefaultCompany.MonsJacobSurvivorGame
      iTunes Store Link: https://apps.apple.com/us/app/kingdom-survivors/id1662497248?uo=4



      Hack Features:

      - Never Die
      - Gain Exp (Toggle On gives you exp in battle)
      - Unlock All Characters
      - Add Currency

      • 12 replies
    • Dwarf Kingdom - Idle Survival v5.2 Debug Menu [+6 Jailed Cheats]
      Modded/Hacked App: Dwarf Kingdom - Idle Survival By PAPER PIGEON YAZILIM VE OYUN GELISTIRME LIMITED SIRKETI
      Bundle ID: com.PaperPigeon.DwarfKingdom
      iTunes Store Link: https://apps.apple.com/us/app/dwarf-kingdom-idle-survival/id6477745778?uo=4



      🤩 Hack Features

      - Debug Menu (Enable cheat and debug menu will open)
       
      • 4 replies
    • Dwarf Kingdom - Idle Survival v5.2 Debug Menu [+6 Cheats]
      Modded/Hacked App: Dwarf Kingdom - Idle Survival By PAPER PIGEON YAZILIM VE OYUN GELISTIRME LIMITED SIRKETI
      Bundle ID: com.PaperPigeon.DwarfKingdom
      iTunes Store Link: https://apps.apple.com/us/app/dwarf-kingdom-idle-survival/id6477745778?uo=4



      🤩 Hack Features

      - Debug Menu (Enable cheat and debug menu will open)
      • 4 replies
    • Cup Quest - Hero's Journey v1.4 [+3 Cheats]
      Modded/Hacked App: Cup Quest - Hero's Journey By DOGSTER TECHNOLOGIES PRIVATE LIMITED
      Bundle ID: com.felicity.cupquest
      App Store Link: https://apps.apple.com/us/app/cup-quest-heros-journey/id6742395137?uo=4



      🤩 Hack Features

      - One Hit Kill
      - Add Currency
      - Unlock Double Speed
      • 3 replies
    • Cup Quest - Hero's Journey v1.4 [+3 Jailed Cheats]
      Modded/Hacked App: Cup Quest - Hero's Journey By DOGSTER TECHNOLOGIES PRIVATE LIMITED
      Bundle ID: com.felicity.cupquest
      App Store Link: https://apps.apple.com/us/app/cup-quest-heros-journey/id6742395137?uo=4



      🤩 Hack Features

      - One Hit Kill
      - Add Currency
      - Unlock Double Speed
      • 2 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines