Jump to content

Hook (Coding)


Go to solution Solved by TheChief,

14 posts in this topic

Recommended Posts

Posted

I'm converting a Flex patch to Tweak.xm and encounter some of these while coding.

 

What is the correct format for this if you convert it to Tweak.xm:

 

-(void)setCurrentCredits:(long long) ???

 

***This what I make***

 

%hook CCUserCounts

 

-(void)setCurrentCredits:(int) {

return 99999;

}

%end

 

Please correct me

----------------------------

Also to (bool)

 

-(bool)userHasPurchaseProUpgrade ???

 

***This what I make***

 

%hook CCChatViewControllerDataSource

 

-(bool)userHasPurchaseProUpgrade {

return TRUE;

}

%end

 

Please correct me

 

:/

------------------------

Posted

The bool one is correct.


-(void)setCurrentCredits:(long long)arg {

arg = 1234;

%orig(arg);

}

 

That should be good. I'm on phone so double check it if you can :3

  • Solution
Posted

%hook CCUserCounts

-(void)setCurrentCredits:(int)fp8 {

%orig(999999);

}

%end

The bool one is correct.


-(void)setCurrentCredits:(long long)arg {

arg = 1234;

%orig(arg);

}

That should be good. I'm on phone so double check it if you can :3

combine these two :3 and you will get it . An alternative way of the one done by DragonSlayers is

-(void)setCurrentCredits:(int)fp8 {
fp8=99999999;
%orig(fp8);
}
Posted

Thanks guys! Works fine :)

@@DiDA Tweak.xm:39 error: %end does not make sense inside a block :/

Check line: 39. Probably have two %end

Posted

I somehow make the deb succesfully.

 

Get the class targets base on the Flex.

 

Follow the formats.

 

Can install successfully (the .deb). But when I open the app that I hack, the hack won't show. (I mean the effect).

 

Hows this happen?

Posted

I somehow make the deb succesfully.

Get the class targets base on the Flex.

Follow the formats.

Can install successfully (the .deb). But when I open the app that I hack, the hack won't show. (I mean the effect).

Hows this happen?

Wrong bundle id? :)

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