Jump to content

3 posts in this topic

Recommended Posts

this is my tweak code

#include "Macros.h"



/*****************************/
// Please see sample.xm for sample menu code.

// title of your menu
static NSString *const title = @"test"; 

// who made the hack?
static NSString *const credits = @"test";

// what font do you want the text to be? don't put anything for the default font
static NSString *const font = @"";

// should the menu have a blurred background? true or false
// FYI: this won't always look pretty
static const bool blur = true;

// blur style
// you MUST pick from these three: UIBlurEffectStyleExtraLight, UIBlurEffectStyleLight, or UIBlurEffectStyleDark
// *** If you opted for no blur background, this is ignored. However, you still need to fill it in. ***
static const UIBlurEffectStyle blurStyle = UIBlurEffectStyleDark;

// A complete list of fonts can be found here: http://iosfonts.com/
/******************************/

%hook MainAppController

- (void)applicationDidBecomeActive:(id)arg0 {
    /* For iOS 11 compatibility, the theme color must be here. */
    /* The overall color for the menu and the button. */
    /* If you want a custom color, use rgb(color code) */
    /* Use rgb(arc4random_uniform(0xFFFFFF)) for a random color each launch. */
    UIColor *themeColor = rgb(arc4random_uniform(0xFFFFFF));

    UIWindow *main = [UIApplication sharedApplication].keyWindow.rootViewController.view;

    UIButton *openButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    openButton.frame = CGRectMake((main.frame.size.width/2)-15, (main.frame.size.height/2)+75, 30, 30);
    openButton.backgroundColor = [UIColor clearColor];
    openButton.layer.cornerRadius = 16;
    openButton.layer.borderWidth = 2;
    openButton.layer.borderColor = themeColor.CGColor;
    [openButton addTarget:self action:@selector(wasDragged:withEvent:) 
    forControlEvents:UIControlEventTouchDragInside];
    [openButton addTarget:self action:@selector(showMenu) 
    forControlEvents:UIControlEventTouchDownRepeat];

    if(!buttonAdded){
        timer(5){
            UIWindow *main = [UIApplication sharedApplication].keyWindow.rootViewController.view;
            menu = [[ModMenu alloc] initWithTitle:title credits:credits fontName:font theme:themeColor blur:blur blurStyle:blurStyle];

            /*
            Add features below this comment. Feel free to delete this comment if you're comfortable with how this menu works.

            Things are added to the menu in the order you have added them.

            A Hack is a switch that contains offsets, hacked hexes, and original hexes. Straightforward.
            To create one, call addHack.
            addHack is called as follows: addHack(@"Hack Name", @"The description of your hack", themeColor, {offsets}, {hacked hexes}, {original hexes});
            For example:
            addHack(@"Infinite Ammo", @"Ammo doesn't run out.", themeColor, {0x1001B292A}, {0xC0035FD6}, {0xD213AEB5});
            You can also have multiple offsets, hacked hexes, and original hexes. There's no limit to the number of offsets you can have! For example:
            addHack(@"No Recoil", @"No recoil prevents any recoil from being applied when you shoot.", themeColor, {0x356a7c, 0x110f0a}, {0x7047, 0x7047}, {0xf0b5, 0xf0b5});
            
            A Hook is a switch that used to hook a function and apply a feature. This doesn't make much sense because you cannot "unhook" a function if
            the user wants the feature off. It currently serves no purpose except for backward compatibility. All it does is turn on or off now.

            A SliderHook is a slider that can be customized to have a minimum and maximum value.
            Good for hooking a function and returning user-specified values. To create one, call addSliderHook.
            addSliderHook is called as follows: addSliderHook(@"Hack Name", @"Description of your hack", themeColor, initial value, minimum value, maximum value);
            For example:
            addSliderHook(@"Adjust Field of View", @"Adjust your field of view.", themeColor, 0, 100, 50);
            To get the value of a SliderHook:
            float value = [SliderHook getSliderValueForHook:@"hack name here"];
            int value = (int)[SliderHook getSliderValueForHook:@"hack name here"];

            A TextfieldHook is a textfield. Again, good for hooking a function and returning user-specified values.
            To create one, call addTextfieldHook.
            addTextfieldHook is called as follows: addTextfieldHook(@"Hack name", @"Description of your hack", themeColor);
            For example:
            addTextfieldHook(@"Set Gems", @"Set your gem amount.", themeColor);
            To get the value of a TextfieldHook:
            NSString *value = [TextfieldHook getTextfieldValueForHook:@"hack name here"];
            float value = [[TextfieldHook getTextfieldValueForHook:@"hack name here"] floatValue];
            int value = [[TextfieldHook getTextfieldValueForHook:@"hack name here"] intValue];

            A Switch does nothing but turn on or off. Useful when you are in a hooked function and need to know when to call a function or mod an instance variable.
            Since it doesn't do anything but turn on or off, it is essentially the same thing as a Hook.
            To create one, call addSwitch.
            addSwitch is called as follows:
            addSwitch(@"Hack name", @"Description of your hack", themeColor);
            For example:
            addSwitch(@"Kill Everyone", @"Kill everyone in the lobby", themeColor);
            To test whether or not a Switch is on:
            bool on = [Switch getSwitchOnForSwitch:@"hack name here"];

            If you want to use writeData in your Tweak.xm, now you can! Call writeData like you normally would.
            Call writeData after the menu has been created. If you use it where you add features, you'll be fine.

            Handle hooking with the HOOK and HOOK_NO_ORIG macros. I decided to let you guys handle hooking because
            it is too troublesome to make sure I handle cases where you guys pass parameters incorrectly.

            If I wanted to hook a function called LocalPlayer::Update at 0x1001B762A with a pointer to the original function, I would do this:
            HOOK(0x1001B762A, _LocalPlayer_Update, LocalPlayer_Update);

            Where _LocalPlayer_Update is the function you write, and LocalPlayer_Update is the pointer to the original function.

            You can use HOOK_NO_ORIG if you don't need the pointer to the original function:
            HOOK_NO_ORIG(0x1001B762A, _LocalPlayer_Update);

            If that is too confusing, you can always just use MSHookFunction. HOOK and HOOK_NO_ORIG just wrap MSHookFunction in a cleaner call.
            */

            // add features here!


addSliderHook(@"ffov", @"Adjust your field of view.", themeColor, 0, 100, 0);


addSliderHook(@"Adjust Field of View", @"Adjust your field of view.", themeColor, 0, 100, 50);

            [main addSubview:openButton];
            [main addSubview:menu];

            buttonAdded = true;
        });
    }

    %orig;
}

