Jump to content

19 posts in this topic

Recommended Posts

Posted

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

Posted

WaveManager9SpawnBombEiP12SPAWNER Is not an integer. BX LR or (void) WaveManager9SpawnBombEiP12SPAWNER { return; }

Posted

WaveManager9SpawnBombEiP12SPAWNER Is not an integer. BX LR or (void) WaveManager9SpawnBombEiP12SPAWNER { return; }

It worked on my Tweak though

Posted

Change *ptr to *self

Ok I'll try

 

 

Use what I have you for an example

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

Posted

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.
Posted

try thes ...

 

if(GetPrefBool(@"kBomb")) {
return 0;

 

to

 

if(GetPrefBool(@"kBomb")) {
return -1;

 

and do't put popup MGS

 

hook appdelegate

-(void) bla bla ....

Posted

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.
Posted

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.

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

    • Gear Truck! v1.0.23 [+3 Jailed Cheats]
      Modded/Hacked App: Gear Truck! By treeplla Inc.
      Bundle ID: com.tree.hybrid.geartank
      App Store Link: https://apps.apple.com/us/app/gear-truck/id6747216965?uo=4



      🤩 Hack Features

      - Never Die
      - High Wheel Speed Gain
      - One Hit Kill
        • Winner
        • Like
      • 5 replies
    • Gear Truck! v1.0.23 [+3 Cheats]
      Modded/Hacked App: Gear Truck! By treeplla Inc.
      Bundle ID: com.tree.hybrid.geartank
      App Store Link: https://apps.apple.com/us/app/gear-truck/id6747216965?uo=4



      🤩 Hack Features

      - Never Die
      - High Wheel Speed Gain
      - One Hit Kill
       
        • Haha
        • Thanks
        • Winner
        • Like
      • 5 replies
    • Soul Huntress: Dungeon Crawler v1.1.4 [+3 Jailed Cheats]
      Modded/Hacked App: Soul Huntress: Dungeon Crawler By Panthera Joint Stock Company
      Bundle ID: com.pantheraplay.soulhuntress
      App Store Link: https://apps.apple.com/ph/app/soul-huntress-dungeon-crawler/id6743422594?uo=4


      🤩 Hack Features

      - Never Die
      - Unlimited Currency (Always Will Increase Spend)
      - Always Can Use Items (Even when has cooldown)
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 45 replies
    • Soul Huntress: Dungeon Crawler v1.1.4 [+3 Cheats]
      Modded/Hacked App: Soul Huntress: Dungeon Crawler By Panthera Joint Stock Company
      Bundle ID: com.pantheraplay.soulhuntress
      App Store Link: https://apps.apple.com/ph/app/soul-huntress-dungeon-crawler/id6743422594?uo=4



      🤩 Hack Features

      - Never Die
      - Unlimited Currency (Always Will Increase Spend)
      - Always Can Use Items (Even when has cooldown)
        • Agree
        • Thanks
        • Winner
        • Like
      • 46 replies
    • Cannon Heroes X v1.2.27 [+2 Jailed Cheats]
      Modded/Hacked App: Cannon Heroes X By Zego Global Pte Ltd
      Bundle ID: com.ig.cannon.heroes
      App Store Link: https://apps.apple.com/us/app/cannon-heroes-x/id6744356657?uo=4



      🤩 Hack Features

      - Free IAP
      - Never Die
      - Debug Menu (Enable once then restart game. Enable again you'll see debug menu)
        • Winner
        • Like
      • 10 replies
    • Cannon Heroes X v1.2.27 [+2 Cheats]
      Modded/Hacked App: Cannon Heroes X By Zego Global Pte Ltd
      Bundle ID: com.ig.cannon.heroes
      App Store Link: https://apps.apple.com/us/app/cannon-heroes-x/id6744356657?uo=4



      🤩 Hack Features

      - Free IAP
      - Never Die
      - Debug Menu (Enable once then restart game. Enable again you'll see debug menu)
       
        • Winner
        • Like
      • 7 replies
    • Slay Quest v1.3.13 [+3 Cheats]
      Modded/Hacked App: Slay Quest By Quest Lab Games Korlatolt Felelossegu Tarsasag
      Bundle ID: com.questlab.slayquest
      App Store Link: https://apps.apple.com/us/app/slay-quest/id6670221918?uo=4



      🤩 Hack Features

      - Unlimited Resources
      - Never Die
      - One Hit Kill
       
        • Agree
        • Thanks
        • Winner
        • Like
      • 8 replies
    • Slay Quest v1.3.13 [+3 Jailed Cheats]
      Modded/Hacked App: Slay Quest By Quest Lab Games Korlatolt Felelossegu Tarsasag
      Bundle ID: com.questlab.slayquest
      App Store Link: https://apps.apple.com/us/app/slay-quest/id6670221918?uo=4

       

      🤩 Hack Features

      - Unlimited Resources
      - Never Die
      - One Hit Kill
        • Like
      • 6 replies
    • Endless Wander - Roguelike RPG v3.0.4 [+3 Jailed Cheats]
      Modded/Hacked App: Endless Wander - Roguelike RPG By First Pick Studios
      Bundle ID: com.FirstPickStudios.Endless-Wander
      App Store Link: https://apps.apple.com/us/app/endless-wander-roguelike-rpg/id6473157705?uo=4



      🤩 Hack Features

      - Never Die
      - Always Enough Currency
      - Unlimited Currency (Will Always Increase)
        • Agree
        • Thanks
        • Winner
        • Like
      • 22 replies
    • Endless Wander - Roguelike RPG v3.0.4 [+3 Cheats]
      Modded/Hacked App: Endless Wander - Roguelike RPG By First Pick Studios
      Bundle ID: com.FirstPickStudios.Endless-Wander
      App Store Link: https://apps.apple.com/us/app/endless-wander-roguelike-rpg/id6473157705?uo=4



      🤩 Hack Features

      - Never Die
      - Always Enough Currency
      - Unlimited Currency (Will Always Increase)
       
        • Agree
        • Winner
        • Like
      • 17 replies
    • Bounce Defense v1.10.2 [+5 Jailed Cheats]
      Modded/Hacked App: Bounce Defense By Voodoo
      Bundle ID: com.minigamelab.bouncedefense
      App Store Link: https://apps.apple.com/us/app/bounce-defense/id6740627201?uo=4



      🤩 Hack Features

      - Add Currency
      - Add Battle Currency (Enable inside battle)
      - Never Die
      - Unlock All Towers
      - Unlimited Tower Cards
        • Informative
        • Thanks
        • Winner
        • Like
      • 22 replies
    • Bounce Defense v1.10.2 [+5 Cheats]
      Modded/Hacked App: Bounce Defense By Voodoo
      Bundle ID: com.minigamelab.bouncedefense
      App Store Link: https://apps.apple.com/us/app/bounce-defense/id6740627201?uo=4



      🤩 Hack Features

      - Add Currency
      - Add Battle Currency (Enable inside battle)
      - Never Die
      - Unlock All Towers
      - Unlimited Tower Cards
        • Agree
        • Thanks
        • Like
      • 15 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