Skip to content
Guest Big Announcement

MSHook - How to Return?

Featured Replies

How do I write this in the tweak.xm?

 

If the target method is: -(void) setCanFly:(bool)

 

I know that

-(void) setCanFly:(bool) {
return true; 
}
Dosnt work as it thinks I'm trying to return the void, so, how do I write it?

 

Thanks in advance!

Solved by Guest

  • Solution

This is not mshook :p well, you got the right idea that you are hooking, but this is simple ms.

 

You gotta figure out the name of the argument that has the bool. You shouldn't have seen

- (void)setCanFly:(BOOL)
, you should have seen
- (void)setCanFly:(BOOL)arg1
, and arg1 could be anything.

 

Anyway, to return it right, do this:

 

- (void)setCanFly:(BOOL)arg1 {
arg1 = true;
%orig(arg1);
}

good luck!

This is not mshook :p well, you got the right idea that you are hooking, but this is simple ms.

You gotta figure out the name of the argument that has the bool. You shouldn't have seen

- (void)setCanFly:(BOOL)
, you should have seen
- (void)setCanFly:(BOOL)arg1
, and arg1 could be anything.

Anyway, to return it right, do this:

- (void)setCanFly:(BOOL)arg1 {
arg1 = true;
%orig(arg1);
}
good luck!
Oh alright xD Thanks bro, will try asap

Create an account or sign in to comment

Featured Content

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.