Jump to content

 Something great is coming! 🤖

Stay tuned for the big reveal happening here on iOSGods on the 20th of February!

The countdown has finished!

Simplified MSHookMemory Usage [ARM64 Only]


23 posts in this topic

Recommended Posts

Updated (edited)

While MSHookMemory is great, I hate I have to do this:

const uint8_t hack[] = {
    0x00, 0x00, 0x80, 0x52, // mov w0, #0
    0xc0, 0x03, 0x5f, 0xd6, // ret
};

 

 

So I wrote some code which won't need you to do that:

#include <substrate.h>
#include <mach-o/dyld.h>

#define ASLR_BIAS _dyld_get_image_vmaddr_slide(0)

uint64_t getRealOffset(uint64_t offset){
	return ASLR_BIAS + offset;
}

// main func
void inject(uint64_t offset, uint64_t hackedHex) {

    hackedHex = CFSwapInt32(hackedHex);        

    MSHookMemory((void *)getRealOffset(offset), (void *)&hackedHex, sizeof(hackedHex));
}

 

How to import this code to your project?

You have two options:

1. Copy & paste the code from above under your "imports"

2. Download this file & paste it in /var/theos/includes & write this on top of tweak.xm:

#include <inject.h>

 

Usage of the function:

//parameters it takes
inject(0xIDAOffset, 0xHackedHex);

//actual usage on a offset
inject(0x100299DC4, 0xC0035FD6);

 

 

Bugs to be fixed:

1. If you wanna write a hex more than 4 bytes, it won't work the way you think, example:

inject(0x100299DC0, 0x20008052C0035FD6);

/*

	This will write C0035FD620008052 instead of what you entered due the CFSwapInt32

/*

NOTE:  I'm no pro at this kinda stuff (dealing with memory), so if there's anything just mention it ^^

 

Credits

- Saurik

- topics from https://stackoverflow.com/   which helped me understand several things

- Me for this simplified version

Updated by Joey
  • Like 3
  • Winner 3
  • Informative 1
Posted
1 minute ago, Joka said:

How is this Tools?

It's a .h file, which is a tool to patch memory ? idk LUL
Both sections fine for me

Posted

is it possible to make the hackedHex param a stirng, make it an array of strings which gets split at every 2nd character and add a 0x to each of them

Posted (edited)
17 minutes ago, TheArmKing said:

is it possible to make the hackedHex param a stirng, make it an array of strings which gets split at every 2nd character and add a 0x to each of them

Yeah I tried that, but couldn’t get something like it to work. I’ve tried multiple things, this is the only one that worked. Will look into an alternative another time. C/C++ isn’t the most user friendly when it comes to arrays it seems 

Updated by Joey
Posted (edited)
26 minutes ago, Joey said:

Yeah I tried that, but couldn’t get something like it to work. I’ve tried multiple things, this is the only one that worked. Will look into an alternative another time. C/C++ isn’t the most user friendly when it comes to arrays it seems 

something like this maybe?
 

// Convert long long to string
// Convert string to char array
// loop through char array to make strings of 2 characters or 1 byte, like c00fe3d4 becomes c0 0f e3 d4
// c0 gets converted to int
// the int gets converted to uint8
// the uint8 gets appeneded to aa uint8 array
// copied this from stackexchange 
char str[256];
sprintf(str, "%lld", hackedHex);
printf("%s\n", str); 

for (int x=0; x<str.length; x++ ) { //dk if this is how C works
  if(x%2==0){
    char a = str[x]
  }
  if(x%2==1){
    char b = str[x]
    // do something that combines char a and b to a string
    // then convert to int
    // then to uint
    // then append to array
}


 

Updated by TheArmKing
added some bs
Posted

I don't know why people prefer integers type for this purpose which forces you to deal with endianness.

I just simplified yours too.

void inject(uint64_t offset, const void *bytes, size_t bytes_len) {
	 MSHookMemory((void *)getRealOffset(offset), bytes, bytes_len);
}

Usage:

//offset & bytes literal & bytes length
/* 
mov w0, #1
ret 
*/
inject(0x100299DC4, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8);

You can write as many bytes as you want with this.

Posted
5 hours ago, CyberCat said:

