Jump to content

MSHook - How to Return?


Go to solution Solved by Guest,

3 posts in this topic

Recommended Posts

Posted

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!

  • Solution
Posted

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!

Posted

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

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