Jump to content

How to gather many functions in one key for a patcher


Go to solution Solved by CmakLove,

4 posts in this topic

Recommended Posts

Posted

Hey i was wondering how to gather these functions in one key for a patcher ? :)

Template:

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.mehdi.hack.plist"

 

inline bool GetPrefBool(NSString *key)

{

return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];

}

 

%hook something

 

-(int)method {

if(GetPrefBool(@"kKey")) {

return 9999999;

}

return %orig;

}

 

-(int)gems {

if(GetPrefBool(@"kGems")) {

return 9999999;

}

return %orig;

}

 

-(unsigned int)lives {

if(GetPrefBool(@"kLives")) {

return 9999999;

}

return %orig;

}

 

%end

 

%hook SomethingElse

 

-(BOOL)SomeMethod {

if(GetPrefBool(@"kKEY5")) {

return TRUE;

}

return %orig;

}

 

-(BOOL)SomeMethod2 {

if(GetPrefBool(@"kKEY6")) {

return FALSE;

}

return %orig;

}

 

%end

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