I don't know why people prefer integers type for this purpose which forces you to deal with endianness.

I just simplified yours too.


void inject(uint64_t offset, const void *bytes, size_t bytes_len) {
	 MSHookMemory((void *)getRealOffset(offset), bytes, bytes_len);
}

Usage:


//offset & bytes literal & bytes length
/* 
mov w0, #1
ret 
*/
inject(0x100299DC4, "\x20\x00\x80\x52\xC0\x03\x5F\xD6", 8);

You can write as many bytes as you want with this.

The thing is, I hate to have to write it like that ^, it’s almost the same as the original now :p 

7 hours ago, TheArmKing said:

something like this maybe?
 


// Convert long long to string
// Convert string to char array
// loop through char array to make strings of 2 characters or 1 byte, like c00fe3d4 becomes c0 0f e3 d4
// c0 gets converted to int
// the int gets converted to uint8
// the uint8 gets appeneded to aa uint8 array

// copied this from stackexchange 
char str[256];
sprintf(str, "%lld", hackedHex);
printf("%s\n", str); 

for (int x=0; x<str.length; x++ ) { //dk if this is how C works
  if(x%2==0){
    char a = str[x]
  }
  if(x%2==1){
    char b = str[x]
    // do something that combines char a and b to a string
    // then convert to int
    // then to uint
    // then append to array
}


 

possibly, but I think there must be a simpler solution 

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

    • Overspace: Alien Shooter RPG v1.2 [ +2 Cheats ] Currency Max
      Modded/Hacked App: Overspace: Alien Shooter RPG By OU S18 Group
      Bundle ID: com.shooterhero
      App Store Link: https://apps.apple.com/us/app/overspace-alien-shooter-rpg/id6752649717?uo=4

      🤩 Hack Features

      - Unlimited Gold
      - Unlimited Gems
        • Haha
        • Thanks
        • Like
      • 8 replies
    • Overspace: Alien Shooter RPG v1.2 [ +2 Jailed ] Currency Max
      Modded/Hacked App: Overspace: Alien Shooter RPG By OU S18 Group
      Bundle ID: com.shooterhero
      App Store Link: https://apps.apple.com/us/app/overspace-alien-shooter-rpg/id6752649717?uo=4

      🤩 Hack Features

      - Unlimited Gold
      - Unlimited Gems
        • Thanks
        • Winner
        • Like
      • 6 replies
    • Baseball Boy! Cheats (All Versions) +3
      Modded/Hacked App: Baseball Boy! By Voodoo
      Bundle ID: com.itchmedia.ta3
      App Store Link: https://apps.apple.com/us/app/baseball-boy/id1333523965?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - Freeze Cash
      - Freeze Gem
      - Premium No Ads

       

      Non-Jailbroken Hack: https://iosgods.com/topic/83387-baseball-boy-auto-update-jailed-cheats-3/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/83368-baseball-boy-cheats-all-versions-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 209 replies
    • Viking Hero TD: Roguelike RTS v1.0.2 [ +7 Jailed ] Currency Max
      Modded/Hacked App: Viking Hero TD: Roguelike RTS By SimpleBit Studios ApS
      Bundle ID: com.SimpleBitStudios.VikingHeroTD
      App Store Link: https://apps.apple.com/us/app/viking-hero-td-roguelike-rts/id6749671654?uo=4
      🤩 Hack Features

      - Unlimited Coins
      - Unlimited Amber
      - Unlimited Keys +3
      - Unlimited Ascend
      - HP MAX
      - ATK MAX
      - ATK Range
      • 0 replies
    • Viking Hero TD: Roguelike RTS v1.0.2 [ +7 Cheats ] Currency Max
      Modded/Hacked App: Viking Hero TD: Roguelike RTS By SimpleBit Studios ApS
      Bundle ID: com.SimpleBitStudios.VikingHeroTD
      App Store Link: https://apps.apple.com/us/app/viking-hero-td-roguelike-rts/id6749671654?uo=4

      🤩 Hack Features

      - Unlimited Coins
      - Unlimited Amber
      - Unlimited Keys +3
      - Unlimited Ascend
      - HP MAX
      - ATK MAX
      - ATK Range
      • 0 replies
    • FarmVille 2: Country Escape Cheats v29.4 +1
      Modded/Hacked App: FarmVille 2: Country Escape by Zynga Inc.
      Bundle ID: com.zynga.FarmVille2CountryEscape
      iTunes Store Link: https://apps.apple.com/us/app/farmville-2-country-escape/id824318267?uo=4&at=1010lce4


      Hack Features:
      - Freeze Key


      iOS Hack Download Link: https://iosgods.com/topic/101607-arm64-farmville-2-country-escape-cheats-v1263984-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 2,035 replies
    • Farmdale - magic family farm Cheats (All Versions) +3
      Modded/Hacked App: Farmdale - magic family farm By Game Garden Limited
      Bundle ID: com.gamegarden.fd
      App Store Link: https://apps.apple.com/us/app/farmdale-magic-family-farm/id858467950?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - Freeze Currencies

       

      Non-Jailbroken Hack: https://iosgods.com/topic/91062-farmdale-magic-family-farm-v600-jailed-cheats-3/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/91061-farmdale-magic-family-farm-cheats-all-versions-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 106 replies
    • Raising Poseidon v1.3.99 Jailed Cheats +2
      Modded/Hacked App: Raising Poseidon By MouseDuck Co., Ltd.
      Bundle ID: com.mouseduck.seawar
      App Store Link: https://apps.apple.com/us/app/raising-poseidon/id1614789798?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - Multiply Attack
      - Custom Currencies (Not sure if still work or not)

       

      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/205959-raising-poseidon-v1399-jailed-cheats-2/
      • 0 replies
    • +99 Reinforced Wooden Stick v99.1.41 Jailed Cheats +2
      Modded/Hacked App: 99강화 나무몽둥이 : 키우기 By STUDIO LICO Corp.
      Bundle ID: com.studiolico.woodenstick
      App Store Link: https://apps.apple.com/kr/app/99%EA%B0%95%ED%99%94-%EB%82%98%EB%AC%B4%EB%AA%BD%EB%91%A5%EC%9D%B4-%ED%82%A4%EC%9A%B0%EA%B8%B0/id6737379268?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - God Mode
      - Multiply Attack

       


      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/193094-99-reinforced-wooden-stick-v99135-jailed-cheats-2/
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 44 replies
    • CookieRun: Kingdom v7.1.001 Jailed Cheats +3
      Modded/Hacked App: CookieRun: Kingdom By Devsisters Corp.
      Bundle ID: com.devsisters.ck
      App Store Link: https://apps.apple.com/us/app/cookierun-kingdom/id1509450845?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - Multiply Attack
      - Multiply Defense
      - No Skills Cooldown
       

      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/201150-cookierun-kingdom-v610001-jailed-cheats-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 112 replies
    • Stick War 3 (Auto Update) +8 Jailed Cheats
      Modded/Hacked App: Stick War: Saga By 1004319 Alberta Ltd
      Bundle ID: com.maxgames.stickwar3
      App Store Link: https://apps.apple.com/us/app/stick-war-saga/id1548764863?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - Anti Cheat Bypassed
      - Infinite Gold
      - Infinite Mana
      - Infinite Team Members
      - Collect High Gold
      - No Spawn Unit Cooldown
      - No Spell Cooldown
      - Everything Owned

       

      Jailbroken Hack: https://iosgods.com/topic/172138-stick-war-saga-cheats-auto-update-8/

       

      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/172139-stick-war-3-auto-update-8-jailed-cheats/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 106 replies
    • Capybara Go v1.8.4 Jailed Cheats +6
      Modded/Hacked App: Capybara Go! By HABBY PTE. LTD.
      Bundle ID: com.habby.capybara
      App Store Link: https://apps.apple.com/us/app/capybara-go/id6596787726?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - Increase Game Speed
      - Premium Benefit (Not Battle Pass)
      - Unlimited Skills Refresh
      - Reselect Skills (Not sure Safe or not, only support some stages that let you choose 5 skills in a row, enable this so you can force refresh and select other skills)
      - Easy Fish
      - No Ads / Skip Ads

       

      DO NOT BUY VIP FOR JUST THIS CHEAT. USING MAY LEAD TO ACCOUNT BAN

       

      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/189055-capybara-go-v179-jailed-cheats-6/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 643 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