%new
- (void)showMenu {
    [menu show];
}

%new
- (void)wasDragged:(UIButton *)button withEvent:(UIEvent *)event
{
    UITouch *touch = [[event touchesForView:button] anyObject];

    CGPoint previousLocation = [touch previousLocationInView:button];
    CGPoint location = [touch locationInView:button];
    CGFloat delta_x = location.x - previousLocation.x;
    CGFloat delta_y = location.y - previousLocation.y;

    button.center = CGPointMake(button.center.x + delta_x, button.center.y + delta_y);
}
%end

void (* vp_FPWeapon_Update)(void *vp_FPWeapon);void _vp_FPWeapon_Update(void *vp_FPWeapon) {*(float *)((uint64_t)vp_FPWeapon + 0xC0) =  [SliderHook getSliderValueForHook:@"ffov"];vp_FPWeapon_Update(vp_FPWeapon);}%ctor {MSHookFunction((void *)getRealOffset(0x101977710), (void *)_vp_FPWeapon_Update, (void**)&vp_FPWeapon_Update);}

void addHack(NSString *name, NSString *description, UIColor *theme, std::initializer_list<uint64_t> offsets, std::initializer_list<uint64_t> hackedHexes, std::initializer_list<uint64_t> originalHexes){
    if(menu == nil)
        return;
    
    std::vector<uint64_t> offsetVector;
    std::vector<uint64_t> hackedHexVector;
    std::vector<uint64_t> originalHexVector;
    
    offsetVector.insert(offsetVector.begin(), offsets.begin(), offsets.end());
    hackedHexVector.insert(hackedHexVector.begin(), hackedHexes.begin(), hackedHexes.end());
    originalHexVector.insert(originalHexVector.begin(), originalHexes.begin(), originalHexes.end());
    
    Hack *h = [[Hack alloc] initWithHackName:name info:description fontName:font theme:theme offset:offsetVector hackedHex:hackedHexVector originalHex:originalHexVector];
    [menu addHack:h];
}

void addHook(NSString *name, NSString *description, UIColor *theme){
    if(menu == nil)
        return;
    
    Hook *h = [[Hook alloc] initWithHookName:name info:description fontName:font theme:theme];
    [menu addHook:h];
}

void addSliderHook(NSString *name, NSString *description, UIColor *theme, float initialValue, float minValue, float maxValue){
    if(menu == nil)
        return;

    if(minValue > maxValue)
        return;
    
    SliderHook *sh = [[SliderHook alloc] initWithSliderHookName:name info:description fontName:font theme:theme initialValue:initialValue minValue:minValue maxValue:maxValue];
    [menu addHook:sh];
}

