Jump to content

[TUTORIAL] How To Hack Using Mobile Substrate (Method Hooking)


180 posts in this topic

Recommended Posts

Posted

I somehow can't get this to work. I found the headers and methods using Flex 2 and modifying the return values works there. But when I put it into code absolutely nothing happens in the game.

I tried a simple game called 94% which hasn't too many options, so I thought it would be good for a start.

Tweak.xm:

#import <UIKit/UIKit.h>

%hook NPLevelMapping
	-(bool)isUnlockedLevelIdentifier:(id)argument {
		return true;
	}
%end

%hook LLAppDelegate
	-(void)applicationDidBecomeActive:(id)argument {
		UIAlertView *alert = [[UIAlertView alloc] 
			initWithTitle:@"Title" 
			message:@"Message" 
			delegate:nil 
			cancelButtonTitle:@"Cancel Button" 
			otherButtonTitles:@"Another Button",
			nil
		];
		[alert show];
		[alert release];
	}
%end


Makefile:

include theos/makefiles/common.mk

TWEAK_NAME = 94hack
94hack_FILES = Tweak.xm
94hack_FRAMEWORKS = UIKit

include $(THEOS_MAKE_PATH)/tweak.mk

after-install::
	install.exec "killall -9 SpringBoard"

94hack.plist:

{ Filter = { Bundles = ( "com.scimob.94percent" ); }; }

Any idea what's wrong with my 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
×
  • 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