Jump to content

The Right Code?


Go to solution Solved by Elite Haxor,

13 posts in this topic

Recommended Posts

  • Solution
Posted

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.EliteHaxor.x.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

Posted

#define PLIST_PATH @"/var/mobile/Library/Preferences/com.EliteHaxor.x.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

i have it in my tweak.xm now 

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