Jump to content

Bullet Force Mod Menu Source Code


261 posts in this topic

Recommended Posts

Updated (edited)

Updated GitHub: https://github.com/shmoo419/BulletForceModMenu

 

Offsets are removed. A simple, efficient menu based around arrays. Lots of global floats because for some reason, when I passed in a float via a parameter, it went to 0.0 on my device but not in iOS Simulator -_-

Individual calls to writedata are present because for instant reload and always headshot, more than one offset was needed. I tried keeping everything in the arrays but it eventually became a cluttered mess of if statements so I just went with individual calls.

I was able to get away with hardcoding frame values because I'm the only one using this menu.

Hidden Content

    #import <UIKit/UIKit.h>
    #import "writeData.h"
    #import "Macros.h"
    
    void makeZeroXLabel(CGFloat, CGFloat, CGFloat, CGFloat);
    
    int arrayCreationCount = 0;
    
    float labelSpacing = 5.0;
    float switchSpacing = 0.5;
    float bulletTypeAndGrenadeTypeSpacing = 8.0;
    
    float labelXValue = 8.0;
    float labelWidth = 270.0;
    float labelHeight = 21.0;
    
    float switchXValue = 319.0;
    float switchWidth = 51.0;
    float switchHeight = 31.0;
    
    float bulletTypeAndGrenadeTypeXValue = 102.0;
    float bulletTypeAndGrenadeTypeWidth = 173.0;
    float bulletTypeAndGrenadeTypeHeight = 30.0;
    
    NSArray *labelArray;
    NSArray *bulletArray;
    NSArray *grenadeArray;
    
    NSUserDefaults *defaults;
    
    UIBlurEffect *blurEffect;
    UIView *blurEffectView;
    
    UIButton *bulletChooserButton;
    UIButton *closeMenu;
    UIButton *set;
    
    UIView *closeButtonBackgroundView;
    UIView *separator;
    
    UIViewController *main;
    
    UILabel *writeToOffset;
    UILabel *zeroX;
    UILabel *typeStatus;
    
    UIScrollView *normalModsScrollView;
    UIScrollView *bulletTypeScrollView;
    UIScrollView *grenadeTypeScrollView;
    
    UISegmentedControl *pageSelector;
    
    UITextField *offsetTextField;
    UITextField *hexTextField;
    
    UITableView *bulletTypeChooser;
    UITableView *grenadeTypeChooser;
    
    uint64_t offsetArray[20] = {- removed -};
    uint64_t moddedHexArray[17] = {- removed -};
    uint64_t originalHexArray[20] = {- removed -};
    uint64_t chooserHexes[25] = {- removed -};
    
    %hook UnityAppController
    
    - (void)applicationDidBecomeActive:(id)arg1 {
    %orig;
    
    main = [UIApplication sharedApplication].keyWindow.rootViewController;
    
    bulletChooserButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    bulletChooserButton.frame = CGRectMake((main.view.frame.size.width/2)-15,(main.view.frame.size.height/2)+50,30,30);
    bulletChooserButton.backgroundColor = [UIColor clearColor];
    bulletChooserButton.layer.cornerRadius = 16;
    bulletChooserButton.layer.borderWidth = 2.0f;
    bulletChooserButton.layer.borderColor = [UIColor colorWithRed:254.00/255.00 green:184.00/255.00 blue:0.00/255.00 alpha:1.0f].CGColor;
    [bulletChooserButton addTarget:self action:@[member='selectorr'](showMenu) 
    forControlEvents:UIControlEventTouchDragInside];
    [main.view addSubview:bulletChooserButton];
    }
    
    %new
    - (void)showMenu {
        defaults = [NSUserDefaults standardUserDefaults];
    
        if(arrayCreationCount == 0){
    
        [self setupMenuGUI];
        [self setupSwitchesAndLabels];
        [self setupBulletTypeSection];
        [self setupGrenadeTypeSection];
        [self setupCloseButtonStuff];
        }
        
        arrayCreationCount++;
    }
    
    %new
    - (void)setupBulletTypeSection {
        bulletTypeScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 73, 376, 184)];
        bulletTypeScrollView.backgroundColor = [UIColor clearColor];
        bulletTypeScrollView.contentSize = CGSizeMake(376, 640);
        bulletTypeScrollView.hidden = true;
        [blurEffectView addSubview:bulletTypeScrollView];
        
        [self setupBulletTypeButtons];
    }
    
    %new
    - (void)setupGrenadeTypeSection {
        grenadeTypeScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 73, 376, 184)];
        grenadeTypeScrollView.backgroundColor = [UIColor clearColor];
        grenadeTypeScrollView.contentSize = CGSizeMake(376, 0);
        grenadeTypeScrollView.hidden = true;
        [blurEffectView addSubview:grenadeTypeScrollView];
        
        [self setupGrenadeTypeButtons];
    }
    
    %new
    - (void)setupSwitchesAndLabels {
        labelArray = @[@"No Recoil", @"Better Aim", @"Infinite Ammo", @"Modded Gravity", @"Anti Flashbang", @"Everyone Orange", @"Crosshairs Always Enabled", @"25555.0 Pickup Range", @"Sniper Light Shows Through Walls", @"Knife Button Always Shows", @"Knife Faster", @"Debug Rechamber Animation", @"Instant Reload", @"God Mode Lobby", @"Always Headshot", @"All Camos", @"Killstreaks Ready", @"Deaths Don't Count", @"Instant Grenade Explosion"];
        
        UISwitch *s;
        
        for(int i=0; i<[labelArray count]; i++){
            [normalModsScrollView addSubview:[self makeHackLabel:labelArray[i]]];
            
            s = [self makeHackSwitch:i];
            
            [normalModsScrollView addSubview:s];
            [self setSwitchStateBasedOnPrefs:i withSwitch:s];
            
            if([defaults boolForKey:[NSString stringWithFormat:@"%d", (int)s.tag]]){
                [self switchToggled:s];
            }
            
        }
    }
    
    %new
    - (void)setupBulletTypeButtons {
        bulletArray = @[@"Original", @"M4A1", @"Famas", @"AK 12", @"SCAR-H", @"MP5", @"870 MCS", @"M40A5", @"MPX", @"SAIGA 12K", @"MG4", @"AS VAL", @"RPG", @"M200", @"Compact .45", @"MP412 REX", @"M320 HE", @"M320 DART", @"Hand", @"Butterfly Knife", @"G18"];
        
        for(int i=0; i<[bulletArray count]; i++){
            [bulletTypeScrollView addSubview:[self makeTypeChooserButton:bulletArray[i] withTag:i]];
        }
    }
    
    %new
    - (void)setupGrenadeTypeButtons {
        bulletTypeAndGrenadeTypeSpacing = 8.0;
        
        grenadeArray = @[@"Original", @"Frag Grenade", @"Smoke Grenade", @"Flashbang"];
        
        int bulletArrayLength = (int)[bulletArray count];
        
        for(int i=0; i<[grenadeArray count]; i++){
            [grenadeTypeScrollView addSubview:[self makeTypeChooserButton:grenadeArray[i] withTag:i+bulletArrayLength]];
        }
    }
    
    %new
    - (void)setupMenuGUI {
        blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
        
        blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
        blurEffectView.frame = CGRectMake(145, 44, 376, 286);
        [main.view addSubview:blurEffectView];
        
        writeToOffset = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 376, 19)];
        writeToOffset.text = @"Write To A Custom Offset";
        writeToOffset.textAlignment = NSTextAlignmentCenter;
        [writeToOffset setFont:[UIFont systemFontOfSize:12]];
        [blurEffectView addSubview:writeToOffset];
        
        makeZeroXLabel(8, 28, 22, 21);
        [blurEffectView addSubview:zeroX];
        
        makeZeroXLabel(205, 28, 22, 21);
        [blurEffectView addSubview:zeroX];
        
        offsetTextField = [[UITextField alloc] initWithFrame:CGRectMake(29, 24, 140, 30)];
        offsetTextField.placeholder = @"OFFSET";
        offsetTextField.returnKeyType = UIReturnKeyDone;
        offsetTextField.tag = 0;
        [blurEffectView addSubview:offsetTextField];
        
        hexTextField = [[UITextField alloc] initWithFrame:CGRectMake(228, 24, 140, 30)];
        hexTextField.placeholder = @"HEX";
        hexTextField.returnKeyType = UIReturnKeyDone;
        hexTextField.tag = 1;
        [blurEffectView addSubview:hexTextField];
        
        set = [UIButton buttonWithType:UIButtonTypeCustom];
        set.frame = CGRectMake(157, 51, 63, 26);
        set.backgroundColor = [UIColor clearColor];
        [set setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [set setTitle:@"Set" forState:UIControlStateNormal];
        [set addTarget:self action:@[member='selectorr'](writeToCustomOffset) forControlEvents:UIControlEventTouchDown];
        [blurEffectView addSubview:set];
        
        pageSelector = [[UISegmentedControl alloc] initWithItems:@[@"Normal Mods", @"Bullet Type", @"Grenade Type"]];
        pageSelector.frame = CGRectMake(87, 257, 289, 29);
        [pageSelector setSelectedSegmentIndex:0];
        [pageSelector addTarget:self
                         action:@[member='selectorr'](changeView:)
               forControlEvents:UIControlEventValueChanged];
        [blurEffectView addSubview:pageSelector];
        
        normalModsScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 73, 376, 184)];
        normalModsScrollView.backgroundColor = [UIColor clearColor];
        normalModsScrollView.contentSize = CGSizeMake(376, 580);
        [blurEffectView addSubview:normalModsScrollView];
    }
    
    %new
    - (void)setupCloseButtonStuff {
        separator = [[UIView alloc] initWithFrame:CGRectMake(0, 73, 376, 1)];
        separator.backgroundColor = [UIColor blackColor];
        [blurEffectView addSubview:separator];
        
        closeButtonBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 258, 87, 28)];
        closeButtonBackgroundView.backgroundColor = rgb(0xaa0114);
        closeButtonBackgroundView.layer.cornerRadius = 5;
        [blurEffectView addSubview:closeButtonBackgroundView];
        
        closeMenu = [UIButton buttonWithType:UIButtonTypeCustom];
        closeMenu.frame = CGRectMake(0, 258, 87, 30);
        closeMenu.backgroundColor = [UIColor clearColor];
        [closeMenu setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [closeMenu setTitle:@"Close" forState:UIControlStateNormal];
        [closeMenu addTarget:self action:@[member='selectorr'](closeModMenu) forControlEvents:UIControlEventTouchDown];
        [blurEffectView addSubview:closeMenu];
    }
    
    %new
    - (void)setSwitchStateBasedOnPrefs:(int)tag withSwitch:(UISwitch *)s {
        s.on = [defaults boolForKey:[NSString stringWithFormat:@"%d", tag]];
    }
    
    %new
    - (void)switchToggled:(UISwitch *)sender {
        int switchTag = (int)sender.tag;
        
        //instant reload
        if(switchTag == 12){
            if(sender.on){
                write(- removed -, - removed -);
                write(- removed -, - removed -);
            }
            else{
                write(- removed -, - removed -);
                write(- removed -, - removed -);
            }
        }
        else if(switchTag == 13){
            if(sender.on){
                write(offsetArray[switchTag-1], moddedHexArray[switchTag-1]);
            }
            else{
                write(offsetArray[switchTag-1], originalHexArray[switchTag-1]);
            }
        }
        //always headshot
        else if(switchTag == 14){
            if(sender.on){
                write(- removed -, - removed -);
                write(- removed -, - removed -);
                write(- removed -, - removed -);
            }
            else{
                write(- removed -, - removed -);
                write(- removed -, - removed -);
                write(- removed -, - removed -);
            }
        }
        else{
            if(switchTag > 14){
                if(sender.on){
                    write(offsetArray[switchTag-2], moddedHexArray[switchTag-2]);
                }
                else{
                    write(offsetArray[switchTag-2], originalHexArray[switchTag-2]);
                }
            }
            else{
                if(sender.on){
                    write(offsetArray[switchTag], moddedHexArray[switchTag]);
                }
                else{
                    write(offsetArray[switchTag], originalHexArray[switchTag]);
                }
            }
        }
        
        [defaults setBool:sender.on forKey:[NSString stringWithFormat:@"%d", (int)sender.tag]];
    }
    
    %new
    - (void)changeView:(UISegmentedControl *)sender {
        [self showViewBasedOnSelectedIndex:(int)pageSelector.selectedSegmentIndex];
    }
    
    %new
    - (void)writeToCustomOffset {
        [offsetTextField resignFirstResponder];
        [hexTextField resignFirstResponder];
        
        write([offsetTextField.text longLongValue], [hexTextField.text longLongValue]);
        
        offsetTextField.text = @"";
        hexTextField.text = @"";
    }
    
    %new
    - (void)applyTypeChooserHack:(UIButton *)button {
        [typeStatus removeFromSuperview];
        
        NSAttributedString *typeStatusBold;
        NSString *text;
    
        if((int)button.tag>19){
            write(- removed -, chooserHexes[(int)button.tag]);
    
            text = [NSString stringWithFormat:@"Grenade type changed to %@", button.titleLabel.text];
        }
        else{
            write(- removed -, chooserHexes[(int)button.tag]);
    
            text = [NSString stringWithFormat:@"Bullet type changed to %@", button.titleLabel.text];
        }
        
        typeStatus = [[UILabel alloc] initWithFrame:CGRectMake(138, 6, 391, 21)];
        typeStatus.textColor = [UIColor redColor];
        typeStatus.textAlignment = NSTextAlignmentCenter;
        typeStatusBold = [[NSAttributedString alloc] initWithString:text
                                                         attributes:@{ NSFontAttributeName: [UIFont boldSystemFontOfSize:18.0] }];
        typeStatus.attributedText = typeStatusBold;
        
        [main.view addSubview:typeStatus];
        
        [self performSelector:@[member='selectorr'](removeLabel) withObject:@NO afterDelay:3];
    }
    
    %new
    - (void)showViewBasedOnSelectedIndex:(int)index {
        if(index == 0){
            bulletTypeScrollView.hidden = true;
            grenadeTypeScrollView.hidden = true;
            normalModsScrollView.hidden = false;
        }
        else if(index == 1){
            bulletTypeScrollView.hidden = false;
            grenadeTypeScrollView.hidden = true;
            normalModsScrollView.hidden = true;
        }
        else{
            bulletTypeScrollView.hidden = true;
            grenadeTypeScrollView.hidden = false;
            normalModsScrollView.hidden = true;
        }
    }
    
    %new
    - (UIButton *)makeTypeChooserButton:(NSString *)title withTag:(int)tag {
        UIButton *toReturn = [UIButton buttonWithType:UIButtonTypeCustom];
        toReturn.frame = CGRectMake(bulletTypeAndGrenadeTypeXValue, bulletTypeAndGrenadeTypeSpacing, bulletTypeAndGrenadeTypeWidth, bulletTypeAndGrenadeTypeHeight);
        toReturn.backgroundColor = [UIColor clearColor];
        toReturn.tag = tag;
        [toReturn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [toReturn setTitle:title forState:UIControlStateNormal];
        [toReturn addTarget:self action:@[member='selectorr'](applyTypeChooserHack:) forControlEvents:UIControlEventTouchDown];
    
        bulletTypeAndGrenadeTypeSpacing+=30.0f;
    
        return toReturn;
    }
    
    %new
    - (UISwitch *)makeHackSwitch:(int)tag {
        UISwitch *toReturn = [[UISwitch alloc] initWithFrame:CGRectMake(switchXValue, switchSpacing, switchWidth, switchHeight)];
        toReturn.transform = CGAffineTransformMakeScale(0.5, 0.5);
        toReturn.onTintColor = rgb(0x228b28);
        toReturn.tag = tag;
        [toReturn addTarget:self action:@[member='selectorr'](switchToggled:) forControlEvents:UIControlEventValueChanged];
    
        switchSpacing+=30.0f;
        
        return toReturn;
    }
    
    %new
    - (UILabel *)makeHackLabel:(NSString *)text {
        UILabel *toReturn = [[UILabel alloc] initWithFrame:CGRectMake(labelXValue, labelSpacing, labelWidth, labelHeight)];
        toReturn.text = text;
    
        labelSpacing+=30.0f;
        
        return toReturn;
    }
    
    %new
    - (void)removeLabel {
        [typeStatus removeFromSuperview];
    }
    
    %new
    - (void)closeModMenu {
        arrayCreationCount = 0;
        labelSpacing = 5.0;
        switchSpacing = 0.5;
        bulletTypeAndGrenadeTypeSpacing = 8.0;
    
        [blurEffectView removeFromSuperview];
    }
    %end
    
    void makeZeroXLabel(CGFloat x, CGFloat y, CGFloat w, CGFloat h){
        zeroX = [[UILabel alloc] initWithFrame:CGRectMake(x, y, w, h)];
        zeroX.text = @"0x";
    }

Updated by Guest
Posted

This is superb @Shmoo well done. And I know you pretty much spend a lot of time working on the GUI and though it is totally in individual because of the array.

 

But it's okay then. +Rep. :)

  • Our picks

    • Idle Army: Trading Weapons v1.12.2 [+5 Jailed Cheats]
      Modded/Hacked App: Idle Army: Trading Weapons By UNIMOB VIET NAM COMPANY LIMITED
      Bundle ID: com.unimob.idle.army
      App Store Link: https://apps.apple.com/us/app/idle-army-trading-weapons/id6670773625?uo=4



      🤩 Hack Features

      - Always Enough Resources (Gem, Skip Ads etc.)
      - Max Gold (Enable inside game)
      - 2x Game Speed (Enable inside game)
      - Kill Monster (Enable inside game)
      - Add All Pet

      • 1 reply
    • Idle Army: Trading Weapons v1.12.2 [+5 Cheats]
      Modded/Hacked App: Idle Army: Trading Weapons By UNIMOB VIET NAM COMPANY LIMITED
      Bundle ID: com.unimob.idle.army
      App Store Link: https://apps.apple.com/us/app/idle-army-trading-weapons/id6670773625?uo=4

       

      🤩 Hack Features

      - Always Enough Resources (Gem, Skip Ads etc.)
      - Max Gold (Enable inside game)
      - 2x Game Speed (Enable inside game)
      - Kill Monster (Enable inside game)
      - Add All Pet

      • 1 reply
    • Margonem Adventures v1.16.2 [+3 Jailed Cheats]
      Modded/Hacked App: Margonem Adventures By GARMORY sp. z o.o. sp. k.
      Bundle ID: pl.Garmory.MargonemAdventures
      iTunes Store Link: https://apps.apple.com/us/app/margonem-adventures/id6444410609?uo=4

       

      🤩 Hack Features

      - Enemy Can't Move
      - Enemy Can't Attack
      - Unlimited Mana
      • 18 replies
    • Margonem Adventures v1.16.2 [+3 Cheats]
      Modded/Hacked App: Margonem Adventures By GARMORY sp. z o.o. sp. k.
      Bundle ID: pl.Garmory.MargonemAdventures
      iTunes Store Link: https://apps.apple.com/us/app/margonem-adventures/id6444410609?uo=4



      🤩 Hack Features

      - Enemy Can't Move
      - Enemy Can't Attack
      - Unlimited Mana
      • 11 replies
    • XP Hero v9.0.0 [+3 Cheats]
      Modded/Hacked App: XP Hero By Supercent Inc.
      Bundle ID: io.supercent.weaponrpg
      iTunes Store Link: https://apps.apple.com/us/app/xp-hero/id6740618570?uo=4



      🤩 Hack Features

      - Add Currency (Enable and You'll Recieve All Currency)
      - Add Xp
      - Enemy Can't Attack
       
      • 7 replies
    • XP Hero v9.0.0 [+3 Jailed Cheats]
      Modded/Hacked App: XP Hero By Supercent Inc.
      Bundle ID: io.supercent.weaponrpg
      iTunes Store Link: https://apps.apple.com/us/app/xp-hero/id6740618570?uo=4



      🤩 Hack Features

      - Add Currency (Enable and You'll Recieve All Currency)
      - Add Xp
      - Enemy Can't Attack
      • 6 replies
    • Townfall: Zombie Tower Defense v20.2.5 [+4 Cheats]
      Modded/Hacked App: Townfall: Zombie Tower Defense By Sugarscone
      Bundle ID: com.nmg.townfall.ios
      App Store Link: https://apps.apple.com/us/app/townfall-zombie-tower-defense/id6476259669?uo=4



      🤩 Hack Features

      - No Reload
      - Add Gold (Enable inside battle and finish stage)
      - Add Wood (Enable inside battle)
      - Skip Wave (Enable inside wave)
      • 11 replies
    • Townfall: Zombie Tower Defense v20.2.5 [+4 Jailed Cheats]
      Modded/Hacked App: Townfall: Zombie Tower Defense By Sugarscone
      Bundle ID: com.nmg.townfall.ios
      App Store Link: https://apps.apple.com/us/app/townfall-zombie-tower-defense/id6476259669?uo=4



      🤩 Hack Features

      - No Reload
      - Add Gold (Enable inside battle and finish stage)
      - Add Wood (Enable inside battle)
      - Skip Wave (Enable inside wave)
      • 16 replies
    • Endless Wander - Roguelike RPG v2.4.22 [+3 Jailed Cheats]
      Modded/Hacked App: Endless Wander - Roguelike RPG By First Pick Studios
      Bundle ID: com.FirstPickStudios.Endless-Wander
      App Store Link: https://apps.apple.com/us/app/endless-wander-roguelike-rpg/id6473157705?uo=4



      🤩 Hack Features

      - Never Die
      - Always Enough Currency
      - Unlimited Currency (Will Always Increase)
      • 11 replies
    • Endless Wander - Roguelike RPG v2.4.22 [+3 Cheats]
      Modded/Hacked App: Endless Wander - Roguelike RPG By First Pick Studios
      Bundle ID: com.FirstPickStudios.Endless-Wander
      App Store Link: https://apps.apple.com/us/app/endless-wander-roguelike-rpg/id6473157705?uo=4



      🤩 Hack Features

      - Never Die
      - Always Enough Currency
      - Unlimited Currency (Will Always Increase)
       
      • 10 replies
    • Once Upon A Match v0.6.110 [ +9 Cheats ] Currency Max
      Modded/Hacked App: Once Upon A Match By CRAZY LABS BY TABTALE , G.P.
      Bundle ID: com.funnyigames.puzzleblastrpg
      App Store Link: https://apps.apple.com/us/app/once-upon-a-match/id1503025062?uo=4


      🤩 Hack Features

      - Gems

      - Energy

      - Energy PvP

      - Gold

      - Food

      - Recuits

      - Attack

      - Enemy 1 [ Every Wave ]

      - NO Turn [ Enemy ]

      Note:- Currency Visual But Works
      • 4 replies
    • Once Upon A Match v0.6.110 [ +9 Jailed ] Currency Max
      Modded/Hacked App: Once Upon A Match By CRAZY LABS BY TABTALE , G.P.
      Bundle ID: com.funnyigames.puzzleblastrpg
      App Store Link: https://apps.apple.com/us/app/once-upon-a-match/id1503025062?uo=4



      🤩 Hack Features

      - Gems

      - Energy

      - Energy PvP

      - Gold

      - Food

      - Recuits

      - Attack

      - Enemy 1 [ Every Wave ]

      - NO Turn [ Enemy ]

      Note:- Currency Visual But Works
      • 0 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