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

    • Zoo Island: Wild Family Park v2.5.1 [ +3 Cheats ] Faster LvL UP
      Modded/Hacked App: Zoo Island: Wild Family Park By Sparkling Society Games B.V.
      Bundle ID: com.sparklingsociety.zoolife2animaltycoonparkbuildingsimulationgame
      App Store Link: https://apps.apple.com/us/app/zoo-island-wild-family-park/id6636482757?uo=4

      🤩 Hack Features

      - Currency / No Need
      - Resources  No Need
      - Faster LvL UP / Need 1 EXP
      • 5 replies
    • Narin Secrets of Dwarvenia v1.1.1 [ +3 Cheats ] Currency Max
      Modded/Hacked App: Narin By 1DER Entertainment s.r.o
      Bundle ID: com.OsOs.Narin
      App Store Link: https://apps.apple.com/us/app/narin/id6754609794?uo=4

      🤩 Hack Features

      - Unlimited Gems
      - Unlimited Gold
      - Unlimited Inventory Items
      • 9 replies
    • Lollipop: Sweet Taste Match3 v2610.0.0 [ +4 Cheats ] Auto Win
      Modded/Hacked App: Lollipop: Sweet Taste Match3 By BitMango, Inc.
      Bundle ID: com.bitmango.ap.lollipopmatch3
      App Store Link: https://apps.apple.com/us/app/lollipop-sweet-taste-match3/id1118803687?uo=4
       

      🤩 Hack Features

      - Auto Win [ Enable Before Playing ]
      - Coins
      - Life
      - Booster
      • 14 replies
    • Meow Tower - Nonogram Puzzle v3.4.701 [ +3 Cheats ] Currency Max
      Modded/Hacked App: Meow Tower - Nonogram Puzzle By HyperBeard Inc.
      Bundle ID: com.grapetree.meowtower
      iTunes Store Link: https://apps.apple.com/us/app/meow-tower-nonogram-puzzle/id1579122980?uo=4


      🚀 Hack Features

      - ADS NO
      - Gold CANS
      - Pencil Max 
      - Hints Max
      • 24 replies
    • Backpacker™ Go! v1.9.2 [ +3 Cheats ] Dice Unlimited
      Modded/Hacked App: Backpacker™ Go! By Qiiwi Games AB
      Bundle ID: com.qiiwi.backpackergo
      iTunes Store Link: https://apps.apple.com/us/app/backpacker-go/id6478389736?uo=4


      Hack Features:
      - ADS NO [ Between Playing ] 
      - Cash Unlimited [ This Hack Linked Other Items - Ticket Exp Etc. Use Only Cash ] Use Another Items Maybe Game Freeze But Works  
      - Dice Unlimited
      - 
      • 41 replies
    • Hero Survival IO 2 V1.1.9 [ +8 APK MOD ] Currency Max
      Mod APK Game Name: Hero Survival IO 2
      Rooted Device: Not Required.
      Google Play Store Link: https://play.google.com/store/apps/details?id=com.game.hero.survival.io2&hl=en
       
      🤩 Hack Features

      - No ADS / Rewards Free
      - Gems Unlimited / Achievements Rewards
      - Gold Unlimited / In Battle Pick Box
      - ATK / In The Battle Pick skill
      - HP / In The Battle Pick skill
      - Def / In The Battle Pick skill
      - Skill EXP / Pick One Exp Quickly Get All Skill
      • 3 replies
    • Tropic Match v1.4 [ +5 Cheats ] Auto Win
      Modded/Hacked App: Tropic Match By BTMK s.r.o.
      Bundle ID: com.rebelgames.tropicmatch
      iTunes Store Link: https://apps.apple.com/us/app/tropic-match/id6547859499?uo=4


      🤩 Hack Features

      - Auto Win

      - Coins

      - Stars

      - Lives

      - Booster
      • 2 replies
    • Pandao Wars: Fight for Freedom v0.8.1 [ +2 Cheats ] Currency Max
      Modded/Hacked App: Pandao Wars: Fight for Freedom By JBX GAMES DOO
      Bundle ID: com.jbxgames.island.wars.fight.defender
      App Store Link: https://apps.apple.com/ca/app/pandao-wars-fight-for-freedom/id6479307717?uo=4 

      🤩 Hack Features

      - Crystal
      - Coins
      - 
      - 
      • 18 replies
    • Grow Soldier v4.8.5 [ +11 Cheats ] Currency Max
      Modded/Hacked App: Grow Soldier By gitae park
      Bundle ID: com.pixelstar.GrowSoldier
      iTunes Store Link: https://apps.apple.com/us/app/grow-soldier/id1451946558?uo=4



      Hack Features:
      - Gems Max 

      - Gold [ Drop Enemy ]

      - Ruby Max 

      - Coins +3 [ Blue Red Dark ] 

      - Mileage Coins 

      - Ticket +4 

      - DMG HP Crit [ Lab Artifact LvL UP ] 

      - Lab Production LvL UP Gem

      - Population Unlimited [ Linked Lab Production ]

      - Solder Box Unlimited [ Linked Lab Production ] 

      - Auto Marge Fast [ Linked Lab Production ]
      • 9 replies
    • Grow Survivor v8.3.7 [ +3 Cheats ] DMG
      Modded/Hacked App: Grow Survivor By gitae park
      Bundle ID: com.pixelstar.GrowSurvivor
      iTunes Store Link: https://apps.apple.com/us/app/grow-survivor/id1361842156?uo=4

      Hack Features:
      - Ammo Max [ Just Tap To Shoot Enemy ]
      - No Reload [ Just Tap To Shoot Enemy ]
      - DMG [ Just Change Gun ]
      - 
      • 15 replies
    • Baseball GOAT v3.0.33 [ +2 Cheats ] Energy Max
      Modded/Hacked App: Baseball GOAT By Red Falcon Games Limited
      Bundle ID: com.redfalcon.baseballgoat.ios
      App Store Link: https://apps.apple.com/us/app/baseball-goat/id6677019784?uo=4

      🤩 Hack Features

      - Unlimited Energy
      - ADS Pack Active / Rewards Free
      • 2 replies
    • Only Grind: Loot & Fight v1.3.3 [ +11 Cheats ] Currency Max
      Modded/Hacked App: Only Grind: Loot & Fight By Chi Ngo
      Bundle ID: io.onlychads.onlygrind
      App Store Link: https://apps.apple.com/us/app/only-grind-loot-fight/id6499444042?uo=4

       
      🤩 Hack Features

      - IAP FREE [ Buy Anything ] ADS

      - Gems [ Earn Then Get ]

      - Success Rate Gems [ UP Then Get ]

      - Chest +5

      - Gold [ Sell Then Get ]

      - Gold [ Merge Gems Then Get ]

      - Gold [ Up Then Get ]

      - HP

      - DEF

      - ATK

      - Criti DMG
      • 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