Jump to content

Please help me with this some FLEX code


Go to solution Solved by xC3FFF0E,

8 posts in this topic

Recommended Posts

Posted

Guys, can have some help with this MS hook code? I try to convert from FLEX to PrefBundle tweak. I use PFHeader nic template from iOSGODS.

Here is the code from FLEX that I wanna write to Tweak.xm:

 

1. unsigned int

Target Class
SomeClass

Target Method
-(void) someMethod: (unsigned int)

Return Value (void)
pass-through

Argument #1 (unsigned int)
100

2. void with FALSE/TRUE value

Target Class
SomeClass

Target Method
someMethod

Return Value (void)
TRUE

3. void with integer value

Target Class
SomeClass

Target Method
someMethod:

Return Value (void)
0

4. void with NULL value

Target Class
SomeClass

Target Method
someMethod:likeThis:

Return Value (void)
NULL 

5. long long method

Target Class
_SomeClass

Target Method
-(long long) someMethod

Return Value (long long)
1

And here is my Tweak.xm code, pelase correct me if me wrong.

1. unsigned int
 

%hook SomeClass
-(void)someMethod:(unsigned int) myvalue {
if(GetPrefBool(@"k1")){
myvalue = 100;
}
%orig(myvalue);
}
%end

2. void with TRUE/FALSE value

%hook SomeClass
- someMethod {
if(GetPrefBool(@"k2")) {
return true;
}
return %orig;
}
%end

3. void with integer value

%hook SomeClass
- someMethod {
if(GetPrefBool(@"k3")) {
return: 0;
}
return %orig;
}
%end

4. void with NULL value

%hook SomeClass
- someMethod:likeThis: {
if(GetPrefBool(@"k3")) {
return null;
}
return %orig;
}
%end

5. long long method

%hook _SomeClass
-(long long) someMethod {
if(GetPrefBool(@"k4")) {
return:1;
}
return %orig;
}
%end

Please correct my code. Sorry if there are annoying code, I just wanna learn. Thank you.

Posted

I think your codes are alright. Let's wait for someone with better knowledge on this one, as I am rusty. :3

 

Thank you, but when I compile the tweak is not working.   (y)  :sad:

Posted

Unsigned int :

there shouldnt be any space between (unsigned int) and myvalue

%hook SomeClass
-(void)someMethod:(unsigned int)myvalue {
if(GetPrefBool(@"k1")){
myvalue = 100;
}
%orig;
}
%end
Posted

There's an issue compiling or the hack doesn't work?

No error while compiling, but the hack doesn't work ????

 

Unsigned int :

there shouldnt be any space between (unsigned int) and myvalue

%hook SomeClass
-(void)someMethod:(unsigned int)myvalue {
if(GetPrefBool(@"k1")){
myvalue = 100;
}
%orig;
}
%end

Thank you, I'll try ????????????

  • Solution
Posted

You can never ever, override a "void". Just remember that.

 

And also, don't use "myvalue" it might not work in some cases. Though, you can use, "argument".

 

Here's some example:

 

%hook SomeClass

-(void)someMethod:(unsigned int)arguement {

if(GetPrefBool(@"k1")){

arguement = 100;

}

return %orig;

}

%end

 

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

 

One last thing, "void" can never be override as "null" whereas "null" is equivalent to 0 or none.

 

You can only use "null -> nil" and "%orig" to "(:id)"

 

Here's some example:

 

%hook SomeClass

-(void)someMethod:(id)arguement {

if(GetPrefBool(@"k1")){

arguement = %orig; <----- this identify as the ":(id)". "%orig" means 'return to original state' and "nil" means 'wipe the current value'.

}

return %orig; <----- this identify as the "-(void)"

}

%end

Posted

You can never ever, override a "void". Just remember that.

 

And also, don't use "myvalue" it might not work in some cases. Though, you can use, "argument".

 

Here's some example:

 

%hook SomeClass

-(void)someMethod:(unsigned int)arguement {

if(GetPrefBool(@"k1")){

arguement = 100;

}

return %orig;

}

%end

 

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

 

One last thing, "void" can never be override as "null" whereas "null" is equivalent to 0 or none.

 

You can only use "null -> nil" and "%orig" to "(:id)"

 

Here's some example:

 

%hook SomeClass

-(void)someMethod:(id)arguement {

if(GetPrefBool(@"k1")){

arguement = %orig; <----- this identify as the ":(id)". "%orig" means 'return to original state' and "nil" means 'wipe the current value'.

}

return %orig; <----- this identify as the "-(void)"

}

%end