void addTextfieldHook(NSString *name, NSString *description, UIColor *theme){
    if(menu == nil)
        return;
    
    TextfieldHook *th = [[TextfieldHook alloc] initWithTextfieldHookName:name info:description fontName:font theme:theme];
    [menu addHook:th];
}

void addSwitch(NSString *name, NSString *description, UIColor *theme){
    if(menu == nil)
        return;
    
    Switch *s = [[Switch alloc] initWithSwitchName:name info:description fontName:font theme:theme];
    [menu addHook:s];
}

void writeData(uint64_t offset, uint64_t hex){
    if(menu == nil)
        return;
    
    [menu writeTo:offset withHex:hex];
}

 

Link to comment
https://iosgods.com/topic/100790-addslider-not-showing-in-mod-menu/
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below. For more information, please read our Posting Guidelines.
Reply to this topic... Posting Guidelines

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Our picks

    • Conquest Girls : AFK Idle RPG Cheats v2.11.63 +4
      Modded/Hacked App: Conquest Girls : AFK Idle RPG By Toast.Co.,Ltd
      Bundle ID: com.greenspring.conquestgirls
      iTunes Store Link: https://apps.apple.com/us/app/conquest-girls-afk-idle-rpg/id6670455686?uo=4


      Hack Features:
      - Multiply Attack
      - Multiply Attack Speed
      - Multiply Attack Range
      - Freeze Currencies (Some arena / section may not support this)

       


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/189660-conquest-girls-afk-idle-rpg-v21153-jailed-cheats-4/
       


      iOS Hack Download Link: https://iosgods.com/topic/186829-conquest-girls-afk-idle-rpg-cheats-v21153-4/
        • Agree
        • Haha
        • Thanks
        • Like
      • 30 replies
    • My Hot Pot Story Cheats v4.4.2 +1
      Modded/Hacked App: My Hotpot Story By 冲 于
      Bundle ID: com.lxqd.hotpotiver
      iTunes Store Link: https://apps.apple.com/us/app/my-hotpot-story/id1623328997?uo=4


      Hack Features:
      - Infinite Currencies


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/166067-my-hotpot-story-v145-jailed-cheats-1/


      iOS Hack Download Link: https://iosgods.com/topic/166065-my-hotpot-story-cheats-all-versions-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 133 replies
    • Idle Theme Park - Tycoon Game Cheats v6.5.2 +1
      Modded/Hacked App: Idle Theme Park - Tycoon Game by Digital Things Sociedad Limitada
      Bundle ID: com.codigames.idle.theme.park.tycoon
      iTunes Store Link: https://apps.apple.com/us/app/idle-theme-park-tycoon-game/id1460772578?uo=4&at=1010lce4


      Hack Features:
      - Infinite Cash


      iOS Hack Download Link: https://iosgods.com/topic/116320-arm64-idle-theme-park-tycoon-game-cheats-v210-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 541 replies
    • [ Arknights KR ] 명일방주 Cheats v27.3.61 +8 - [ God Mode & More ]
      Modded/Hacked App: 명일방주 By YOSTAR (HONG KONG) LIMITED
      Bundle ID: com.YoStarKR.Arknights
      iTunes Store Link: https://apps.apple.com/kr/app/%EB%AA%85%EC%9D%BC%EB%B0%A9%EC%A3%BC/id1473903308?uo=4


      Hack Features:
      - God Mode
      - Frozen Enemies
      - One Hit Kill
      - Instant - Win
      - No Deploy Cost
      - Multiply Damage
      - Multiply Defense
      - Multiply Character Speed


      iOS Hack Download Link: https://iosgods.com/topic/164929-arknights-kr-%EB%AA%85%EC%9D%BC%EB%B0%A9%EC%A3%BC-cheats-v12001-8-god-mode-more/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Like
      • 54 replies
    • Arknights Cheats v27.3.61 +8 - [ God Mode & More ]
      Modded/Hacked App: Arknights By YOSTAR (HONG KONG) LIMITED
      Bundle ID: com.YoStarEN.Arknights
      iTunes Store Link: https://apps.apple.com/us/app/arknights/id1464872022?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

      - God Mode
      - Frozen Enemies
      - One Hit Kill
      - Instant - Win
      - No Deploy Cost
      - Multiply Damage
      - Multiply Defense
      - Multiply Character Speed


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/topic/191668-arknights-v27361-jailed-cheats-8/

       

      📥 iOS Hack Download Link: https://iosgods.com/topic/117802-arknights-cheats-v27361-8-god-mode-more/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 1,055 replies
    • Candy Crush Friends Saga Cheats v4.8.0.0 +3
      Modded/Hacked App: Candy Crush Friends Saga By King
      Bundle ID: com.midasplayer.apps.candycrush4
      iTunes Store Link: https://itunes.apple.com/us/app/candy-crush-friends-saga/id1225867923?mt=8&uo=4&at=1010lce4



      Hack Features:
      - Infinite Moves (Won't subtract when use)
      - Infinite Lives (Won't subtract when quit lose)
      - Infinite Boosters (Won't subtract when use)


      Hack Download Link: https://iosgods.com/topic/80252-arm64-candy-crush-friends-saga-cheats-v109-2/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 620 replies
    • Groove Journey v3.1.4 Jailed Mod +1
      Modded/Hacked App: Groove Journey By Somtochukwu Mbala
      Bundle ID: com.kaipha.groovejourney
      iTunes Store Link: https://apps.apple.com/us/app/groove-journey/id6736345547?uo=4


      Hack Features:
      - PREMIUM


      iOS Hack Download IPA Link: https://iosgods.com/topic/190862-groove-journey-v311-jailed-mod-1/
        • Agree
        • Thanks
        • Winner
        • Like
      • 7 replies
    • Good Pizza, Great Pizza v5.22.4 +2 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Good Pizza, Great Pizza By TAPBLAZE, LLC
      Bundle ID: com.tapblaze.pizzabusiness
      iTunes Store Link: https://apps.apple.com/us/app/good-pizza-great-pizza/id911121200?uo=4


      Hack Features:
      - Unlimited Cash
      - Unlimited Diamonds


      Jailbreak required hack(s): [Mod Menu Hack] Good Pizza, Great Pizza v5.5.6 +2 Cheats [ Unlimited Currencies ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 244 replies
    • Good Pizza, Great Pizza v5.22.4 +2 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Good Pizza, Great Pizza By TAPBLAZE, LLC
      Bundle ID: com.tapblaze.pizzabusiness
      iTunes Store Link: https://apps.apple.com/us/app/good-pizza-great-pizza/id911121200?uo=4


      Hack Features:
      - Unlimited Cash
      - Unlimited Diamonds


      Non-Jailbroken & No Jailbreak required hack(s): [Non-Jailbroken Hack] Good Pizza, Great Pizza v5.5.6 +2 Jailed Cheats [ Unlimited Currencies ] - Free Non-Jailbroken IPA Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 140 replies
    • Dawn of Ages: Medieval Games v1.6.8 +1 Jailed Cheat [ Auto Win ]
      Modded/Hacked App: Dawn of Ages: Medieval Games By BoomBit, Inc.
      Bundle ID: com.stratospheregames.dawnofages
      iTunes Store Link: https://apps.apple.com/us/app/dawn-of-ages-medieval-games/id6477473268?uo=4


      Hack Features:
      - Auto Win


      Jailbreak required hack(s): [Mod Menu Hack] Dawn of Ages: Medieval Games v1.1.4 +1 Cheat [ Auto Win ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 67 replies
    • Loot Heroes v1.2.4 +8 Jailed Cheats [ Unlimited Currencies + More ]
      Modded/Hacked App: Loot Heroes: Fantasy RPG Games By BoomBit, Inc.
      Bundle ID: com.bbp.lootheroes
      iTunes Store Link: https://apps.apple.com/us/app/loot-heroes-fantasy-rpg-games/id6642699678?uo=4


      Hack Features:
      - Freeze Currencies
      - Unlimited Currencies [ VIP ]
      - God Mode -> Traps still cause damage.
      - One-Hit Kill
      - All Heroes Unlocked
      - Auto Win [ VIP ]
      - Battle Pass Unlocked [ VIP ]


      Jailbreak required hack(s): [Mod Menu Hack] Loot Heroes v1.1.5 +8 Cheats [ Unlimited Currencies + More ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Agree
        • Thanks
        • Like
      • 28 replies
    • Apple Grapple: Survivor v799 +50++ Jailed Cheats [ Debug Menu ]
      Modded/Hacked App: Apple Grapple: Survivor By Loop Games Oyun Teknolojileri Anonim Sirketi
      Bundle ID: com.loop.apple.grapple
      iTunes Store Link: https://apps.apple.com/us/app/apple-grapple-survivor/id6478910885?uo=4


      Hack Features:
      - Damage Multiplier
      - Defence Multiplier
      - Battle Pass Purchased
      - Debug Menu -> Head into Settings and toggle the Discord button.

      -> Set Player Health
      -> Set Player Speed
      -> Set Player Weapon
      -> Change Level
      -> Add/Remove Currencies
      -> Increase Battle Pass Kills
      -> Earn All Equipment
      -> Skip Tutorial

      + More!


      Jailbreak required hack(s): [Mod Menu Hack] Apple Grapple: Survivor v679 +50++ Cheats [ Debug Menu ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Informative
        • Agree
        • Thanks
        • Winner
        • Like
      • 6 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