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

    • 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
       
        • Agree
        • Winner
        • Like
      • 20 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
        • Haha
        • Thanks
        • Winner
        • 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)
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 75 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)
       
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 68 replies
    • Eternium Cheats v1.37.7 +11
      Modded/Hacked App: Eternium By Making Fun, Inc.
      Bundle ID: com.makingfun.mageandminions
      iTunes Store Link: https://apps.apple.com/us/app/eternium/id579931356?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - 5K Gems When Completed Stage
      - Infinite Gold
      - Infinite Cosmetic
      - Infinite Yellow Stone
      - Multiply Attack (Linked with Enemy)
      - No Skills Cooldown
      - No Consumable Cooldown
      - Multiply Attack Speed
      - Instant Regen Health
      - Always Crit
      - Material Drops (When you killed an Enemy it will drop materials for crafts)



      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/194526-eternium-cheats-v13355-6/
        • Informative
        • Agree
        • Winner
        • Like
      • 75 replies
    • Candy Crush Saga v1.304.1 Jailed Cheats +3
      Modded/Hacked App: Candy Crush Saga By King.com Limited
      Bundle ID: com.midasplayer.apps.candycrushsaga
      iTunes Store Link: https://apps.apple.com/us/app/candy-crush-saga/id553834731?uo=4


      Hack Features:
      - Infinite Life
      - Infinite Booster
      - Infinite Move


      Jailbreak required hack(s): https://iosgods.com/topic/190447-candy-crush-saga-cheats-v12941-3/


      iOS Hack Download IPA Link: https://iosgods.com/topic/190448-candy-crush-saga-v12941-jailed-cheats-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 96 replies
    • [ JP / Global/ KR] Puzzle & Dragons Cheats v22.3.0 +3
      Modded/Hacked App: Puzzle & Dragons (English) by GungHo Online Entertainment, INC.
      Bundle ID: jp.gungho.padEN
      iTunes Store Link: https://apps.apple.com/us/app/puzzle-dragons-english/id563474464?uo=4&at=1010lce4


      Hack Features:
      - God Mode
      - OHK
      - Frozen Enemies


      iOS Hack Download Link: https://iosgods.com/topic/133984-puzzle-dragons-jp-english-cheats-all-versions-3/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 454 replies
    • DomiNation Asia By NEXON Company v12.1480.1481 - [ Currencies Freeze & More ]
      Modded/Hacked App: ドミネーションズ -文明創造- (DomiNations) By NEXON Company
      Bundle ID: com.nexon.dominations.asia
      iTunes Store Link: https://itunes.apple.com/jp/app/ドミネーションズ-文明創造-dominations/id1012778321


      Hack Features:
      - Unlimited Crowns/Food/Oil/Gold -> Resources will add instead of subtracting. Works with Crowns. Read note inside the feature for more information! This does not work for speeding up buildings.
      - All Achievements Unlocked 
      - Freeze Crowns/Food/Oil/Gold -> Freezes Resources so they do not decrease when used! This does not work for speeding up buildings.
      - No Citizen Cost 
      - 0 Cost to Speed Up Training Troops
      - 0 Cost to Speed Up Tactics
      - 0 Food Cost to Train Troops
      - 0 Food Cost to Upgrade Troops
      - No Timer to Upgrade Troops
      - 0 Food Cost to Train Spells
      - 0 General Train Cost
      - No General Train CoolDown
      - 0 Food Cost to Build Wonder
      - 0 Food Cost to Research Troops
      - 0 Food Cost to Upgrade Tactics
      - No Timer to Library Research
      - No Timer to Upgrade Spells
      - 0 Cost to Upgrade Buildings
      - 0 Workers Required to Upgrade
      - 0 Crown Cost For Peace

      This hack works on the latest x64 or ARM64 & ARM64e iDevices: iPhone 5s, 6, 6 Plus, 6s, 6s Plus, 7, 7 Plus, 8, 8 Plus, X, Xr, Xs, Xs Max, 11, 11 Pro, 11 Pro Max, 12, 12 Pro, 12 Pro Max, 12 Mini, 13, 13 Pro, 13 Pro Max, 13 Mini, 14, 14 Plus, 14 Pro, 14 Pro Max, SE, iPod Touch 6G, 7G, iPad Air, Air 2, iPad Pro & iPad Mini 2, 3, 4, 5, 6 and later.


      Global hack(s): https://iosgods.com/topic/50401-ultrahack-dominations-v6660661-40-cheats-iosgods-exclusive/?tab=comments#comment-1582742
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,100 replies
    • DomiNations v12.1480.1481 +40++ Cheats [ Exclusive ]
      Modded/Hacked App: DomiNations by NEXON M Inc.
      Bundle ID: com.nexonm.dominations
      iTunes Store Link: https://itunes.apple.com/us/app/dominations/id922558758


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iFile / Filza / iFunBox / iTools or any other file managers for iOS.
      - Cydia Substrate (from Cydia).
      - PreferenceLoader (from Cydia).


      Hack Features:
      - Unlimited Crowns/Food/Oil/Gold -> Resources will add instead of subtracting. Works with Crowns. Read note inside the feature for more information! This does not work for speeding up buildings.
      - All Achievements Unlocked
      - Freeze Crowns/Food/Oil/Gold -> Freezes Resources so they do not decrease when used! This does not work for speeding up buildings.
      - No Citizens Cost
      - Place Multiple of Same Building
      - 0 Cost to Speed Up Training Troops
      - 0 Cost to Speed Up Tactics
      - 0 Food Cost to Train Troops
      - 0 Food Cost to Upgrade Troops
      - No Timer to Upgrade Troops
      - 0 Food Cost to Train Spells
      - 0 General Train Cost
      - No General Train Cooldown
      - 0 Food Cost to Build Wonder
      - 0 Food Cost to Research Troops
      - 0 Food Cost to Upgrade Tactics
      - No Timer to Library Research
      - No Timer to Upgrade Spells
      - 0 Cost to Upgrade Buildings
      - 0 Workers Required to Upgrade
      This hack is an In-Game Mod Menu (iGMM). In order to activate the Mod Menu, tap on the iOSGods button found inside the app.
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 4,984 replies
    • Monster Legends: Collect all Cheats v17.9.5 +8
      Modded/Hacked App: Monster Legends: Merge RPG By Socialpoint
      Bundle ID: es.socialpoint.MonsterCity
      iTunes Store Link: https://apps.apple.com/us/app/monster-legends-merge-rpg/id653508448?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Cydia, Sileo or Zebra).

       

      🤩 Hack Features

      - 1 Hit Kill
      - Skip Enemy Turn
      - Multiply Attack
      - Multiply Defense
      - Insane Score (Always 3 Stars)
      - No Skill Cost
      - Auto Win
      - Auto Play Battle Enabled for All Maps


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/topic/140543-monster-legends-collect-all-v1778-5-cheats-for-jailed-idevices/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/176914-monster-legends-collect-all-cheats-v1779-8/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 339 replies
    • Simply Piano: Learn Piano Fast Modded v9.10.14 +1
      Modded/Hacked App: Simply Piano: Learn Piano Fast By Simply Ltd
      Bundle ID: com.joytunes.asla
      iTunes Store Link: https://apps.apple.com/us/app/simply-piano-learn-piano-fast/id1019442026?uo=4


      Hack Features:
      - PREMIUM
       

      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/68652-simply-piano-v975-jailed-mod-1/


      Hack Download Link: https://iosgods.com/topic/83369-simply-piano-learn-piano-fast-modded-all-versions-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,540 replies
    • [ Chiikawa Pocket JP ] ちいかわぽけっと v1.2.0 Jailed Cheats +3
      Modded/Hacked App: ちいかわぽけっと By Applibot Inc.
      Bundle ID: jp.co.applibot.chiikawapocket
      iTunes Store Link: https://apps.apple.com/jp/app/%E3%81%A1%E3%81%84%E3%81%8B%E3%82%8F%E3%81%BD%E3%81%91%E3%81%A3%E3%81%A8/id6596745408?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - God Mode
      - Multiply Attack
      - Custom Speed (Customize before Login or Clear stage to get apply)

       

      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/194281-chiikawa-pocket-jp-%E3%81%A1%E3%81%84%E3%81%8B%E3%82%8F%E3%81%BD%E3%81%91%E3%81%A3%E3%81%A8-v1111-jailed-cheats-3/
        • Haha
        • Like
      • 23 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