Thank you very much! ????

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
  • Our picks

    • Pal Go: Tower Defense TD v0.3.73 [+7 Cheats]
      Modded/Hacked App: Pal Go: Tower Defense TD By Playwind Ltd
      Bundle ID: com.playwindgames.freedefender
      iTunes Store Link: https://apps.apple.com/us/app/pal-go-tower-defense-td/id6479316663?uo=4


       

      🚀 Hack Features

      - [VIP] Freeze Currency (Currency will not decrease when used)

      - [VIP] Currency Always Enough (Buy even when you don't have enough currency)

      - [Free] Higher Recruit Energy (Gives 500 Recruit Energy Every Wave)

      - [Free] Always Can Drag Hero

      - [Free] Skip Ads

      - [Free] No Attack Cooldown

      - [Free] Global Speed Multiplier (Enable Inside Battle)

       

      Warning


      Do not use on main account. There is a chance of ban. Not responsible for any bans.

       


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/forum/79-no-jailbreak-section/
      🤖 Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      • 46 replies
    • Pal Go: Tower Defense TD v0.3.73 [+7 Jailed Cheats]
      Modded/Hacked App: Pal Go: Tower Defense TD By Playwind Ltd
      Bundle ID: com.playwindgames.freedefender
      iTunes Store Link: https://apps.apple.com/us/app/pal-go-tower-defense-td/id6479316663?uo=4


       

      Hack Features

      - [VIP] Freeze Currency (Currency will not decrease when used)

      - [VIP] Currency Always Enough (Buy even when you don't have enough currency)

      - [Free] Higher Recruit Energy (Gives 500 Recruit Energy Every Wave)

      - [Free] Always Can Drag Hero

      - [Free] Skip Ads

      - [Free] No Attack Cooldown

      - [Free] Global Speed Multiplier (Enable Inside Battle)

       

      Warning


      Do not use on main account. There is a chance of ban. Not responsible for any bans.

       

      Jailbreak required iOS hacks: https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APKs: https://iosgods.com/forum/68-android-section/
      • 71 replies
    • Derailed: Survival Adventure v1.8.0 [+3 Jailed Cheats]
      Modded/Hacked App: Derailed: Survival Adventure By Kwalee Ltd
      Bundle ID: com.kwalee.derailed
      iTunes Store Link: https://apps.apple.com/us/app/derailed-survival-adventure/id6670252580?uo=4



      🤩 Hack Features

      - Free Shop (IAP, No Ads, Chest)
      - Never Die
      - Always Can Unlock Tiles
      • 8 replies
    • Derailed: Survival Adventure v1.8.0 [+3 Cheats]
      Modded/Hacked App: Derailed: Survival Adventure By Kwalee Ltd
      Bundle ID: com.kwalee.derailed
      iTunes Store Link: https://apps.apple.com/us/app/derailed-survival-adventure/id6670252580?uo=4

       

      🤩 Hack Features

      - Free Shop (IAP, No Ads, Chest)
      - Never Die
      - Always Can Unlock Tiles
      • 7 replies
    • Life in Adventure v1.2.30 [+3 Jailed Cheats]
      Modded/Hacked App: Life in Adventure By sangil kim
      Bundle ID: com.StudioWheel.Bard
      iTunes Store Link: https://apps.apple.com/us/app/life-in-adventure/id1551617649?uo=4



      🚀 Hack Features

      - Add Gems (Do not Add More Than 900. If your Gem > 1000 You'll get ban)
      - Guild Subscription Activeted
      - Never Die
      • 17 replies
    • Life in Adventure v1.2.30 [+3 Cheats]
      Modded/Hacked App: Life in Adventure By sangil kim
      Bundle ID: com.StudioWheel.Bard
      App Store Link: https://apps.apple.com/us/app/life-in-adventure/id1551617649?uo=4



      🤩 Hack Features

      - Add Gems (Do not Add More Than 900. If your Gem > 1000 You'll get ban)
      - Guild Subscription Activeted
      - Never Die
      • 6 replies
    • Bounce Defense v1.3.5 [+5 Jailed Cheats]
      Modded/Hacked App: Bounce Defense By Voodoo
      Bundle ID: com.minigamelab.bouncedefense
      App Store Link: https://apps.apple.com/us/app/bounce-defense/id6740627201?uo=4



      🤩 Hack Features

      - Add Currency
      - Add Battle Currency (Enable inside battle)
      - Never Die
      - Unlock All Towers
      - Unlimited Tower Cards
      • 11 replies
    • Bounce Defense v1.3.5 [+5 Cheats]
      Modded/Hacked App: Bounce Defense By Voodoo
      Bundle ID: com.minigamelab.bouncedefense
      App Store Link: https://apps.apple.com/us/app/bounce-defense/id6740627201?uo=4



      🤩 Hack Features

      - Add Currency
      - Add Battle Currency (Enable inside battle)
      - Never Die
      - Unlock All Towers
      - Unlimited Tower Cards
      • 8 replies
    • Galaxy Defense: Fortress TD v0.8.9 [+2 Cheats]
      Modded/Hacked App: Galaxy Defense: Fortress TD By CYBERJOY LIMITED
      Bundle ID: com.cyberjoy.galaxydefense
      App Store Link: https://apps.apple.com/us/app/galaxy-defense-fortress-td/id6740189002?uo=4



      🤩 Hack Features

      - One Hit Kill
      - Activate SVIP
       
        • Informative
      • 25 replies
    • Galaxy Defense: Fortress TD v0.8.9 [+2 Jailed Cheats]
      Modded/Hacked App: Galaxy Defense: Fortress TD By CYBERJOY LIMITED
      Bundle ID: com.cyberjoy.galaxydefense
      App Store Link: https://apps.apple.com/us/app/galaxy-defense-fortress-td/id6740189002?uo=4



      🤩 Hack Features

      - One Hit Kill
      - Activate SVIP
        • Agree
        • Like
      • 5 replies
    • Run! Goddess v1.0.17 [+4 Jailed Cheats]
      Modded/Hacked App: Run! Goddess By TOP GAMES INC.
      Bundle ID: com.topgamesinc.rg
      iTunes Store Link: https://apps.apple.com/us/app/run-goddess/id6667111749?uo=4



      🤩 Hack Features

      - No Skill Cooldown
      - Slow Enemy
      - Enemy Can't Attack (Enemy Can't Do Damage)
      • 76 replies
    • Run! Goddess v1.0.17 [+4 Cheats]
      Modded/Hacked App: Run! Goddess By TOP GAMES INC.
      Bundle ID: com.topgamesinc.rg
      iTunes Store Link: https://apps.apple.com/us/app/run-goddess/id6667111749?uo=4

       

      🤩 Hack Features

      - No Skill Cooldown
      - Slow Enemy
      - Enemy Can't Attack (Enemy Can't Do Damage)
       
      • 68 replies
×
  • 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