Jump to content

(id) hooking appcrash


Go to solution Solved by Rook,

6 posts in this topic

Recommended Posts

Posted

I`m trying to make a flex patch into a tweak. Flex patch works like a charm, however, (id) seems to make the app crashing.

I tried both manually using some templates found here and also with the FlexConverter. Both failed. Tried both Float and Integer.

 

 

 

 

 

%hook DashboardViewController

-(id) daysRemaining {

return [NSNumber numberWithFloat: 999.0];

}

%end

 

%hook AccountViewController

-(id) daysRemaining {

return [NSNumber numberWithFloat: 999.0];

}

%end

 

%hook AccountViewController

-(void) setDaysRemaining:(id)arg1 {

arg1 = [NSNumber numberWithFloat: 999.0];

return %orig;

}

%end

Posted

@

%hook DashboardViewController
-(id) daysRemaining {
return [NSNumber numberWithInteger: 999];
}
%end

%hook AccountViewController
-(id) daysRemaining {
return [NSNumber numberWithInteger: 999];
}
%end

%hook AccountViewController
-(void) setDaysRemaining:(id)arg1 {
arg1 = [NSNumber numberWithInteger: 999];
return %orig;
}
%end 

Why Float when it can be int?

Posted

Integer was my first attempt, caused crash too.

FlexConverter copied it as float.

 

I actually found another way, so its not necessary anymore, however, if anyone knows why it causes crash, feel free to let me know, for future reference :)

  • Solution
Posted

Integer was my first attempt, caused crash too.

FlexConverter copied it as float.

 

I actually found another way, so its not necessary anymore, however, if anyone knows why it causes crash, feel free to let me know, for future reference :)

Try the replies here: https://iosgods.com/topic/22939-how-to-i-hook-somthing-with-12-arguments

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