Jump to content

MSHook Patcher problem


Goggwell

19 posts in this topic

Recommended Posts

Hey guys. After hours of coding and help from various people, I finally got my Patcher to compile. Problem is, the hack makes the game crash after I swipe two fruits.

 

My iPhone specs:

6+ running ARM64

 

Here's the code (Don't steal my offsets)

 

 

My Tweak.xm

#include <UIKit/UIKit.h>
#include <CoreFoundation/CoreFoundation.h>
#include <substrate.h>
#include <Foundation/Foundation.h>

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.goggwell.FruitNinja.plist"

inline bool GetPrefBool(NSString *key) {
    return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}

bool (*old_IsTimedGamev)(void *ptr);
int (*old_WaveManager9SpawnBombEiP12SPAWNER_INFOi)(void *ptr);
int (*old_WaveManager17GetCriticalChanceEi)(void *ptr);
int (*old_Components5Score8LifeLostE8_Vector3IfEiP6Entity)(void *ptr);
bool (*old_Components5Score9IsNewBestEv)(void *ptr);
int (*old_AIManager10Tournament11GetEntryFeeERKN6Mortar11AsciiStringE)(void *ptr);


bool IsTimedGamev(void *ptr) {
    if(GetPrefBool(@"kTimed")) {
        return FALSE;
    } else {
        return old_IsTimedGamev(ptr);
    }
}

int WaveManager9SpawnBombEiP12SPAWNER_INFOi(void *ptr) {
    if(GetPrefBool(@"kBomb")) {
        return 0;
    } else {
        return old_WaveManager9SpawnBombEiP12SPAWNER_INFOi(ptr);
    }
}

int WaveManager17GetCriticalChanceEi(void *ptr) {
    if(GetPrefBool(@"kCrit")) {
        return 100;
    } else {
        return old_WaveManager17GetCriticalChanceEi(ptr);
    }
}

int Components5Score8LifeLostE8_Vector3IfEiP6Entity(void *ptr) {
    if(GetPrefBool(@"kLost")) {
        return 0;
    } else {
        return old_Components5Score8LifeLostE8_Vector3IfEiP6Entity(ptr);
    }
}

int Components5Score9IsNewBestEv(void *ptr) {
    if(GetPrefBool(@"kBest")) {
        return TRUE;
    } else {
        return old_Components5Score9IsNewBestEv(ptr);
    }
}

int AIManager10Tournament11GetEntryFeeERKN6Mortar11AsciiStringE(void *ptr) {
    if(GetPrefBool(@"kFee")) {
        return 0;
    } else {
        return old_AIManager10Tournament11GetEntryFeeERKN6Mortar11AsciiStringE(ptr);
    }
}


__attribute__((constructor)) void DylibMain()
{

    MSHookFunction(MSFindSymbol(NULL,"__Z11IsTimedGamev"),(void *)IsTimedGamev,(void**)&old_IsTimedGamev);
    MSHookFunction(MSFindSymbol(NULL,"__ZN11WaveManager9SpawnBombEiP12SPAWNER_INFOi"),(void *)WaveManager9SpawnBombEiP12SPAWNER_INFOi,(void**)&old_WaveManager9SpawnBombEiP12SPAWNER_INFOi);
    MSHookFunction(MSFindSymbol(NULL,"__ZN11WaveManager17GetCriticalChanceEi"),(void *)WaveManager17GetCriticalChanceEi,(void**)&old_WaveManager17GetCriticalChanceEi);
    MSHookFunction(MSFindSymbol(NULL,"__ZN10Components5Score8LifeLostE8_Vector3IfEiP6Entity"),(void *)Components5Score8LifeLostE8_Vector3IfEiP6Entity,(void**)&old_Components5Score8LifeLostE8_Vector3IfEiP6Entity);
    MSHookFunction(MSFindSymbol(NULL,"__ZNK10Components5Score9IsNewBestEv"),(void *)Components5Score9IsNewBestEv,(void**)&old_Components5Score9IsNewBestEv);
    MSHookFunction(MSFindSymbol(NULL,"__ZN9AIManager10Tournament11GetEntryFeeERKN6Mortar11AsciiStringE"),(void *)AIManager10Tournament11GetEntryFeeERKN6Mortar11AsciiStringE,(void**)&old_AIManager10Tournament11GetEntryFeeERKN6Mortar11AsciiStringE);

}
 

 

 

 

 

My Makefile (Tweak)

ARCHS = armv7 arm64
include theos/makefiles/common.mk

TWEAK_NAME = FruitNinja
FruitNinja_FILES = Tweak.xm

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
	install.exec "killall -9 SpringBoard"
SUBPROJECTS += fruitninja
include $(THEOS_MAKE_PATH)/aggregate.mk
 

 

 

 

 

My Makefile (Pref)

ARCHS = armv7 arm64
include theos/makefiles/common.mk

BUNDLE_NAME = FruitNinja
FruitNinja_FILES = FruitNinja.mm
FruitNinja_INSTALL_PATH = /Library/PreferenceBundles
FruitNinja_FRAMEWORKS = UIKit
FruitNinja_PRIVATE_FRAMEWORKS = Preferences

include $(THEOS_MAKE_PATH)/bundle.mk

internal-stage::
	$(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END)
	$(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/FruitNinja.plist$(ECHO_END)
 

 

 

 

 

My xxx.mm file

#import <Preferences/Preferences.h>



@interface FruitNinjaListController: PSListController {

}

@end



@implementation FruitNinjaListController

- (id)specifiers {

	if(_specifiers == nil) {

		_specifiers = [[self loadSpecifiersFromPlistName:@"FruitNinja" target:self] retain];

	}

	return _specifiers;

}



-(void)respring {

	 system("killall -9 SpringBoard");

      }



@end



// vim:ft=objc
 

 

 

 

 

My Pref PLIST

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>entry</key>
	<dict>
		<key>cell</key>
		<string>PSLinkCell</string>
		<key>icon</key>
		<string>icon.png</string>
		<key>label</key>
		<string>Fruit Ninja Hack</string>
	</dict>
	<key>items</key>
	<array>
		<dict>
			<key>cell</key>
			<string>PSSwitchCell</string>
			<key>default</key>
			<false/>
			<key>defaults</key>
			<string>com.goggwell.FruitNinja</string>
			<key>key</key>
			<string>kTimed</string>
			<key>label</key>
			<string>No Timer</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSSwitchCell</string>
			<key>default</key>
			<false/>
			<key>defaults</key>
			<string>com.goggwell.FruitNinja</string>
			<key>key</key>
			<string>kBomb</string>
			<key>label</key>
			<string>No Bombs</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSSwitchCell</string>
			<key>default</key>
			<false/>
			<key>defaults</key>
			<string>com.goggwell.FruitNinja</string>
			<key>key</key>
			<string>kCrit</string>
			<key>label</key>
			<string>(90%)Always Crit</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSSwitchCell</string>
			<key>default</key>
			<false/>
			<key>defaults</key>
			<string>com.goggwell.FruitNinja</string>
			<key>key</key>
			<string>kLost</string>
			<key>label</key>
			<string>Lose No Life</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSSwitchCell</string>
			<key>default</key>
			<false/>
			<key>defaults</key>
			<string>com.goggwell.FruitNinja</string>
			<key>key</key>
			<string>kBest</string>
			<key>label</key>
			<string>Always Best Score</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSSwitchCell</string>
			<key>default</key>
			<false/>
			<key>defaults</key>
			<string>com.goggwell.FruitNinja</string>
			<key>key</key>
			<string>kWin</string>
			<key>label</key>
			<string>Always Win (unless you're noob)</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSSwitchCell</string>
			<key>default</key>
			<false/>
			<key>defaults</key>
			<string>com.goggwell.FruitNinja</string>
			<key>key</key>
			<string>kFee</string>
			<key>label</key>
			<string>No Tournament Fee</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSSwitchCell</string>
			<key>default</key>
			<false/>
			<key>defaults</key>
			<string>com.goggwell.FruitNinja</string>
			<key>key</key>
			<string>kBeat</string>
			<key>label</key>
			<string>Beat Tournament</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSGroupCell</string>
			<key>label</key>
			<string>Hacked by Goggwell</string>
		</dict>
		<dict>
			<key>cell</key>
			<string>PSButtonCell</string>
			<key>label</key>
			<string>Respring</string>
			<key>action</key>
			<string>respring</string>
		</dict>
	</array>
	<key>title</key>
	<string>Fruit Ninja Hack</string>
</dict>
</plist>  

 

 

 

If anyone could help me out that would be much appreciated :D

Link to comment
Share on other sites

Ok I'll try

 

 

I did, but it didn't compile and when it did, it crashed my game

Just use the code as an example. Nothing else. Also do what z0ne said, *self. It was in my example. Also it maybe your function.
Link to comment
Share on other sites

try thes ...

 

if(GetPrefBool(@"kBomb")) {

return 0;

 

to

 

if(GetPrefBool(@"kBomb")) {

return -1;

 

and do't put popup MGS

 

hook appdelegate

-(void) bla bla ....

I made one with 0 already. That's not the problem.
Link to comment
Share on other sites

try thes ...

 

if(GetPrefBool(@"kBomb")) {

return 0;

 

to

 

if(GetPrefBool(@"kBomb")) {

return -1;

 

and do't put popup MGS

 

hook appdelegate

-(void) bla bla ....

 

That worked on my other tweak. I'm still trying to fix the code.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Our picks

    • My Fantasy: Choose Your Story v2.9.3 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: My Fantasy: Choose Your Story By GM UNICORN CORPORATION LIMITED
      Bundle ID: gmem.episode
      iTunes Store Link: https://apps.apple.com/us/app/my-fantasy-choose-your-story/id1491717191


      Hack Features:
      - Unlimited Tickets -> Use some.
      - Unlimited Diamonds -> Use some.
      - Premium Enabled


      Jailbreak required hack(s): [Mod Menu Hack] My Fantasy: Choose Your Story v2.2.5 +2 Cheats [ Unlimited Currencies ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 130 replies
    • My Fantasy: Choose Your Story v2.9.3 +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: My Fantasy: Choose Your Story By GM UNICORN CORPORATION LIMITED
      Bundle ID: gmem.episode
      iTunes Store Link: https://apps.apple.com/us/app/my-fantasy-choose-your-story/id1491717191
       

      Hack Features:
      - Unlimited Tickets -> Use some.
      - Unlimited Diamonds -> Use some.
      - Premium Enabled


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] My Fantasy: Choose Your Story v2.2.5 +2 Cheats [ Unlimited Currencies ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 79 replies
    • Zombie Idle Defense v2.5.4 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Zombie Idle Defense By THAI DONG COMPANY LIMITED
      Bundle ID: com.tdcgame.idle.zombie
      iTunes Store Link: https://apps.apple.com/us/app/zombie-idle-defense/id1509441400?uo=4


      Hack Features:
      - Unlimited Cash -> Spend some.
      - Unlimited Coins -> Will increase instead of decrease.
      - Free In-App Purchases -> Toggle on via iGMenu.


      Jailbreak required hack(s): [Mod Menu Hack] Zombie Idle Defense ( All Versions ) +3 Cheats [ Unlimited Currencies ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 25 replies
    • Zombie Idle Defense ( All Versions ) +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Zombie Idle Defense By THAI DONG COMPANY LIMITED
      Bundle ID: com.tdcgame.idle.zombie
      iTunes Store Link: https://apps.apple.com/us/app/zombie-idle-defense/id1509441400?uo=4


      Hack Features:
      - Unlimited Cash -> Spend some.
      - Unlimited Coins -> Will increase instead of decrease.
      - Free In-App Purchases


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Zombie Idle Defense v2.4.1 +3 Jailed Cheats [ Unlimited Currencies ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Haha
        • Thanks
        • Like
      • 20 replies
    • MeChat v4.20.0 +1 Jailed Cheat [ Unlimited Gems ]
      Modded/Hacked App: MeChat By PlayMe Studio
      Bundle ID: world.playme.mechat
      iTunes Store Link: https://apps.apple.com/us/app/mechat/id1536157979
       

      Hack Features:
      - Unlimited Gems -> Will increase instead of decrease.


      Free Jailbreak required hack(s): [Mod Menu Hack] [Free] MeChat - Love Secrets v3.3.2 +1 Cheat [ Unlimited Gems ] - Free Jailbroken Cydia Cheats - iOSGods
      ViP Jailbreak required hack(s): [Mod Menu Hack] MeChat - Love Secrets v3.3.2 +1 Cheat [ Unlimited Gems ] - ViP Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 615 replies
    • Good Pizza, Great Pizza v5.11.0 +2 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Good Pizza, Great Pizza By TAPBLAZE, LLC
      Bundle ID: com.tapblaze.pizzabusiness
      iTunes Store Link: https://apps.apple.com/us/app/good-pizza-great-pizza/id911121200?uo=4


      Hack Features:
      - Unlimited Cash
      - Unlimited Diamonds


      Jailbreak required hack(s): [Mod Menu Hack] Good Pizza, Great Pizza v5.5.6 +2 Cheats [ Unlimited Currencies ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 68 replies
    • Good Pizza, Great Pizza v5.11.0 +2 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Good Pizza, Great Pizza By TAPBLAZE, LLC
      Bundle ID: com.tapblaze.pizzabusiness
      iTunes Store Link: https://apps.apple.com/us/app/good-pizza-great-pizza/id911121200?uo=4


      Hack Features:
      - Unlimited Cash
      - Unlimited Diamonds


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Good Pizza, Great Pizza v5.5.6 +2 Jailed Cheats [ Unlimited Currencies ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 38 replies
    • [ VIP ] MeChat ( All Versions ) +1 Cheat [ Unlimited Gems ]
      Modded/Hacked App: MeChat By PlayMe Studio
      Bundle ID: world.playme.mechat
      iTunes Store Link: https://apps.apple.com/us/app/mechat/id1536157979
       

      Hack Features:
      - Unlimited Gems -> Earn some then uninstall this hack. DO NOT SPEND ANY GEMS WHILST THIS FEATURE IS ENABLED!


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] MeChat - Love Secrets v3.3.2 +1 Jailed Cheat [ Unlimited Gems ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Free Jailbreak required hack(s): [Mod Menu Hack] [Free] MeChat - Love Secrets v3.3.2 +1 Cheat [ Unlimited Gems ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 91 replies
    • [ FREE ] MeChat ( All Versions ) +1 Cheat [ Unlimited Gems ]
      Modded/Hacked App: MeChat By PlayMe Studio
      Bundle ID: world.playme.mechat
      iTunes Store Link: https://apps.apple.com/us/app/mechat/id1536157979
       

      Hack Features:
      - Unlimited Gems -> Will increase instead of decrease.


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] MeChat - Love Secrets v3.3.2 +1 Jailed Cheat [ Unlimited Gems ] - Free Non-Jailbroken IPA Cheats - iOSGods
      ViP Jailbreak required hack(s): [Mod Menu Hack] MeChat - Love Secrets v3.3.2 +1 Cheat [ Unlimited Gems ] - ViP Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 234 replies
    • BIG NAME: City Lovin v0.30.1 +3 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: BIG NAME: City Lovin By Shanghai zhuomian Network Technology Co., Ltd
      Bundle ID: com.facetgame.citylovin
      iTunes Store Link: https://apps.apple.com/us/app/big-name-city-lovin/id6443984911?uo=4


      Hack Features:
      - Unlimited Cash -> Earn some.
      - Unlimited Diamonds -> Earn some.
      - Unlimited Lives -> Will not decrease.


      Jailbreak required hack(s): [Mod Menu Hack] BIG NAME: City Lovin v0.29.3 +3 Cheats [ Unlimited Currencies ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Winner
        • Like
      • 4 replies
    • BIG NAME: City Lovin v0.30.1 +3 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: BIG NAME: City Lovin By Shanghai zhuomian Network Technology Co., Ltd
      Bundle ID: com.facetgame.citylovin
      iTunes Store Link: https://apps.apple.com/us/app/big-name-city-lovin/id6443984911?uo=4


      Hack Features:
      - Unlimited Cash -> Earn some.
      - Unlimited Diamonds -> Earn some.
      - Unlimited Lives -> Will not decrease.


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] BIG NAME: City Lovin v0.29.3 +3 Jailed Cheats [ Unlimited Currencies ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Thanks
        • Winner
        • Like
      • 5 replies
    • Cash Masters: Billionaire Life v1.5.8 +2 Jailed Cheats [ Unlimited Cash ]
      Modded/Hacked App: Cash Masters: Billionaire Life By USPEX ARASTIRMA GELISTIRME YAZILIM BILGISAYAR SANAYI VE TICARET ANONIM SIRKETI
      Bundle ID: com.uspex.hts
      iTunes Store Link: https://apps.apple.com/us/app/cash-masters-billionaire-life/id1636818775
       

      Hack Features:
      - Unlimited Cash -> Will increase instead of decrease.
      - Free In-App Purchases -> Toggle on via iGMenu.


      Jailbreak required hack(s): [Mod Menu Hack] Cash Masters: Billionaire Life v1.0.0 +2 Cheats [ Unlimited Cash ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 44 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